Insurgency

Insurgency

评价数不足
How to add more audio cues to existing ones
由 Krasapan 制作
A short guide on how to add more audio cues to existing ones
   
奖励
收藏
已收藏
取消收藏
Introduction
Yes, you can add more audio variations. To anything. But I will show you in examples for counter attack music cues
1. Locate needed script
Scripts are located at \steamapps\common\insurgency2\insurgency\scripts

For example, I need to find a script that manipulates counter attack cues. By searching in game files, I found out (by it's name and sound) that audio ins_gamemusic_abouttoattack_a.ogg is located at sound\cues in \steamapps\common\insurgency2\insurgency\insurgency_sound_dir.vpk is indeed a counter attack theme.

To open .vpk game files, you need to use GCFScape[nemstools.github.io]

Then you need to find this sound in a script responsible for playing this sound. Find a script named "closer" to your sound, for example if it's UI sound, the script you need is "game_sounds_ui.txt". If it's a gun sound, it's "ins_sounds_weapons.txt" etc.
By looking up a bit, you will see the name of the player that has this sound. In this case, only two players use this sound: "Music.StartAction_003" and "Music.StartCounterAttack".
We exactly need to make changes under "Music.StartCounterAttack", because this exact audio player is responsible for playing counter attack cues.

After you located the script file, make the copy somewhere in a newly created empty folder in the scripts folder

The folder structure should look like this:

MySoundMod │ └── scripts │ └── ins_sounds_cues.txt

Open it and use "Find in file" (Ctrl+F), paste the sound file name that you found in game files to find it. If it doesn't find it, make sure you typed file name correctly, or this script just doesn't have that file and you would need to find it in different scripts that may have it.
2. Add your custom cues
Most audio players have "rndwave". If it doesn't, you may have to add it by yourself, it's a basic source function that plays random sound from the sounds that you listed

See where related sound files are usually located. For example, ins_gamemusic_abouttoattack_a.ogg is located at sound\cues. But in audio scripts, sound\ is skipped, so all paths are by default must be inside sound\

So, create 2 folders: cues inside of sound and place there your custom audio files

Name them as you want, but I prefer naming them by the same logic as initial files there, to have name related and organized.

I named my custom files as:
ins_gamemusic_abouttoattack_b.ogg
ins_gamemusic_abouttoattack_c.ogg
ins_gamemusic_abouttoattack_d.ogg
ins_gamemusic_abouttoattack_e.ogg
ins_gamemusic_abouttoattack_f.ogg
ins_gamemusic_abouttoattack_g.ogg
ins_gamemusic_abouttoattack_h.ogg
ins_gamemusic_abouttoattack_i.ogg

Your folder structure now should look like this:

MySoundMod │ └── scripts │ └── ins_sounds_cues.txt └── sound └── cues └── ins_gamemusic_abouttoattack_b.ogg └── ins_gamemusic_abouttoattack_c.ogg └── ins_gamemusic_abouttoattack_d.ogg └── ins_gamemusic_abouttoattack_e.ogg └── ins_gamemusic_abouttoattack_f.ogg └── ins_gamemusic_abouttoattack_g.ogg └── ins_gamemusic_abouttoattack_h.ogg └── ins_gamemusic_abouttoattack_i.ogg

After all files were added, next you should make changes in the script.

All you need is to just add them to the cue list in ins_sounds_cues.txt
3. Edit the script
Continuing the step 1

Next, add the correct path of your files to the "rndwave"'s brackets.

Now it should look like this:

Before:


After:

That's basically it
4. Pack your mod
To pack your mod, drag your newly created mod folder with script and audio onto vpk.exe, located in \steamapps\common\insurgency2\bin\vpk.exe. This will created a final packed mod in .vpk format in the same path from where you dragged your mod folder




The mod is done!

To upload it to workshop, use Insurgency's in-game workshop interface in the main menu.
5. Test your mod
To test it, place created .vpk in \steamapps\common\insurgency2\insurgency\custom

Use "play" command in game console to check if the sound by given path can be played in-game

Example:
play "cues\ins_gamemusic_abouttoattack_a.ogg"
Be aware!
1. I should mention that you must have your audio files format the same as ones that you're adding to, if original files are .wav, your files must be .wav aswell, if it's .ogg, yours must be .ogg etc.
2. You can't use two mods that replace the same script. If you subscribe to more than one, only one of them will replace others' same script. If you want to make a mod that has multiple sound mods combined, you will have to combine their audio files, and combine audio cues in one script