Time for action - add sound to a weapon
The weapon system of CryENGINE 3 supports various actions, which are used to trigger actions such as animation, effects, and sounds. Within the weapon system, one-shot, tail, and looping sounds are the typical types of FMOD events used.
Open one of the weapon scripts within your game directory. Weapon scripts are stored under
\Game\Scripts\Entities\Items\XML\Weapons
.For this example, we will open the
SCAR.xml
file in a text editor.When looking through this file, you will see that there are many actions triggered by game code that have a sound event attached.
<action name="fire"> <animation target="firstperson" name="fire_bullets_right_%suffix%01" /> <animation target="owner" name="shoot" /> <sound target="firstperson" name="sounds/weapons:scar:fire_single_fp" radius="200" static="1" /> <sound target="thirdperson" name="sounds/weapons:scar:fire_single_3p" radius="200" static="1" /> </action> <action...