![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
![]() |
#1 |
Stowaway
Posts: n/a
Downloads:
Uploads:
|
![]()
Well, as We can't re-import to the Secondary.dat without wrecking the animations, I used a hex editor on the dat itself.
The structure of the files in SH3 and SH4 is pretty well documented and many of the older Modders that worked in hex in 'the old days' gave what knowledge they had to assist Skwasjer with S3D. So, if you open the STOCK Secondary.dat in SH4 and export the AM_SOL_MRNP_01 3d Model and then open one of the obj files with note pad you can see the problem. Scroll down to the faces, (they look like this) f 17/1 35/4 38/3 f 38/3 12/2 17/1 f 151/219 150/218 3/5 f 3/5 28/8 151/219 f 278/9 147/12 106/11 and on and on............ You'll see they are broken up but call the same texture in the usemtl statements. That's what I fixed by hexing the file. Export the same 3d model from the adjusted Secondary.dat file and open it with Notepad and compare the difference. You'll see two textures and 2 faces sections. The second group of faces is the oar. 1st, I added the needed texture stuff with S3D. (You'll see that in the dat I modified as calling wood.dds, which is a stock dds file in the tex folders.) Next I wrote down the ID for the AM_SOL_MRNP_01 3D model. In S3D, you see it as this: 0xe7c2a0129fed0bc7 In a Hex editor it's reversed: c70bed9f12a0c2e7 I'm done with S3D at this point as it can't help us any further. It's not designed to adjust every little thing and that's fine. No one Tool for ANY job does everything! Next post will be the hex editing part after I get some files uploaded you may want to assist following along. |
![]() |
![]() |
#2 |
Stowaway
Posts: n/a
Downloads:
Uploads:
|
![]()
The files I wanted to upload?
I can not find. So I'll explain as I go. I use xvi32 hex editor. Here's the break down of the area we are interested in. With the Hex editor you use, search for the ID posted above. That will take you to the 3D object it the dat itself and you will see this line: c7 0b ed 9f 12 a0 c2 e7 00 60 01 00 00 we are interested in the 60 01 00 00, it equal the Verts of the object. 60 01 00 00 = 366, We need to jump down in Hex after we convert our jump length. The jump length is 366 x 3 x 4 + 1 = 4393 Why that must be done is simple. A Vert is 3 readings for the X Y Z placement and the dat uses 4 bytes for each axis. So a Vert is 12 bytes long, plus we need 1 to hit the faces count. Start from the last 00 in the 60 01 00 00 This will place you at the Faces section of the model. This is where I made the adjustments that changed the oar colors. You should be at B8 02 00 00 which = 696 which is our faces count. We need to jump down once again. The math for that is 696 x 13 = 9048 Why 13? Each Face takes 12 bytes PLUS a texture assignment. It's the texture assignment we need to change. Why must we change this? Texture assignment works like this. 00 is the base texture. 01 is the next texture, 02 the next and on and on. BUT if only one texture is assigned in the dat? It gets goofy as the numbers roll over. 01 = 00 02 = 00 And such as we don't have enuff textures assigned. Adding textures to the dat only partly fixes things. We want a complete solution. |
![]() |
![]() |
|
|