So, in my http://www.saintsrowmods.com/forum/threads/toggle-dual-wielding.4231/]dual wield toggle[/url] mod, I'm having a bit of trouble getting weapon costumes to work. Here's how I went about adding a toggleable pistol:
1. Copy the entry for pistol-gang in weapons.xtbl. Rename the copy to pistol-gang_single and remove the dual wieldable flag
2. Copy the entry for pistol-gang in items_inventory.xtbl. Rename the copy to pistol-gang_single and don't change anything else
3. Copy the entry for PistolHeavy-0-JungleSparrow (the default skin for the heavy pistol) in weapon_costumes.xtbl. Rename the copy to PistolHeavy-0-JungleSparrow_single and change the <weapon_entry> and <inventory_entry> fields to pistol-gang_single.
4. Create duplicates for the skins (referencing PistolHeavy-0-JungleSparrow_single) and upgrades (referencing pistol-gang_single)
All of this works fine and generates a single-wielded copy of the heavy pistol, with its own upgrades and skin selection. The trouble comes when I try to add weapon costumes. Here are the steps I took:
1. create a copy of Pistol-Gang-Cumia in items_inventory.xtbl
2. copy PistolHeavy-1-Revolver to PistolHeavy-1-Revolver_single, changing the <weapon_entry> field to pistol-gang_single and <inventory_entry> to pistol-gang-cumia_single
3. copy all the skins that used PistolHeavy-1-Revolver, letting the copies reference PistolHeavy-1-Revolver_single (I have tried with and without this step, it has the same bug either way)
And that's when things go wrong. The new costume is invisible (the gun still shoots OK though), and that costume becomes invisible for the original (dual wieldable) version too. My first thought was that this was an issue with preloading models, so I created a duplicate entry for Pistol-HeavyRevolver_single in items_3d.xtbl. This got the original version working correctly, but the new one was still MIA. I then switched the names of the PistolHeavy-1-Revolver and PistolHeavy-1-Revolver_single costumes; this resulted in the costume being available on the single one but not the original. Switching which referred to which entry in items_3d changed the camera angle on the costume in the store, but not which one worked. The most logical conclusion is that the game doesn't like custom-named weapon costumes. Is there a way I can work around that?
1. Copy the entry for pistol-gang in weapons.xtbl. Rename the copy to pistol-gang_single and remove the dual wieldable flag
2. Copy the entry for pistol-gang in items_inventory.xtbl. Rename the copy to pistol-gang_single and don't change anything else
3. Copy the entry for PistolHeavy-0-JungleSparrow (the default skin for the heavy pistol) in weapon_costumes.xtbl. Rename the copy to PistolHeavy-0-JungleSparrow_single and change the <weapon_entry> and <inventory_entry> fields to pistol-gang_single.
4. Create duplicates for the skins (referencing PistolHeavy-0-JungleSparrow_single) and upgrades (referencing pistol-gang_single)
All of this works fine and generates a single-wielded copy of the heavy pistol, with its own upgrades and skin selection. The trouble comes when I try to add weapon costumes. Here are the steps I took:
1. create a copy of Pistol-Gang-Cumia in items_inventory.xtbl
2. copy PistolHeavy-1-Revolver to PistolHeavy-1-Revolver_single, changing the <weapon_entry> field to pistol-gang_single and <inventory_entry> to pistol-gang-cumia_single
3. copy all the skins that used PistolHeavy-1-Revolver, letting the copies reference PistolHeavy-1-Revolver_single (I have tried with and without this step, it has the same bug either way)
And that's when things go wrong. The new costume is invisible (the gun still shoots OK though), and that costume becomes invisible for the original (dual wieldable) version too. My first thought was that this was an issue with preloading models, so I created a duplicate entry for Pistol-HeavyRevolver_single in items_3d.xtbl. This got the original version working correctly, but the new one was still MIA. I then switched the names of the PistolHeavy-1-Revolver and PistolHeavy-1-Revolver_single costumes; this resulted in the costume being available on the single one but not the original. Switching which referred to which entry in items_3d changed the camera angle on the costume in the store, but not which one worked. The most logical conclusion is that the game doesn't like custom-named weapon costumes. Is there a way I can work around that?