Chrisim gave a hint of this method in his post. I just tutorial-ized his method.
This is the way to add second texture to existent part of S3D models. Although the title says puzzle pieces this method can be applied to all model based network pieces.
A mod I showed in the NAM Development thread (http://sc4devotion.com/forums/index.php?topic=1138.msg222599#msg222599) was created using this method.
Advantage of this method is that you don't need to manually combine roadway texture and sidewalk texture again and again in image editing tool to cover all possible combinations of custom sidewalks and roadways. By inserting sidewalk texture as a base texture, it can be swapped independently from roadway texture.
I use the first tile of the road WRC S curve piece in this tutorial. Copy an S3D file you want to modify and paste it to a new blank dat. If a network piece uses separated models for each zoom level it would be better to pick a model for zoom 5 (usually the eighth digit of instance ID (IID) assigned for z5 model is 4).
After copying S3D file click the copied S3D file in the left pane. In the right pane click the
Anim tab (it should be opened by default, though).
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg269.imageshack.us%2Fimg269%2F5328%2Fs3dbaseoverlay01.gif&hash=a686044b6bc9897aeaa443d9cd00dadec3acfd8f)
Right click somewhere in the right pane and select
Add Group. Now you should have the second group. You might want to give a name to a new group.
Click
+ of both the first group and the second group. Copy existent group's values by pressing [ Ctrl ] + [ C ], then paste it to new group by pressing [ Ctrl ] + [ V ]. (Since this S3D had only one group, all values are 0. As new group always receive 0, you don't need to copy values in this case.) Base texture and overlay texture refer to the same
vertex block,
index block and
prim block, since they will be pasted onto the same part of model.
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg128.imageshack.us%2Fimg128%2F1403%2Fs3dbaseoverlay02.gif&hash=ade4c3180175bd2dc774e9a5272d1d702eba5822)
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg107.imageshack.us%2Fimg107%2F787%2Fs3dbaseoverlay03.gif&hash=88804e219a9ba59b531646585f39fe81323c742a)
You need to change value of
mat block to load different texture, value of
mat block corresponds to group number in the
Mats tab. Since lower groups always override upper groups, a base texture (sidewalk) should be set to the first group and an overlay texture (roadway) should be set to the second group.
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg55.imageshack.us%2Fimg55%2F7451%2Fs3dbaseoverlay04.gif&hash=6e5b20222b501ff5875015d4e9106e1b69d2a97c)
To reduce number of procedures I gave 1 to the first group and 0 to the second group. So replacing an already defined texture in the Group 0 in the
Mats tab is not needed.
Click the
Mats tab. Existing texture (Group 0) should be roadway texture. Here I add a texture for the second group defined in the
Anim tab. Right click and select
Add texture, then right click on the new group (Group 1) and select
Set texture.
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg128.imageshack.us%2Fimg128%2F5946%2Fs3dbaseoverlay05.gif&hash=27654a6311ea3630ef7ed9cb42e7c5aa95040332)
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg56.imageshack.us%2Fimg56%2F5342%2Fs3dbaseoverlay06.gif&hash=182d9a60bd22d92b440126f9431483e4e302ce70)
Change Instance/Name dialog opened. Enter IID of a sidewalk texture to the
Instance. Textures of group ID 0x1ABE787D can be used. IID I used here (0x0820000*) is the same as the medium wealth texture used for the draggable road type networks. If you wanted to adjust colors of sidewalk texture on puzzle pieces to match regular sidewalks, you would need to use new IID. If you are not sure IIDs you will assign are safe to use then please contact the NAM Team.
Name can be left blank, though, I prefer to give a name to remember what this texture is. Click
OK to close dialog.
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg107.imageshack.us%2Fimg107%2F8040%2Fs3dbaseoverlay07.gif&hash=2b8304cac54d59086e9e9a66a2087fa9efed49b7)
Change the Group 1 (sidewalk)'s setting to the same as this image. This is almost same as the setting used for the Maxis overpasses where heavy rail intersects with elevated networks. But disabled
alpha test option since this is a base texture (this is not necessarily needed for a base texture should have no alphamap, even if you enabled this option you will not get problem). And changed the
Wrap Mode to
clamb.
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg56.imageshack.us%2Fimg56%2F1002%2Fs3dbaseoverlay09.gif&hash=674b7a810c1c71d02517e5287ad7b524b68dbe04)
For reference, this is the setting for the Group 0 (roadway). Since this texture is an overlay you need to check
alpha test option to enable alphamap of texture.
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg128.imageshack.us%2Fimg128%2F3838%2Fs3dbaseoverlay10.gif&hash=085df709d92ab6f6b3bf92042f8b2c0b1a4b0f06)
Don't forget to click
Apply button after modifying an S3D file.
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg107.imageshack.us%2Fimg107%2F7028%2Fs3dbaseoverlay08.gif&hash=47a6dcd9850f0ed9188ebdb4906867fce725e4b4)
If you need to modify more piece repeat the same procedures for each piece. Finally save dat and test it in the game.
This is the result.
A | B | C |
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg61.imageshack.us%2Fimg61%2F3783%2Fs3dbaseoverlay11.jpg&hash=2d4b3ed379ff0fd8ca5d4aa22b9a42178f68f95b) | (https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg269.imageshack.us%2Fimg269%2F5485%2Fs3dbaseoverlay12.jpg&hash=358292f26da664a5241ca92e34639a8f9f21e46e) | (https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg107.imageshack.us%2Fimg107%2F513%2Fs3dbaseoverlay13.jpg&hash=ba117df669c05079e82856ad0f6d357a4a0ac61e) |
Modified S3D | A + Mas71_SideWalkTexture_01.dat (HD texture) | B + SFBT Euro Road Textures Mod |
As said in start of the topic I didn't use any image editing tool to combine textures. Game combines sidewalk and roadway like Lot Editor creations.
If you didn't find any errors then duplicate the dat and edit that duplicated dat for other zoom levels. Open the duplicated dat, change the eighth digit of IID by using the Reader's TGI Editor and replace IID of textures in the
Mats tab. You can skip the last steps if a network piece uses only one model for all zoom levels.
Please note that this method is not for allowing model based network pieces to be wealth dependent. You need to take different method for that purpose.
If you have any questions or problems with using this method please post here.