Ok, so I have fixed this, but instead of just handing you a file(I'm doing that as well) I thought you guys might like some insight on how I fixed it and what tools I used to do it. These are all available for you outside of the debug version of the game to see where things went wrong.
So I knew that the high res textures were there but the low res were white. White being misc_static.cvbm leads me to believe the renderer was asking for a texture that we didn't have registered. This quickly lead me to seeing no texture in the str2. The export process spit one out, but since there wasn't a texture in the original shotgun container it didn't get included in the new one. This was due to the stuff above about the preload peg being built. Technically we might be able to remove the original shotgun texture from the preload peg for this mod, but I'm not going to mess with that.
Also note that I might have gotten lucky that the textures fit. With this being a preloaded item, I have a large pool with hopefully a lot of slop. It didn't break so I was happy.
Ok, so how do I get some new files into this str2 and make the game happy? vpkg is the answer. First I extracted the original asm file into xml via vpkg with
Code:
vpkg_wd -extract_asm items_preload_containers.asm_pc
This generated a file called items_preload_containers.xml. I searched that file for the shotgun and sure enough, no textures. So I needed to add textures to the xml. I didn't remember the syntax for this xml file, so I extracted the items_containers.asm_pc file for an example. There I found
Code:
<primitive>burst_ar_high.cpeg_pc
<type>Peg</type>
<flags>
<split_file>Yes</split_file>
<patchable>No</patchable>
</flags>
<allocation_group>0</allocation_group>
<cpu_size>294</cpu_size>
<gpu_size>1572880</gpu_size>
</primitive>
So I copied that over and changed the name of the primitive to match my file(pump_shotgun.cpeg_pc). I then updated the file sizes to match those on the peg I was adding.
Now vpkg has a way to generate a new str2 from an asm file, but it will try to build ALL the str2's from an asm. To cut down on stupid errors that might blow things up, I copied the xml into a new file I called shotgun_only.xml. It looked like this:
Code:
<asm>
<container>Shotgun-Gang
<type>Items Preload</type>
<flags>
<passive>No</passive>
<packfile_attached>Yes</packfile_attached>
</flags>
<compression_type>9</compression_type>
<stub_parent_name></stub_parent_name>
<aux_data_size>0</aux_data_size>
<compressed_data_size>304684</compressed_data_size>
<base_offset>274</base_offset>
<primitive>pump_shotgun.ccmesh_pc
<type>Character mesh</type>
<allocator>item preload</allocator>
<flags>
<split_file>Yes</split_file>
<patchable>No</patchable>
</flags>
<allocation_group>255</allocation_group>
<cpu_size>1264</cpu_size>
<gpu_size>315140</gpu_size>
</primitive>
<primitive>pump_shotgun.rig_pc
<type>Rig</type>
<allocator>item preload</allocator>
<flags>
<split_file>No</split_file>
<patchable>No</patchable>
</flags>
<allocation_group>255</allocation_group>
<cpu_size>586</cpu_size>
<gpu_size>0</gpu_size>
</primitive>
<primitive>pump_shotgun.cpeg_pc
<type>Peg</type>
<flags>
<split_file>Yes</split_file>
<patchable>No</patchable>
</flags>
<allocation_group>0</allocation_group>
<cpu_size>409</cpu_size>
<gpu_size>240320</gpu_size>
</primitive>
</container>
</asm>
Then I build the str2 with vpkg via
Code:
vpkg_wd -build_asm shotgun_only.xml
vpkg_wd -build_str2 shotgun_only.asm_pc
and then I opened up the str2 with the packfile viewer. I need some info from that in order to build a functioning game asm. I hope to make this easier, but for now you have to just suck it up and do the math. I highlighted all the files and looked at the two numbers for size:
You see the numbers don't add up exactly and the reason is the packfile header. Good thing I need this information. First off, I edit the xml value compressed_data_size to be 304684 to match the total size of the files in the packfile. Then I subtract 304684 from 304958 to get the header size of 274. I then plug that into the xml for base_offset. Then I build the items_preload_containers.asm_pc file with
Code:
vpkg_wd -build_asm items_preload_containers.xml
And now I have an updated str2 file with the textures that I needed along with an updated asm file that lists the textures and has the correct sizes in it. I copy them over and load the game and sure enough, things are happy.
Hopefully this helps you guys a bit with your hacking and playing around.