Skip to content
yvt edited this page Mar 22, 2014 · 11 revisions

Modding weapons can be done by editing script files and replacing the default model/sound files.

Scripting

An AngelScript script file loads the required model/sound files, renders models at the correct location, and plays gunshot sounds. There are two scripts for each weapon:

  • Scripts/Skin/(Rifle|Shotgun|SMG)/ThirdPerson.as - this one is used for all players but the local player.
  • Scripts/Skin/(Rifle|Shotgun|SMG)/View.as - this one is for the first-person weapon.

Always include ThirdPerson.as and View.as in your Mods even when you didn't modify the script, or your Mods are likely to break in the future version of OpenSpades. But do not include unrelated script files (i.e. other weapon's View/ThirdPerson.as, MainScreen.as) or there will be some compatibility issues.

Note: if you modified script files, make sure to add your credits to them.

Models

OpenSpades uses KV6 format, so you can use SLAB6 or any software with an ability to export KV6 to create models to be used in OpenSpades.

Sounds

You can rewrite whole the sound logics to provide more sound diversity or reduce the number of sound files. However, you also have an option to stick to the original sound logics.

Here's purpose of sound files in the original sound logic:

  • first person (played when a player you are controlling fired a weapon.)
    • FireLocal.wav - Usually stereophonic thus not spatialized.
  • third person (played when a player you aren't controlling fired a weapon.)
    • Fire.wav - not audible in a long distance. Monophonic and spatialized.
    • FireFar.wav - Monophonic and spatialized.
    • FireStereo.wav - gives an illusion of a wide and open field. Stereophonic thus not spatialized.

Note: "spatialized" refers to 3D positioned sounds. Non-spatialized sounds aren't positioned at all, so if all sounds are non-spatialized, player cannot know where a gun shot came from. Stereophonic sound files never can be spatialized.