· 9 years ago · Nov 06, 2016, 03:36 PM
1The first thing you need to do is make your audio script
2Counter-Strike Global Offensive\csgo\scripts The file must be here!
3
4Lets create or file : auxaudio.txt
5
6
7
8=======================================
9"Aux.Audio" //this is the what we will cache into memeory later So give it a good name like boostaudio plus how we can get it if using ambient_generic
10{
11 "volume" "1" //This speaks for itself
12 "pitch" "10,250" //you can decalare a range here for pitch in this example random value between 10 - 250
13 "wave" "ambient\atmosphere\amb_steam_01.wav" //the actual audio file (this file will loop due to the file itself no worrys when using your own)
14 "soundlevel" "SNDLVL_30dB" // This is how far you can hear the audio file (attenioton wtf google it )
15}
16===========================================
17for more commands https://developer.valvesoftware.com/wiki/Soundscripts
18Now we need to tell our game to actuall know that this file exists
19
20So add this last line to Counter-Strike Global Offensive\csgo\scripts\game_sounds_manifest.txt
21
22 // Level sounds
23
24 "preload_file" "scripts/auxaudio.txt"
25}
26
27Great now lets test our file make an ambient_generic and search for "Aux.Audio" We need to look for the name we give our sound script
28Select it load the map and what it doesn't work no because we need to tell CS:GO to remake the audio cache.
29Compile the map
30sv_cheats 1
31snd_rebuildaudiocache (this will remake the audio table)
32
33Great we have the audio file now we just need to make a script that uses it.
34
35Make a new file \Counter-Strike Global Offensive\csgo\scripts\vscripts\aux\boostersound.nut
36
37
38//This is what the script will call note that we are caching the audio right before some one enters the trigger
39//Meaning that who ever hasn't cached it yet won't be able to hear it
40//You could make a script at the player start where the only line is to cache the audio.
41// Pretty sure you can make a ambient_generic using the script not even playing it ever and it gets cached into the players memeory
42
43==================================
44function Auxaudio()
45{
46 activator.PrecacheScriptSound("Aux.Audio");
47 // Note how we are precaching Aux.Audio the FUNCTION WITHIN THE FILE! not the file istelf!!!
48 // Fucking magic if you ask me i think you can cache an entire file aswell not sure how
49 // But not needed you can add as many audio files into your one auxaudio.txt
50 // and just call them via activator.PrecacheScriptSound("XXX.XXX");
51
52 // Note how we are playing Aux.Audio and not the .wav itself
53 activator.EmitSound("Aux.Audio");
54
55}
56===================================
57
58Great now create a logic_script
59Entity script and look for your boostersound.nut Name the logic_script some thing logical like Boostersound
60Now make a trigger_multiple
61Onstartouching / Boostersound / RunScriptCode / Auxaudio()
62 ^ ^ ^ ^
63 you know this Ref to logic Do something Run this function