Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Pettifogging Legalist!
retired moderator
Original Poster
#1 Old 13th Nov 2014 at 6:11 PM Last edited by justJones : 6th May 2018 at 11:22 PM.
Default How to add/reference bump and spec maps to walls/floors (s4pe)
This is assuming you already have your images ready and the wall package done (I was using WallEz which only generates flat walls, but I needed bumps/specs too).

Edit: Works along the same lines for floors btw, hence why I edited the title.

I'm using s4pe0.2c for this with the wrappers from 0.2d plus Inge's wrappers from here/here (not all of these are relevant, but can't hurt to have them).


1. Open your package in s4pe

2. To add resources, you need to give them proper instances: you can use e.g. Hasher (recommended since it automatically sets the high bit) to generate them, or the built-in FNV tool in s4pe (Top menu > Tools) -- always include your creator tag to avoid conflicts! Copy the FNV64;

  1. Top menu > Resource > Add:
    • Type: _IMG (can type that into the box, you don't need to use the fiddly drop-scroll)
    • Group: 0x80000000
    • Instance: paste your FNV64 here
    Note that you need to untick "Use resource name", this seems to be currently broken. Press "OK".

  2. Right-click on the newly added resource (it'll show an "Error reading resource" text in the preview since there is no img yet for it to read) and select "Replace"; load your actual bump/spec

  3. Rinse and repeat for all the resources you want to add (usually one bump+spec per wall height)


3. To add the references, we first need to see which MATD is which:

  1. Sort your resource list by type and scroll to the first MATD: in the preview you will see an entry "DiffuseMap" with a TGI:

  2. You can click on the _IMG with that instance number to see which wall height we're dealing with (in this example, we see it's a short wall):


4. Now open the MATD in Grid view ("Grid" buttom at bottom of window), and open Chunk Entries > [0] > RCOL Block > Mtrl > SData by clicking on the three dots:


Add the following in this list ("Add" button at bottom):


  • ElementImageMapKey — Field: 0x19D7A3C0 (433562560) | Data: 0x00B2D882-0x00000000-0xCEB31003C33D903C
  • ElementImageMapKey — Field: 0xAD528A60 (SpecularMap) | Data: <TGI of your spec map for this wall height>
  • ElementImageMapKey — Field: 0x6E56548A (NormalMap) | Data: <TGI of your bump map for this wall height>
  • ElementFloat3 — Field: 0xB63546AC (SpecularUVSelector) | Data0: 0, Data1: 0, Data2: 0
  • ElementFloat3 — Field: 0x415368B4 (NormalMapUVSelector) | Data0: 0, Data1: 0, Data2: 0

"Normal Map" is mislabeled, this is actually the bump map. 0xCEB31003C33D903C is this thing (it always needs to be referenced otherwise boom). It does not matter which order the elements in this list have.

ETA, I meanwhile noticed that only the Maxis medium walls seem to have the latter two entries -- can probably skip those for tall and short walls.


Press "OK" and in Grid, "Commit". Rinse and repeat for all the MATDs. Save, test, done.

--

Instead of adding resources like in step 2, you could also name your dds files according to s4pe convention to begin with (0x00B2D882-0x00000000-0x586E958613402F90.dds etc), and then just import them all in one go (that sets the TGI automatically) instead of adding one by one. But that kind of file name makes things a little complicated when editing stuff since it's not exactly self-explaining for humans =P

If your wall has the same "shape" (molding, rails, panelling and other potruding bits) as an EA one, you can skip the importing part and reference the in-game textures directly instead. For finding them see this post (is about objects, but the same search tactics also apply). You should probably also do this when you already have redundant copies of EA bump/specs in your wall (i.e. delete the duplicate resources and link to them instead) to avoid unnecessarily bloated files.
Screenshots

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.
Advertisement
Pettifogging Legalist!
retired moderator
Original Poster
#2 Old 15th Nov 2014 at 4:28 PM
Default Referencing in-game bump/spec maps
In addition to the above post: when you have a wall that you want to use existing bump/spec maps for, it is probably simpler to copy the MATDs from that and replace your custom ones with them (changing only their instance and one reference each to your custom texture), rather than adding in the references as above.


1. Find the CWAL of an in-game wall with the bump/spec maps you want – i.e. get the hash of the in-game name (look it up e.g. here and search FullBuild0 for the key (Tools > Search, filter for CWAL); s4pe searching is also described here)

2. In the preview under "WallMATDEntryList" it will list the MATD for each wall height; find the instance of the first one in FullBuild0 (paste instance into filter box at the bottom, "Set", "Filter Active")

3. Copy and paste that MATD into your custom package (right-click > Copy)

4. Change its TGI to the one of your equivalent custom MATD (make sure you don't get the wall heights confused here, they're not always listed in the same order!): right-click > Copy ResourceKey on old MATD, doubleclick and paste on new one, then open it in Grid > ChunkEntries > [0] > TGIBlock and paste it in there too

5. Copy the TGI of your custom texture for this wall height

6. Open the new MATD in Grid again; in ChunkEntries > [0] > Mtrl > SData paste the TGI into the ElementTextureRef field. "OK", "Commit".


Same for the other two (or however many) MATDs.

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
#3 Old 21st Nov 2014 at 6:51 AM
I've found I have to greyscale my normal maps to work correctly on external walls . Otherwise the shadows etc are incorrect .
Pettifogging Legalist!
retired moderator
Original Poster
#4 Old 21st Nov 2014 at 9:58 AM
How did you add normal maps to walls in the first place? None of the Maxis walls seem to have any?

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
#5 Old 21st Nov 2014 at 6:27 PM
I edit the matd create an instance and choose elementtextureref when adding elements . Choose normal map and add the RK from the instance I created . That's what I do with the floors I've uploaded on here . It's the same process
Pettifogging Legalist!
retired moderator
Original Poster
#6 Old 22nd Nov 2014 at 9:58 AM
You mean this?



If this works the same in walls and floors (which I can't tell for sure, as I haven't done any floors yet), that is not the normal map, it's the bump map. It is only labelled wrong in s4pe.

(Actually your remark that they need to be grayscale is further evidence of that -- bumpmaps are grey scale, normal maps are disco coloured.)
Screenshots

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
#7 Old 10th Dec 2014 at 12:24 AM
Thank you for the tutorial. It was helpful but I found an even easier way to do this that I think you will love since you make a lot of walls and it's so much faster. I learned about it from a tutorial at sims 4 Studio today. Here is the link http://sims-studio.proboards.com/th...culars-painless.
Pettifogging Legalist!
retired moderator
Original Poster
#8 Old 10th Dec 2014 at 12:49 AM Last edited by plasticbox : 10th Dec 2014 at 1:04 AM.
This is a thread on how to do stuff in s4pe -- if you want to advertise other tools, please make your own thread. Also, I posted this way before S4S was able to deal with bump/spec maps; they've only added that recently for all I know. (Last I've seen they are plunking redundant copies of the original bump/spec maps into every wall btw .. instead of referencing it. How to do that, see above.)

Edit: also, I believe you are talking about the version that is currently in closed beta. The public one doesn't have that feature anyway, or does it?

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
#9 Old 10th Dec 2014 at 1:14 AM Last edited by 3Sierra3 : 10th Dec 2014 at 2:27 AM.
Oh I just thought you would want to know an easier way since you make a lot of walls. I made a wall with it and there is only one bump and spec for each wall height so it doesn't look like that's a problem. I guess it's pretty new but still it's a good thing that things are easier now right?

I don't know what you mean by closed beta. I just clicked the Preview section and downloaded the latest version. Just like it is here you have to log in to download. Maybe you forgot to log in?
Pettifogging Legalist!
retired moderator
Original Poster
#10 Old 10th Dec 2014 at 1:36 AM
Closed beta means members only. Not the general public. Same concept as with closed source, you know?

Again, if you want to continue talking about S4S please make your own thread now.

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
#11 Old 13th Dec 2014 at 11:10 PM
Just to clarify, the Sims 4 Studio does not do a closed beta. The second that we have a new feature (or features) that are in a decently stable state we release it for the community to test. I just want to make sure you have your facts straight for the future.
Pettifogging Legalist!
retired moderator
Original Poster
#12 Old 13th Dec 2014 at 11:31 PM Last edited by plasticbox : 14th Dec 2014 at 12:01 AM.
When I went to check (above), the feature Sierra mentioned was not in the public/stable version. So I can only conclude it must be in the preview one, which was not public at that point (not even the download post was accessible).

I'd appreciate if we could get back on topic of walls and floors and bumpmaps now .. ...... ... . ..... like I said about five times now, if you want to promote your tool please make/use your own threads and don't barge into everybody else's.

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.
Back to top