This is a guide explaining how to add weapons to armories for all factions, or specific factions. Also includes information on model/texturing.
[MAKING CUSTOM WEAPONS REQUIRES A VOXEL EDITOR, ALL WEAPONS USE THEIR MODELS AND TEXTURES FROM VOXELS]
Requirements for new weapons: model.xml, sound.wav, .weapon file
1: Create a model for your weapon using a voxel editor, add it to the "Models" folder.
(RWR combines its textures and models into one voxel-based model file. Actual texture files are reserved for buildings, vehicles, etc (things that aren't voxel-based)
==CODE EXAMPLE== R G B = color code per voxel
<model> <voxels> <voxel x="-1" y="3" z="1" r="0.0703125" g="0.0703125" b="0.0703125" a="1.0" /> <voxel x="-2" y="3" z="1" r="0.132813" g="0.132813" b="0.132813" a="1.0" /> <voxel x="-3" y="3" z="1" r="0.132813" g="0.132813" b="0.132813" a="1.0" /> <voxel x="-4" y="3" z="1" r="0.132813" g="0.132813" b="0.132813" a="1.0" /> </voxels> <skeleton /> <skeletonVoxelBindings /> </model>
==CODE EXAMPLE==
2: Find/make a .wav sound file for your new weapon, add it to the "sounds" folder.
3: Make a .weapon file, the .weapon file stores/calls for all the information related to your weapon. Add it to your "Weapons" folder. (Easiest way is to copy a existing weapon file and modifying it to your liking)
3a: Modding the .weapon file should be pretty straight-forward, listing the effects of each line of code would be too much for this post.
4: After compiling the .weapon file, open "all_weapons" in notepad++, add the line: <weapon file="mygun.weapon" />
5: Open "invasion_all_weapons" in notepad++, add the line:
<weapon file="mygun.weapon"> <capacity source="rank" source_value="0.0" value="1" /> </weapon>
6: Go to your vanilla > factions folder, open brown, green, grey primaries/secondaries (depends on your weapon and what faction you want to have it).
6a: e.g, open green_primaries.resource with notepad++, add the line:
<weapon key='mygun.weapon' />
7: You now have a new primary weapon for the green faction, repeat for brown/grey to enable for all factions.
|