Sir Not Appearing In This Film
Original Poster
#1 Old 1st Oct 2014 at 7:51 PM Last edited by justJones : 7th May 2018 at 12:13 AM.
Default Non-Default Terrain Paints
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.
Advertisement
Lab Assistant
#2 Old 2nd Oct 2014 at 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
Lab Assistant
#3 Old 12th Oct 2014 at 12:32 PM
thanks for the tutorial, it took a while but I managed
Lab Assistant
#4 Old 12th Oct 2014 at 10:27 PM
Snaitf what type of file to first floor I do the rest
Test Subject
#5 Old 12th Oct 2014 at 11:56 PM Last edited by winxxx : 14th Nov 2014 at 3:02 AM.
Default That's great!
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...size=XXL&crop=0
Test Subject
#6 Old 13th Oct 2014 at 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?
Sir Not Appearing In This Film
Original Poster
#7 Old 13th Oct 2014 at 2:32 AM
Quote: Originally posted by gisakatze
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.
Sir Not Appearing In This Film
Original Poster
#8 Old 13th Oct 2014 at 2:33 AM
Quote: Originally posted by winxxx
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))


to edit the bnry (binary) files, you need to use a hex editor
Sir Not Appearing In This Film
Original Poster
#9 Old 13th Oct 2014 at 2:34 AM
Quote: Originally posted by jeangraff30
Snaitf what type of file to first floor I do the rest


floors are type 0xB4F762C9
Lab Assistant
#10 Old 13th Oct 2014 at 7:39 PM
thank you
Test Subject
#11 Old 13th Oct 2014 at 8:29 PM Last edited by gisakatze : 13th Oct 2014 at 10:22 PM.
Snaitf, you are my hero. With your help everything is very simple. Thank you so much again.
Test Subject
#12 Old 4th Nov 2014 at 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.

Sir Not Appearing In This Film
Original Poster
#13 Old 4th Nov 2014 at 8:30 AM
Quote: Originally posted by winxxx
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.
One horse disagreer of the Apocalypse
#14 Old 4th Nov 2014 at 9:34 AM
It should be noted that with my new set of wrappers at http://www.den.simlogical.com/denfo...hp?topic=3306.0 it is now possible to edit the terrain paint resource type 0xEBCBB16C in the Grid rather than hex.

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Test Subject
#15 Old 8th Nov 2014 at 11:35 PM
does anyone know which build the floorpaint img files are located ?
Pettifogging Legalist!
retired moderator
#16 Old 8th Nov 2014 at 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.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Test Subject
#17 Old 9th Nov 2014 at 12:17 AM
Thanks will go have a look been scrolling builds all day
Pettifogging Legalist!
retired moderator
#18 Old 9th Nov 2014 at 1:02 AM
Here, I found it! http://forums.thesims.com/en_US/dis...omment_12753559 I think -- I've now also added this to the Tools sticky 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 ..

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Rabid Recoloring Renegade
retired moderator
#19 Old 3rd Dec 2014 at 2:14 AM Last edited by Simmiller : 8th Dec 2014 at 6:33 AM.
Default Besides the fact that you're awesome:
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)?

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.
Test Subject
#20 Old 20th Jun 2016 at 10:47 PM
Time to try tot figure this out.
One horse disagreer of the Apocalypse
#21 Old 21st Jun 2016 at 9:23 AM
Sims 4 Studio creator's tool has terrain paint creation as one of its features. http://sims4studio.com/

"You can do refraction by raymarching through the depth buffer" (c. Reddeyfish 2017)
Back to top