PDA

View Full Version : Non-Default Terrain Paints


Snaitf
1st Oct 2014, 7:51 PM
This is mostly for advanced users that already know how to use s4pe and hex editors.
Hopefully, someone will make a tool to automate this process, but for now, this is how it's done.

Anyhow, this is how I creted my new non-default terrain paint (http://www.modthesims.info/download.php?t=537083).

First, the terrain paint definition files are in fullbuild0, with a UNKN tag, and type 0xEBCBB16C.

Export one of those to a new .package, then open your .package and export the file (s4pe should give it an extension of .bnry), open that in a hex editor.

After the first 8 bytes, the next 4 bytes is the string table name hash, and the 4 bytes after that is the string table description hash (both reversed).

Towards the middle of the file, you should see 4 bytes similar to 3A 04 68 03, the 68 byte is what defines which category the terrain will be in: 68 for Dirt and Sand, 69 for Grass and Flowers, and 6A for Stone and Pavement.

And, towards the bottom, you'll see C5 9D 1C 81 01 00 00 00, right after that is the instance for the terrain's MATD file (type 0x01D0E75D), also located in fullbuild0 (reversed).

Export that file, adding it to your .package, then export it from your .package (s4pe should give it an extension of .material) and open it in a hex editor.

The first instance you see (right before the 5D E7 D0 01) is the instance of this MATD file itself (reversed).

And, near to the end of the file (right before the 82 D8 B2 00) you'll see another instance (reversed). This is the texture.

Find that texture in fullbuild6 (maybe in 7 or 8 instead, haven't checked them all), and export it to your .package.

---

So, here's what to do with all this.

First, give your terrain paint (the UNKN) a new instance.

Then, give your MATD a new instance, and hex edit both the UNKN and the MATD to match (reversed).

Change the byte in the UNKN to whichever category you want your terrain to show in.

Now, give your texture (_IMG) a new instance, and hex edit the MATD to match that (reversed).

Create a new string table with entries for the name and description, and hex edit the UNKN to match those (reversed).

Now you just need to export/edit/import the texture how you see fit.

And that should do it!

---

IMPORTANT

s4pe will allow you edit the MATD file directly with the "Grid" button, but it's bugged, and if you do this, it will mess up your MATD file and your terrain paint will not work. It must be edited via a hex editor. This gave me a headache for quite a while.

To export the texture, right-click it and choose "Save DDS", however, when you re-import it, "Load DDS" doesn't seem to work, at least for me. So just import from file and give it the same RK as your texture. At first, it will appear to have messed up, as the preview pane in s4pe will display an error. But after you save your .package, it should correct itself, at least that's how I've been doing it.

Feel free to use my .package as an example for the string tables. The English string table's instance starts with 00, the rest are for other languages, so the strings will display properly in all versions of the game. If you want to just use my string tables, import them into your .package, give them each a matching unique group id, and make sure to edit all 17 of them with your hashes and strings. This CAN be done through s4pe's "Grid", look for the little ellipses (...) button in the top right corner after clicking the Grid button (to the right of where it says "Dictionary: 0x02").

---

I hope this information has helped creators and tool makers alike. Please, if you try this, let me know if it worked for you, and if I've left anything out, or made any mistakes.

Good luck, and happy SIModding.

Ronja
2nd Oct 2014, 9:31 AM
It's to difficult for me without screenshot :(
I don't understand English very well, not enough to understand how to create a new instance with s4pe

but, thank you so much! It's really interesting :)

jeangraff30
12th Oct 2014, 12:32 PM
thanks for the tutorial, it took a while but I managed

jeangraff30
12th Oct 2014, 10:27 PM
Snaitf what type of file to first floor I do the rest

winxxx
12th Oct 2014, 11:56 PM
:up: Thank you very much for your lesson. I tried to change the texture in your file. In order to check the quality of my textures in the game. I loved it. (If interested, I add a screen.)
But unfortunately, I do not know English, so that to understand all that you wrote. For example, I did not understand what program it is necessary to process the file .bnry. And what happens then.
Can you add some screenshots that we could understand how you do it? Thank you again. Have a good weekend.
sorry for my english))
https://1.downloader.disk.yandex.ru/preview/22b60c5afaedafd3c1b00e42f5a10b14/mpfs/6xGrFnLh6ZakMgqkDEGG1-mB9Tq3hQs2asH9j27he30Tehz7k8RfEm44e_jFmZdN4ybf8rwg_mgtWrznj_BG2Q%3D%3D?uid=0&filename=122424png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&size=XXL&crop=0

