This section contains topics that include information on weapon modeling and instructions for setting up first- and third-person weapons for various DCC tools taking into account a step-by-step process of what is required to see your weapon working in-game. This particular example will be explaining how to setup a first person weapon because of the complexity involved with animations. Third person weapons are essentially just the static object versions which the player can pick up and drop.
Before going any further you should have your weapon exported, rigged and textured. That means there should be at least one .chr file with a corresponding .mtl associated its textures. Generally speaking, weapons will be located in Objects/weapons so for the sake of consistency it is recommended you put your textures, materials and geometry in there. As an example, the SDK rifle can be found there as well. Animations will also be an important factor but they will need to be exported after you have created a chrparams file.
\Objects\weapons\rifle
This file is basically mapping animations to model files. In this instance you only need it to assign a basic relationship between these two assets. For more information on this file and what you can do with it not mentioned in this tutorial please visit Character Parameters File (chrparams).
<Params>
<AnimationList>
<Animation name="#filepath" path="Animations\weapons\rifle\"/>
<Animation name="$TracksDatabase" path="Animations\weapons\rifle\rifle.dba"/>
<Animation name="" path=".caf"/>
</AnimationList>
</Params>
Now you can export your animations in whichever DCC tool you are using. Be sure that you export to the same path you referenced in your .chrparams. Doing so should output single or multiple (depending on how many you want to use on your animation) .i_caf files.
You will not be able to preview everything right away but at this part you will be able to create additional attachments to spawn particle effects or just more parts around.
Next we will go into the weapons xml scripts. These files are what defines the properties in how the weapon will work. You can find the rifle.xml here:
\Game\Scripts\Scripts\Entities\Items\XML\Weapons
<item name="Rifle" class="Weapon" category="primary" priority="12" weaponParams="1">
Once your script has been made you should be able to add your new weapon in Sandbox. If you are unfamiliar with where to find where the weapons are located within the RolupBar here:
If you are just modifying the script of the weapon you can just click "Reload Script" for it to update. From there the weapon should update the next time you go in-game to test it out.