Self-made weapons crash the game

Hello there,
For a while now I've been wanting to make some self-made weapons, few days I've been working on trying to make some of them already. In the new format, already existing meshes should work, I don't think I've encountered problems I can't solve.

But today I've tried turning flow754's T3k Urban into a standalone weapon (not to release it for everyone unless permitted to do so). It mostly works fine, UI images are showing up fine and all, but when you buy the gun, the game crashes. :eek:


If anyone wants to test it out and help narrowing down the origin of this issue, it'll be greatly appreciated.
 

Attachments

  • Tek 9 Standalone Weapon.zip
    6 MB · Views: 659
But today I've tried turning flow754's T3k Urban into a standalone weapon (not to release it for everyone unless permitted to do so). It mostly works fine, UI images are showing up fine and all, but when you buy the gun, the game crashes. :eek:

So the game is looking for a resource named T3k_Urban to stream for the weapon costume and can't find it. I see resources for the skins t3k_urban_a_sk1 and 2, but nothing named just T3k_Urban. Maybe the SMG_t3kUrban should be names T3k_Urban or the name of the costume should be changed to SMG_t3kUrban. The latter is probably easiest.
 
Any news on this guy? I'd like to see this up in the workshop if you and flow are willing to do it.
 
I'm working on this issue yet, but simply renaming the costume in the .xtbl didn't work. I also noticed that for example the ingame tommy gun has another file to it. One for the costume in items_3d.xtbl, one for the costume in weapon_costumes.xtbl, two for skins, and one for the high quality skin/model.
The problem might be that the game is looking for that second mesh file, but isn't there, so I'm trying to work out how to best solve this.
 
Last edited:
I'm working on this issue yet, but simply renaming the costume in the .xtbl didn't work. I also noticed that for example the ingame tommy gun has another file to it. One for the costume in items_3d.xtbl, one for the costume in weapon_costumes.xtbl, two for skins, and one for the high quality skin/model.
The problem might be that the game is looking for that second mesh file, but isn't there, so I'm trying to work out how to best solve this.
Not sure if this helps at all or if it is common knowledge, but the costume is a model and the skin is a texture. I assume that the model listed in the items3d.xtbl is just the default costume, but I am not sure. It can also be a leftover relic from SR3 where we didn't have the costumes. Do you want me to crank up the new mod in debug and see what I can find out? Just toss it on the workshop or attach it and I'd be happy to do it.
 
Not sure if this helps at all or if it is common knowledge, but the costume is a model and the skin is a texture. I assume that the model listed in the items3d.xtbl is just the default costume, but I am not sure. It can also be a leftover relic from SR3 where we didn't have the costumes. Do you want me to crank up the new mod in debug and see what I can find out? Just toss it on the workshop or attach it and I'd be happy to do it.
To bring back the tommy gun example and clear things up, the streaming container for items_3d.xtbl was named SMG-LargeThomas, then the streaming container used for the costumes table was SMGLarge-1-Thomas. Then there was a streaming container for the weapon clip, a streaming container for the high quality skin, ThomasGun_A_high, and two streaming containers for the skins.

So, I think I am lacking a streaming container for the weapon costume T3k_Urban while SMG_t3kUrban can be used for the items_3d table entry, but I'll work this out over the coming days and attach the outcome if something goes wrong. :)
 
For me, it looks like the problem has something to do with the many different names used within my mod. This one's a little older, from a time when I was way more messy regarding these seemingly unimportant details. Meanwhile I've found a way to avoid loading issues like this: Be consistent when naming your files. In this particular case, I would recommend the following steps:
  • rename SMG_t3kUrban.str2_pc to t3k_urban_a.str2_pc
  • rename SMG_t3kUrban_Clip.str2_pc to t3k_urban_a_bone-clip.str2_pc (mind the hyphen)
  • change both <Name> variables in items_3d.xtbl accordingly
  • in weapons.xtbl, rename the weapon to "t3k_urban_a"
  • in weapon_costumes.xtbl, rename the costume to "t3k_urban_a" and update the <Item_Entry> and <Weapon_Entry> variables
  • in weapon_skins.xtbl, update the <Costume> variable
  • finally, update all asm_pc files with the new packfile names