gisakatze
13th Oct 2014, 12:01 AM
A really helpful tutorial. With this I created my first item for The Sims ever. I 'm very proud of it. Nevertheless, the recognition really belongs to you and your tutorial. My very first item is displayed in the game. But without a name and description. Just a question that would help me personally : How do you generate the hash for the name and the description?

Snaitf
13th Oct 2014, 2:32 AM
A really helpful tutorial. With this I created my first item for The Sims ever. I 'm very proud of it. Nevertheless, the recognition really belongs to you and your tutorial. My very first item is displayed in the game. But without a name and description. Just a question that would help me personally : How do you generate the hash for the name and the description?

s4pe has a built in hash generator, go to tools-fnv hash, then put some unique text in the top textbox, something like your name and the name of your creation and click the button.

Snaitf
13th Oct 2014, 2:33 AM
:up: Thank you very much for your lesson. I tried to change the texture in your file. In order to check the quality of my textures in the game. I loved it. (If interested, I add a screen.)
But unfortunately, I do not know English, so that to understand all that you wrote. For example, I did not understand what program it is necessary to process the file .bnry. And what happens then.
Can you add some screenshots that we could understand how you do it? Thank you again. Have a good weekend.
sorry for my english))
https://3.downloader.disk.yandex.ru/preview/e7c9160b545bde0bfeeffab3a7ee451b/mpfs/6xGrFnLh6ZakMgqkDEGG1-mB9Tq3hQs2asH9j27he30Tehz7k8RfEm44e_jFmZdN4ybf8rwg_mgtWrznj_BG2Q%3D%3D?uid=80866715&filename=122424png&disposition=inline&hash=&limit=0&content_type=image%2Fpng&size=999x792

to edit the bnry (binary) files, you need to use a hex editor

Snaitf
13th Oct 2014, 2:34 AM
Snaitf what type of file to first floor I do the rest

floors are type 0xB4F762C9

jeangraff30
13th Oct 2014, 7:39 PM
thank you

gisakatze
13th Oct 2014, 8:29 PM
Snaitf, you are my hero. With your help everything is very simple. Thank you so much again.

winxxx
4th Nov 2014, 1:18 AM
Hello. It's me again. I have one question.
Why when I create a Floorings on your scenario, the texture in the game looks larger than when I create through WallEz. It does not depend on the style of flooring. Image size and resolution are the same.
thank you
P.S. Sorry, could not find a spoiler to hide the picture.

https://img-fotki.yandex.ru/get/6527/80866715.c5/0_f7975_395d3a4e_orig

Snaitf
4th Nov 2014, 8:30 AM
Hello. It's me again. I have one question.
Why when I create a Floorings on your scenario, the texture in the game looks larger than when I create through WallEz. It does not depend on the style of flooring. Image size and resolution are the same.
thank you
P.S. Sorry, could not find a spoiler to hide the picture.

I'm not sure, but it may have something to do with the UV Scale in the MATD file.

Inge Jones
4th Nov 2014, 9:34 AM
It should be noted that with my new set of wrappers at http://www.den.simlogical.com/denforum/index.php?topic=3306.0 it is now possible to edit the terrain paint resource type 0xEBCBB16C in the Grid rather than hex.

kiwisims_4
8th Nov 2014, 11:35 PM
does anyone know which build the floorpaint img files are located ?

plasticbox
8th Nov 2014, 11:41 PM
There is a thread about that somewhere at EA forums ... I know I've seen it, have you looked there? Pretty sure it was in Modding > Technical.

kiwisims_4
9th Nov 2014, 12:17 AM
Thanks will go have a look :) been scrolling builds all day

plasticbox
9th Nov 2014, 1:02 AM
Here, I found it! http://forums.thesims.com/en_US/discussion/comment/12753559/#Comment_12753559 I think -- I've now also added this to the Tools sticky (http://modthesims.info/showthread.php?t=532317) in Tools (which also contains a list of Documentation, which I know may not be entirely obvious from the title =) ) because I meant to re-find it for that purpose before ..

Simmiller
3rd Dec 2014, 2:14 AM
Okay, I've got my new package with the _IMG, MATD, and TRPT. Great. However, since I am not by any stretch of the imagination proficient with Hex editing, I would like to know if I can simply give the instance a new set of numbers I make up from my head, or is there an option to change it within my Hex editor (I downloaded HxD from Cnet)? :help:

I found in a S3pe tutorial that I have to use the FNV hash tool to obtain a new instance. I'm going to translate that to s4pe and see what happens.

Buddybust1
20th Jun 2016, 10:47 PM
Time to try tot figure this out.

Inge Jones
21st Jun 2016, 9:23 AM
Sims 4 Studio creator's tool has terrain paint creation as one of its features. http://sims4studio.com/