Of course these instructions are mostly based on personal experience, rather than in-depth knowledge about how the new mod format is processed, so I might be wrong and the names are actually fine. However, having consistent names within one's mod is definitely good practice. If you still have problems after going through this list, upload the files to this thread and I'll have another look at them.
 
Updated the .zip trying to follow the hints you gave. Apologies for the time taken, spent the 2nd half of last week at home sick.
  • The base name of the weapon now is wpn_tek9. All containers, assembler entries, and xtbl entries are named around wpn_tek9 (except for the weapons.xtbl entry, that shouldn't matter as long as it's referred correctly in other .xtbls).
  • The costume entry is wpn_tek9.
  • The high res skin entry is wpn_tek9_high.
  • The entry for the skins are wpn_tek9_sk1 and wpn_tek9_sk2.
  • <Costume> value is updated accordingly.
  • The streaming containers and assemblers are updated accordingly.
Still no luck. I did notice one odd thing while updating the assemblers. Every assembler has the exact same contents. Maybe that is confusing the game too much? Since costumes and even the clip is in the skins assembler, skins are in the costumes assembler, et cetera. o_O
Though, one part of my actually doubts it, since it worked with the weapon just as costume.
 

Attachments

  • Tek 9 Standalone Weapon.zip
    6 MB · Views: 573
Last edited:
Updated the .zip trying to follow the hints you gave. Apologies for the time taken, spent the 2nd half of last week at home sick.
  • The base name of the weapon now is wpn_tek9. All containers, assembler entries, and xtbl entries are named around wpn_tek9 (except for the weapons.xtbl entry, that shouldn't matter as long as it's referred correctly in other .xtbls).
  • The costume entry is wpn_tek9.
  • The high res skin entry is wpn_tek9_high.
  • The entry for the skins are wpn_tek9_sk1 and wpn_tek9_sk2.
  • <Costume> value is updated accordingly.
  • The streaming containers and assemblers are updated accordingly.
Still no luck. I did notice one odd thing while updating the assemblers. Every assembler has the exact same contents. Maybe that is confusing the game too much? Since costumes and even the clip is in the skins assembler, skins are in the costumes assembler, et cetera. o_O
Though, one part of my actually doubts it, since it worked with the weapon just as costume.
I really recommend you to use 't3k_urban_a' as the base name for all of your files and containers. The problem with your mod probably is, that the files within your newly named containers and even some uneditable strings in those file's contents are still called 't3k_urban_a' or 't3k_urban_a_high'.
 
Updated the .zip trying to follow the hints you gave. Apologies for the time taken, spent the 2nd half of last week at home sick.

You don't need to apologize for that.

On to the troubles.
  • First off we complain in the item code that we can't find the high res item container named t2k_urban_a_high. It looks like the container is actually named wpn_tek9_high even though the files inside are t3k_urban_a_high.*. The problem here is actually one of the game's assumptions. It assumes the high res container will be named cmesh or smesh name with _high at the end. That name of the mesh internally will match the filename of the mesh. That just causes the high res mesh to never load and shouldn't be fatal.
  • Same complaints for the high res skin items t3k_urban_a_sk1 and sk2. We're looking for wpn_tek9_sk1_high and wpn_tek9_sk2_high and can't find it. Again, this is the same forced naming based on the filename and not the container name. (this one seems to make things really sad)
  • The container wpn_tek9_high loads and complains that it can't find the high res material loaded. It was looking for a material named wpn_tek9_high. The same happens for wpn_tek9_sk1 and wpn_tek9_sk2.
  • When we actually buy the weapon we search for an inventory item named Pistol-Tek9 and can't find it to add. We should be looking for wpn_tek9 here, but don't because the weapon info's name is Pistol-Tek9.
Hope that helps.
 
Back
Top