‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
audio_shared.csc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 #using scripts\shared\clientfield_shared;
3 #using scripts\shared\array_shared;
4 #using scripts\shared\callbacks_shared;
5 #using scripts\shared\system_shared;
6 #using scripts\shared\trigger_shared;
7 #using scripts\shared\util_shared;
8 #using scripts\shared\music_shared;
9 
10 #insert scripts\shared\shared.gsh;
11 #insert scripts\shared\version.gsh;
12 
13 #namespace audio;
14 
15 ‪REGISTER_SYSTEM( "audio", &‪__init__, undefined )
16 
17 // Client side audio functionality
18 //TODO T7 function name pass
19 
20 function ‪__init__()
21 {
23 
26  level thread ‪register_clientfields();
27  level thread ‪sndKillcam();
28  level thread ‪SetPfxContext();
29 
30  setsoundcontext ("foley", "normal");
31  setsoundcontext( "plr_impact", "" );
32 }
33 
35 {
47 }
48 
49 function ‪local_player_spawn( localClientNum )
50 {
51  if( self != GetLocalPlayer( localClientNum ) )
52  return;
53 
54  setsoundcontext ("foley", "normal"); //deprecated
55 
56  if ( !SessionModeIsMultiplayerGame() )
57  {
58  if( isdefined( level._lastMusicState ) )
59  {
60  soundsetmusicstate(level._lastMusicState);
61  }
62 
63  self thread ‪sndMusicDeathWatcher();
64  }
65 
66  self thread ‪isPlayerInfected ();
67 
68  self thread ‪snd_underwater( localClientNum );
69  self thread ‪clientVoiceSetup( localClientNum );
70 }
71 
72 
73 function ‪player_init( localClientNum )
74 {
75 
76  if ( IsSplitScreenHost( localClientNum ) )
77  {
78 
79  level thread ‪bump_trigger_start(localClientNum);
80  level thread ‪init_audio_triggers(localClientNum);
81  level thread ‪sndRattle_Grenade_Client();
82  ‪startSoundRandoms(localClientNum);
86  }
87 }
88 
89 
91 {
92  self endon("entityshutdown");
93  while(1)
94  {
95  self waittill( "doublejump_start" );
96 
97  ‪trace = tracepoint( self.origin, self.origin - ( 0, 0, 100000 ) );
98  trace_surface_type = ‪trace["surfacetype"];
99  trace_origin = ‪trace["position"];
100 
101  if( !isdefined( ‪trace ) || !isdefined( trace_origin ) )
102  continue;
103 
104  if( !isdefined( trace_surface_type ) )
105  trace_surface_type = "default";
106 
107  playsound( 0, "veh_jetpack_surface_" + trace_surface_type, trace_origin );
108  }
109 }
110 
111 function ‪clientVoiceSetup( localClientNum )
112 {
113  self endon("entityshutdown");
114  if ( isdefined(level.clientVoiceSetup) )
115  {
116  [[level.clientVoiceSetup]]( localClientNum );
117  return;
118  }
119 
120  //set up voice per clients using ST6 for now TODO add logic to get teams set up on client
121  self.teamClientPrefix = "vox_gen";
122 
123  self thread ‪sndVoNotify( "playerbreathinsound", "sinper_hold" );
124  self thread ‪sndVoNotify( "playerbreathoutsound", "sinper_exhale" );
125  self thread ‪sndVoNotify( "playerbreathgaspsound", "sinper_gasp" );
126 
127 }
128 
129 function ‪sndVoNotify( notifyString, dialog )
130 {
131  self endon("entityshutdown");
132  for(;;)
133  {
134  self waittill ( notifyString );
135 
136  soundAlias = self.teamClientPrefix + "_" + dialog;
137 
138  self playsound (0, soundAlias);
139  }
140 }
141 
143 {
144  level._sndActiveSnapshot = "default";
145  level._sndNextSnapshot = "default";
146 
147  mapname = GetDvarString( "mapname" );
148 
149  if( mapname !== "core_frontend" )
150  {
151  if( SessionModeIsCampaignGame() )
152  {
153  level._sndActiveSnapshot = "cmn_level_start";
154  level._sndNextSnapshot = "cmn_level_start";
155 // level thread sndOnWait();
156  }
157 
158  if( SessionModeIsZombiesGame() )
159  {
160  if( mapname !== "zm_cosmodrome" && mapname !== "zm_prototype" && mapname !== "zm_moon" && mapname !== "zm_sumpf" && mapname !== "zm_asylum" && mapname !== "zm_temple" && mapname !== "zm_theater" && mapname !== "zm_tomb" )
161  {
162  level._sndActiveSnapshot = "zmb_game_start_nofade";
163  level._sndNextSnapshot = "zmb_game_start_nofade";
164  }
165  else
166  {
167  level._sndActiveSnapshot = "zmb_hd_game_start_nofade";
168  level._sndNextSnapshot = "zmb_hd_game_start_nofade";
169  }
170  }
171  }
172 
173  setgroupsnapshot( level._sndActiveSnapshot );
174 
175  thread ‪snd_snapshot_think();
176 }
177 function ‪sndOnWait()
178 {
179  level endon( "sndOnOverride" );
180  level ‪util::waittill_any_timeout( 20, "sndOn", "sndOnOverride" );
181 // audio::snd_set_snapshot( "default" );
182 }
183 
184 function ‪snd_set_snapshot(state)
185 {
186  level._sndNextSnapshot = state;
187 
188 /# println( "snd duck debug: set state '"+state+"'" ); #/
189 
190  level notify( "new_bus" );
191 }
192 
194 {
195  for(;;)
196  {
197  if( level._sndActiveSnapshot == level._sndNextSnapshot ) //state didn't change during transition
198  {
199  level waittill( "new_bus" );
200  }
201 
202  if( level._sndActiveSnapshot == level._sndNextSnapshot ) //got same one twice, ignore
203  {
204  continue;
205  }
206 
207  assert( isdefined( level._sndNextSnapshot ) );
208  assert( isdefined( level._sndActiveSnapshot ) );
209 
210  setgroupsnapshot( level._sndNextSnapshot );
211 
212  level._sndActiveSnapshot = level._sndNextSnapshot;
213  }
214 }
215 
216 function ‪soundRandom_Thread(localClientNum, randSound )
217 {
218  if( !isdefined( randSound.script_wait_min ) )
219  {
220  randSound.script_wait_min = 1;
221  }
222  if( !isdefined( randSound.script_wait_max ) )
223  {
224  randSound.script_wait_max = 3;
225  }
226 
227  notify_name = undefined;
228  if( isdefined( randSound.script_string ) )
229  {
230  notify_name = randSound.script_string;
231  }
232 
233 
234  if(!isdefined(notify_name) && isdefined(randSound.script_sound))
235  {
236  CreateSoundRandom(randSound.origin, randSound.script_sound, randSound.script_wait_min, randSound.script_wait_max);
237  return;
238  }
239 
240  // Only sound randoms with script_scripted placed on them will get this far.
241 
242  randSound.playing = true;
243  level thread ‪soundRandom_NotifyWait(notify_name, randSound);
244 
245  while( 1 )
246  {
247  wait( RandomFloatRange( randSound.script_wait_min, randSound.script_wait_max ) );
248 
249  if( isdefined( randSound.script_sound ) && ‪IS_TRUE( randSound.playing ) )
250  {
251  playsound( localClientNum, randSound.script_sound, randSound.origin );
252  }
253 
254  /#
255  if( GetDvarint( "debug_audio" ) > 0 )
256  {
257  print3d( randSound.origin, randSound.script_sound, (0.0, 0.8, 0.0), 1, 3, 45 );
258  }
259  #/
260  }
261 }
262 function ‪soundRandom_NotifyWait(notify_name,randSound)
263 {
264  while(1)
265  {
266  level waittill( notify_name );
267  if( ‪IS_TRUE( randSound.playing ) )
268  randSound.playing = false;
269  else
270  randSound.playing = true;
271  }
272 }
273 
274 function ‪startSoundRandoms(localClientNum)
275 {
276  randoms = ‪struct::get_array( "random", "script_label" );
277 
278  if( isdefined( randoms ) && randoms.size > 0 )
279  {
280 
281  nScriptThreadedRandoms = 0;
282 
283  for( i = 0; i < randoms.size; i ++)
284  {
285  if(isdefined(randoms[i].script_scripted))
286  {
287  nScriptThreadedRandoms ++;
288  }
289  }
290 
291  AllocateSoundRandoms(randoms.size - nScriptThreadedRandoms);
292 
293  for( i = 0; i < randoms.size; i++ )
294  {
295  thread ‪soundRandom_Thread( localClientNum, randoms[i] );
296  }
297  }
298 }
299 
300 //self is looper struct
302 {
303  if( !isdefined( self.script_sound ) )
304  {
305  return;
306  }
307 
308  if( !isdefined( self.origin ) )
309  {
310  return;
311  }
312 
313 
314  notifyName = "";
315  assert( isdefined( notifyName ) );
316 
317  if( isdefined( self.script_string ) )
318  {
319  notifyName = self.script_string;
320  }
321  assert( isdefined( notifyName ) );
322 
323  started = true;
324 
325  if( isdefined( self.script_int ) )
326  {
327  started = self.script_int != 0;
328  }
329 
330  if( started )
331  {
332  soundloopemitter( self.script_sound, self.origin );
333  }
334 
335  if( notifyName != "" )
336  {
337  for(;;)
338  {
339  level waittill( notifyName );
340 
341  if( started )
342  {
343  soundstoploopemitter( self.script_sound, self.origin );
344 
345  self thread ‪soundLoopCheckpointRestore();
346  }
347  else
348  {
349  soundloopemitter( self.script_sound, self.origin );
350  }
351  started = !started;
352  }
353  }
354 }
355 
356 //self is looper struct. Turn the looper back on after checkpoint restore
358 {
359  level waittill( "save_restore" );
360 
361  soundloopemitter( self.script_sound, self.origin );
362 }
363 
364 //self is line struct
366 {
367  if(!isdefined( self.target) )
368  {
369  return;
370  }
371 
372  target = ‪struct::get( self.target, "targetname" );
373 
374  if( !isdefined( target) )
375  {
376  return;
377  }
378 
379  notifyName = "";
380 
381  if( isdefined( self.script_string ) )
382  {
383  notifyName = self.script_string;
384  }
385 
386  started = true;
387 
388  if( isdefined( self.script_int ) )
389  {
390  started = self.script_int != 0;
391  }
392 
393  if( started )
394  {
395  soundLineEmitter( self.script_sound, self.origin, target.origin );
396  }
397 
398  if( notifyName != "" )
399  {
400  for(;;)
401  {
402  level waittill( notifyName );
403 
404  if( started )
405  {
406  soundStopLineEmitter( self.script_sound, self.origin, target.origin );
407 
408  self thread ‪soundLineCheckpointRestore(target);
409  }
410  else
411  {
412  soundLineEmitter( self.script_sound, self.origin, target.origin );
413  }
414  started = !started;
415  }
416  }
417 }
418 
419 //self is line emitter struct. Turn the emitter back on after checkpoint restore
421 {
422  level waittill( "save_restore" );
423 
424  soundLineEmitter( self.script_sound, self.origin, target.origin );
425 }
426 
428 {
429  loopers = ‪struct::get_array( "looper", "script_label" );
430 
431  if( isdefined( loopers ) && loopers.size > 0 )
432  {
433  ‪delay = 0;
434 /#
435  if( GetDvarint( "debug_audio" ) > 0 )
436  {
437  println( "*** Client : Initialising looper sounds - " + loopers.size + " emitters." );
438  }
439 #/
440  for( i = 0; i < loopers.size; i++ )
441  {
442  loopers[i] thread ‪soundLoopThink();
443  ‪delay += 1;
444 
445  if( ‪delay % 20 == 0 ) //don't send more than 20 a frame
446  {
448  }
449  }
450  }
451  else
452  {
453 /#
454  if( GetDvarint( "debug_audio" ) > 0 )
455  {
456  println( "*** Client : No looper sounds." );
457  }
458 #/
459  }
460 }
461 
463 {
464  lineEmitters = ‪struct::get_array( "line_emitter", "script_label" );
465 
466  if( isdefined( lineEmitters ) && lineEmitters.size > 0 )
467  {
468  ‪delay = 0;
469 /#
470  if( GetDvarint( "debug_audio" ) > 0 )
471  {
472  println( "*** Client : Initialising line emitter sounds - " + lineEmitters.size + " emitters." );
473  }
474 #/
475  for( i = 0; i < lineEmitters.size; i++ )
476  {
477  lineEmitters[i] thread ‪soundLineThink();
478  ‪delay += 1;
479 
480  if( ‪delay % 20 == 0 ) //don't send more than 20 a frame
481  {
483  }
484  }
485  }
486  else
487  {
488 /#
489  if( GetDvarint( "debug_audio" ) > 0 )
490  {
491  println( "*** Client : No line emitter sounds." );
492  }
493 #/
494  }
495 }
496 
497 function ‪startRattles()
498 {
499  rattles = ‪struct::get_array( "sound_rattle", "script_label" );
500 
501  if( isdefined( rattles ))
502  {
503  /#
504  println( "found "+rattles.size+" rattles" );
505  #/
506 
507  ‪delay = 0;
508 
509  for( i = 0; i < rattles.size; i++ )
510  {
511  soundrattlesetup(rattles[i].script_sound, rattles[i].origin);
512 
513  ‪delay += 1;
514 
515  if( ‪delay % 20 == 0 ) //don't send more than 20 a frame
516  {
518  }
519  }
520  }
521 
522 }
523 
524 // TRIGGERS
525 function ‪init_audio_triggers(localClientNum)
526 {
527  ‪util::waitforclient( localClientNum ); // wait until the first snapshot has arrived
528 
529  stepTrigs = GetEntArray( localClientNum, "audio_step_trigger","targetname" );
530  materialTrigs = GetEntArray( localClientNum, "audio_material_trigger","targetname" );
531 /#
532  if( GetDvarint( "debug_audio" ) > 0 )
533  {
534  println( "Client : " + stepTrigs.size + " audio_step_triggers." );
535  println( "Client : " + materialTrigs.size + " audio_material_triggers." );
536  }
537 
538 #/
539  array::thread_all( stepTrigs,&‪audio_step_trigger, localClientNum );
540  array::thread_all( materialTrigs,&‪audio_material_trigger, localClientNum );
541 }
542 
543 function ‪audio_step_trigger( localClientNum )
544 {
545  self._localClientNum = localClientNum;
546  for(;;)
547  {
548  self waittill( "trigger", trigPlayer );
549 
550  // set up the trigs
552  }
553 }
554 
556 {
557  for(;;)
558  {
559  self waittill( "trigger", trigPlayer );
560 
561  // set up the trigs
563  }
564 }
565 
567 {
568  if( !isdefined( player.inMaterialOverrideTrigger ) )
569  {
570  player.inMaterialOverrideTrigger = 0;
571  }
572  if( isdefined( self.script_label ) )
573  {
574  player.inMaterialOverrideTrigger++;
575  player.audioMaterialOverride = self.script_label;
576 
577  player SetMaterialOverride(self.script_label);
578  }
579 }
580 
582 {
583  if( isdefined( self.script_label ) )
584  {
585  player.inMaterialOverrideTrigger--;
586 /#
587  assert( player.inMaterialOverrideTrigger >= 0 );
588 #/
589  if ( player.inMaterialOverrideTrigger <= 0 )
590  {
591  player.audioMaterialOverride = undefined;
592  player.inMaterialOverrideTrigger = 0;
593 
594  player ClearMaterialOverride();
595 
596  }
597  }
598 }
599 
600 function ‪trig_enter_audio_step_trigger( trigPlayer )
601 {
602  localClientNum = self._localClientNum;
603 
604  if( !isdefined( trigPlayer.inStepTrigger ) )
605  {
606  trigPlayer.inStepTrigger = 0;
607  }
608 
609  suffix = "_npc";
610  if( trigPlayer IsLocalPlayer() )
611  {
612  suffix = "_plr";
613  }
614 
615  // trigPlayer is the player touching trigger. self is the trigger.
616  if( isdefined( self.script_label) )
617  {
618  trigPlayer.step_sound = self.script_label;
619  trigPlayer.inStepTrigger = trigPlayer.inStepTrigger + 1;
620  trigPlayer SetStepTriggerSound(self.script_label + suffix);
621  }
622  if( isdefined( self.script_sound ) && ( trigPlayer GetMovementType() == "sprint" ) )
623  {
624  volume = ‪get_vol_from_speed (trigPlayer);
625 
626  trigPlayer playsound( localClientNum, self.script_sound + suffix, self.origin, volume );
627  }
628 }
629 
631 {
632  localClientNum = self._localClientNum;
633 
634  suffix = "_npc";
635  if( trigPlayer IsLocalPlayer() )
636  {
637  suffix = "_plr";
638  }
639 
640  if( isdefined( self.script_noteworthy ) && ( trigPlayer GetMovementType() == "sprint" ) )
641  {
642  volume = ‪get_vol_from_speed (trigPlayer);
643  trigPlayer playsound( localClientNum, self.script_noteworthy + suffix, self.origin, volume );
644  }
645  if ( isdefined( self.script_label) )
646  {
647  trigPlayer.inStepTrigger = trigPlayer.inStepTrigger - 1;
648  }
649  if (trigPlayer.inStepTrigger < 0 )
650  {
651  /# println("AUDIO WARNING InStepTrigger less than 0. Should never be. setting to 0" ); #/
652  trigPlayer.inStepTrigger = 0;
653 
654  }
655  if (trigPlayer.inStepTrigger == 0)
656  {
657  trigPlayer.step_sound = "none";
658  trigPlayer ClearStepTriggerSound();
659  }
660 }
661 
662 function ‪bump_trigger_start( localClientNum )
663 {
664  bump_trigs = GetEntArray( localClientNum, "audio_bump_trigger", "targetname" );
665 
666  for( i = 0; i < bump_trigs.size; i++)
667  {
668  bump_trigs[i] thread ‪thread_bump_trigger(localClientNum);
669  }
670 }
671 
672 function ‪thread_bump_trigger(localClientNum)
673 {
674  self thread ‪bump_trigger_listener();
675  if( !isdefined( self.script_activated ) ) //Sets a flag to turn the trigger on or off
676  {
677  self.script_activated = 1;
678  }
679  self._localClientNum = localClientNum;
680  for(;;)
681  {
682  self waittill ( "trigger", trigPlayer );
683 
685  }
686 }
687 
688 function ‪trig_enter_bump( ent )
689 {
690  if ( !isdefined( ent ) )
691  return;
692 
693  localClientNum = self._localClientNum;
694  volume = ‪get_vol_from_speed( ent );
695 
696  if( !SessionModeIsZombiesGame() )
697  {
698  if ( ent IsPlayer() && ent HasPerk( localClientNum, "specialty_quieter" ))
699  {
700  volume = volume / 2;
701  }
702  }
703  if( isdefined( self.script_sound ) && (self.script_activated))
704  {
705  // script_noteworthy is the alias that will play if your speed is lower than the script_wait float
706  if( isdefined( self.script_noteworthy ) && ( self.‪script_wait > volume ) )
707  {
708  test_id = ent playsound( localClientNum, self.script_noteworthy,self.origin, volume );
709  }
710  if( isdefined( self.script_parameters ))
711  {
712  test_id = ent playsound( localClientNum, self.script_parameters, self.origin, volume );
713  }
714  if( !isdefined( self.‪script_wait ) || ( self.‪script_wait <= volume ) )
715  {
716  test_id = ent playsound( localClientNum, self.script_sound, self.origin, volume );
717  }
718  }
719  if ( isdefined( self.script_location ) && (self.script_activated))
720  {
721  ent thread ‪mantle_wait(self.script_location, localClientNum);
722  }
723 }
724 
725 Function ‪mantle_wait( alias, localClientNum )
726 {
727 
728  self endon ("death");
729  self endon ("left_mantle");
730 
731  self waittill ("traversesound");
732  self playsound ( localClientNum, alias, self.origin, 1 );
733 
734 }
735 function ‪trig_leave_bump( ent )
736 {
737  wait (1);
738  ent notify ( "left_mantle");
739 }
740 
741 function ‪bump_trigger_listener() //This will deactivate the trigger on a level notify if its stored on the trigger
742 {
743  //Store End-On conditions in script_label so you can turn off the bump trigger if a condition is met
744  if( isdefined( self.script_label ) )
745  {
746  level waittill( self.script_label );
747  self.script_activated = 0;
748  }
749 }
750 
751 //this will do some mathmagic to scale to the min/max speed to min max volume
752 function ‪scale_speed( x1, x2, y1, y2, z )
753 {
754  if ( z < x1)
755  z = x1;
756  if ( z > x2)
757  z = x2;
758 
759  dx = x2 - x1;
760  n = ( z - x1) / dx;
761  dy = y2 - y1;
762  w = (n*dy + y1);
763 
764  return w;
765 }
766 
767 function ‪get_vol_from_speed( player )
768 {
769  // values to map to a linear scale
770  min_speed = 21;
771  max_speed = 285;
772  max_vol = 1;
773  min_vol = .1;
774 
775  speed = player getspeed();
776 
777  // hack for ai until getspeed returns correct speed
778  /*
779  if( speed == 0 )
780  {
781  speed = 175;
782  }
783  */
784 
785  // make sure we are not getting negative vaules. may be unneeded
786  abs_speed = ‪absolute_value( int( speed ) );
787  volume = ‪scale_speed( min_speed, max_speed, min_vol, max_vol, abs_speed );
788 
789  return volume;
790 }
791 
792 function ‪absolute_value( fowd )
793 {
794  if( fowd < 0 )
795  return (fowd*-1);
796  else
797  return fowd;
798 }
799 
800 // self is the script origin mover
801 function ‪closest_point_on_line_to_point( Point, LineStart, LineEnd )
802 {
803  self endon ("end line sound");
804 
805  LineMagSqrd = lengthsquared(LineEnd - LineStart);
806 
807  t = ( ( ( Point[0] - LineStart[0] ) * ( LineEnd[0] - LineStart[0] ) ) +
808  ( ( Point[1] - LineStart[1] ) * ( LineEnd[1] - LineStart[1] ) ) +
809  ( ( Point[2] - LineStart[2] ) * ( LineEnd[2] - LineStart[2] ) ) ) /
810  ( LineMagSqrd );
811 
812  if( t < 0.0 )
813  {
814  self.origin = LineStart;
815  }
816  else if( t > 1.0 )
817  {
818  self.origin = LineEnd;
819  }
820  else
821  {
822  start_x = LineStart[0] + t * ( LineEnd[0] - LineStart[0] );
823  start_y = LineStart[1] + t * ( LineEnd[1] - LineStart[1] );
824  start_z = LineStart[2] + t * ( LineEnd[2] - LineStart[2] );
825 
826  self.origin = ( start_x, start_y, start_z );
827  }
828 }
829 /*
830 =============
831 "Function Name: snd_play_auto_fx( fxid, alias, offsetx, offsety, offsetz, onground, area, threshold, alias_override)"
832 This function is used to play audio on createfx ents.
833 function Fxid(String): ID of the FX you want to play alias off
834 function alias(String): Audio Alias
835 function offsetx to offsetz(Int) : Offset from the origin of the fx where audio needs to be played.
836 function onground(Bool) : do a trace ground to ensure audio play above ground.
837 function Area(Int), Threshold(Int), alias_override(String) : used to determine if multiple fx of the same id is in the radius(area) of the fx origin, if the number of FX id in the same area exceeds
838 the THRESHOLD number ALIAS_OVERRIDE will be played at center of fx instead.
839 =============
840 */
841 function ‪snd_play_auto_fx( fxid, alias, offsetx, offsety, offsetz, onground, area, threshold, alias_override )
842 {
843  SoundPlayAutoFX( fxid, alias, offsetx, offsety, offsetz, onground, area, threshold, alias_override );
844 }
845 
846 function ‪snd_print_fx_id( fxid, type, ent )
847 {
848 /#
849  if( GetDvarint( "debug_audio" ) > 0 )
850  {
851  printLn( "^5 ******* fxid; " + fxid + "^5 type; " + type );
852  }
853 #/
854 }
855 
857 {
858  while( 1 )
859  {
860  /#
861  if( GetDvarint( "debug_audio" ) > 0 )
862  {
863  line( self.start, self.‪end, (0, 1, 0) );
864 
865  print3d( self.start, "START", (0.0, 0.8, 0.0), 1, 3, 1 );
866  print3d( self.‪end, "END", (0.0, 0.8, 0.0), 1, 3, 1 );
867  print3d( self.origin, self.script_sound, (0.0, 0.8, 0.0), 1, 3, 1 );
868  }
870  #/
871  }
872 }
873 
875 {
876  closest_dist = undefined;
877 
878  /#
879  self thread ‪debug_line_emitter();
880  #/
881 
882  while( 1 )
883  {
884  self ‪closest_point_on_line_to_point( getlocalclientpos( 0 ), self.start, self.‪end );
885 
886  if( isdefined( self.fake_ent ) )
887  {
888  self.fake_ent.origin = self.origin;
889  }
890 
891  //Update the sound based on distance to the point
892  closest_dist = DistanceSquared( getlocalclientpos( 0 ), self.origin );
893 
894  if( closest_dist > 1024 * 1024 )
895  {
896  wait( 2 );
897  }
898  else if( closest_dist > 512 * 512 )
899  {
900  wait( 0.2 );
901  }
902  else
903  {
904  wait( 0.05 );
905  }
906  }
907 }
908 
909 function ‪playloopat( aliasname, origin )
910 {
911  soundloopemitter ( aliasname, origin );
912 }
913 
914 function ‪stoploopat (aliasname, origin )
915 {
916  soundstoploopemitter (aliasname, origin );
917 }
918 
919 function ‪soundwait( id )
920 {
921  while( soundplaying( id ) )
922  {
923  wait( 0.1 );
924  }
925 }
926 
927 function ‪snd_underwater( localClientNum )
928 {
929  level endon( "demo_jump" );
930  self endon( "entityshutdown" );
931  level endon("killcam_begin" + localClientNum );
932  level endon("killcam_end" + localClientNum );
933  self endon("sndEndUWWatcher");
934 
935  if ( !isdefined( level.audioSharedSwimming ) )
936  {
937  level.audioSharedSwimming = false;
938  }
939 
940  if ( !isdefined( level.audioSharedUnderwater ) )
941  {
942  level.audioSharedUnderwater = false;
943  }
944 
945  if ( level.audioSharedSwimming != IsSwimming( localClientNum ) )
946  {
947  level.audioSharedSwimming = IsSwimming( localClientNum );
948  if ( level.audioSharedSwimming )
949  {
950  ‪swimBegin();
951  }
952  else
953  {
954  ‪swimCancel(localClientNum);
955  }
956 
957  }
958 
959  if ( level.audioSharedUnderwater != IsUnderwater( localClientNum ) )
960  {
961  level.audioSharedUnderwater = IsUnderwater( localClientNum );
962  if ( level.audioSharedUnderwater )
963  {
964  self ‪underwaterBegin();
965  }
966  else
967  {
968  self ‪underwaterEnd();
969  }
970  }
971 
972 
973  while(1)
974  {
975  underwaterNotify = self ‪util::waittill_any_ex( "underwater_begin", "underwater_end", "swimming_begin", "swimming_end", "death", "entityshutdown", "sndEndUWWatcher", level, "demo_jump", "killcam_begin" + localClientNum, "killcam_end" + localClientNum );
976 
977  if ( underwaterNotify == "death" )
978  {
979  self ‪underwaterEnd();
980  self ‪swimEnd(localClientNum);
981  }
982  if ( underwaterNotify == "underwater_begin" )
983  {
984  self ‪underwaterBegin();
985  }
986  else if ( underwaterNotify == "underwater_end" )
987  {
988  self ‪underwaterEnd();
989  }
990  else if ( underwaterNotify == "swimming_begin" )
991  {
992  self ‪swimBegin();
993  }
994  else if ( underwaterNotify == "swimming_end" && self isplayer() && IsAlive (self))
995  {
996  self ‪swimEnd(localClientNum);
997  }
998  }
999 }
1000 
1002 {
1003  level.audioSharedUnderwater = true;
1004 }
1005 
1007 {
1008  level.audioSharedUnderwater = false;
1009 }
1010 
1011 function ‪SetPfxContext()//need to move to ram 2
1012 {
1013 
1014  level waittill( "pfx_igc_on" );
1015  setsoundcontext ("igc", "on");
1016  level waittill( "pfx_igc_off" );
1017  setsoundcontext ("igc", "");
1018 
1019  break;
1020 }
1021 
1022 function ‪swimBegin()
1023 {
1024  self.audioSharedSwimming = true;
1025 }
1026 
1027 function ‪swimEnd( localClientNum )
1028 {
1029  self.audioSharedSwimming = false;
1030 }
1031 
1032 function ‪swimCancel( localClientNum)
1033 {
1034  self.audioSharedSwimming = false;
1035 }
1036 
1037 function ‪soundplayuidecodeloop(decodeString, playTimeMs)
1038 {
1039  if ( !isdefined( level.playingUIDecodeLoop ) || !level.playingUIDecodeLoop )
1040  {
1041  level.playingUIDecodeLoop = true;
1042  fake_ent = ‪spawn( 0, (0,0,0), "script_origin" );
1043 
1044  if ( isdefined(fake_ent) )
1045  {
1046  fake_ent playloopsound("uin_notify_data_loop");
1047  wait(playTimeMs/1000);
1048  fake_ent stopallloopsounds(0);
1049  }
1050 
1051  level.playingUIDecodeLoop = undefined;
1052  }
1053 }
1054 
1055 function ‪setCurrentAmbientState(ambientRoom, ambientPackage, roomColliderCent, packageColliderCent, defaultRoom)
1056 {
1057  if ( isdefined( level._sndAmbientStateCallback ) )
1058  {
1059  level thread [[level._sndAmbientStateCallback]]( ambientRoom, ambientPackage, roomColliderCent );
1060  }
1061 }
1062 
1064 {
1065  self endon("entityshutdown");
1066 
1067  mapname = GetDvarString( "mapname" );
1068 
1069  if (!isdefined (mapname))
1070  {
1071  mapname = "cp_mi_eth_prologue";
1072  }
1073 
1074  if(IsDefined (self))
1075  {
1076  switch( mapname )
1077  {
1078  case "cp_mi_eth_prologue":
1079  self.isInfected = false;
1080  setsoundcontext ("healthstate", "human");
1081  break;
1082 
1083  case "cp_mi_cairo_infection2":
1084  self.isInfected = true;
1085  setsoundcontext ("healthstate", "infected");
1086  break;
1087 
1088  case "cp_mi_cairo_infection3":
1089  self.isInfected = true;
1090  setsoundcontext ("healthstate", "infected");
1091  break;
1092 
1093  case "cp_mi_cairo_aquifer":
1094  self.isInfected = true;
1095  setsoundcontext ("healthstate", "infected");
1096  break;
1097 
1098  case "cp_mi_cairo_lotus":
1099  self.isInfected = true;
1100  setsoundcontext ("healthstate", "infected");
1101  break;
1102 
1103  case "cp_mi_cairo_lotus2":
1104  self.isInfected = true;
1105  setsoundcontext ("healthstate", "infected");
1106  break;
1107 
1108  case "cp_mi_cairo_lotus3":
1109  self.isInfected = true;
1110  setsoundcontext ("healthstate", "infected");
1111  break;
1112 
1113  case "cp_mi_zurich_coalescence":
1114  self.isInfected = true;
1115  setsoundcontext ("healthstate", "infected");
1116  break;
1117 
1118  case "zm_zod":
1119  self.isInfected = false;
1120  setsoundcontext ("healthstate", "human");
1121  break;
1122 
1123  case "zm_factory":
1124  self.isInfected = false;
1125  setsoundcontext ("healthstate", "human");
1126  break;
1127 
1128  default:
1129  self.isInfected = false;
1130  setsoundcontext ("healthstate", "cyber");
1131  break;
1132  }
1133  }
1134 }
1135 function ‪sndHealthSystem(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
1136 {
1137 
1138  lowHealthEnterAlias = "chr_health_lowhealth_enter";
1139  lowHealthExitAlias = "chr_health_lowhealth_exit";
1140  laststandExitAlias = "chr_health_laststand_exit";
1141  dniReparAlais = "chr_health_dni_repair";
1142 
1143  if( newVal )
1144  {
1145  switch( newVal )
1146  {
1147  case 1: //Low Health
1148  self.lowHealth = true;
1149  playsound( localClientNum, lowHealthEnterAlias, (0,0,0) );
1150  forceambientroom( "sndHealth_LowHealth" );
1151  self thread ‪sndDniRepair ( localClientNum, dniReparAlais, 0.4, 0.8 );
1152  break;
1153 
1154  case 2: //Last Stand
1155  PlaySound( localClientNum, lowHealthExitAlias, (0,0,0) );
1156  forceambientroom( "sndHealth_LastStand" );
1157  self notify ("sndDniRepairDone");
1158  setsoundcontext ("laststand", "active");
1159  break;
1160  }
1161  }
1162  else
1163  {
1164  self.lowHealth = false;
1165  setsoundcontext ("laststand", "");
1166 
1167  if( SessionModeIsCampaignGame() && ‪IS_TRUE(level.audioSharedUnderwater) )
1168  {
1169  mapname = GetDvarString( "mapname" );
1170  if( mapname == "cp_mi_sing_sgen" )
1171  {
1172  forceambientroom( "" ); //special case room with unique reverb
1173  }
1174  else
1175  {
1176  forceambientroom( "" ); //generic underwater
1177  }
1178  }
1179  else
1180  {
1181  forceambientroom( "" );
1182  }
1183 
1184  if( oldVal == 1 )
1185  {
1186  playsound( localClientNum, lowHealthExitAlias, (0,0,0) );
1187  self notify ("sndDniRepairDone");
1188  }
1189  else
1190  {
1191  if( IsAlive( self ) )
1192  {
1193  playsound( localClientNum, laststandExitAlias, (0,0,0) );
1194  if( ‪IS_TRUE(self.sndTacRigEmergencyReserve) )
1195  {
1196  playsound( localClientNum, "gdt_cybercore_regen_complete", (0,0,0) );
1197  }
1198  }
1199  self notify ("sndDniRepairDone");
1200  }
1201  break;
1202  }
1203 }
1204 
1205 function ‪sndDniRepair(localClientNum, alais, min, max)
1206 {
1207  self endon ("sndDniRepairDone");
1208 
1209  wait (.5);
1210  if( IsDefined( self ) && IsDefined (self.isInfected))
1211  {
1212  if (self.isInfected)
1213  {
1214  playsound( localClientNum, "vox_dying_infected_after", (0,0,0) );
1215  }
1216  while ( IsDefined( self ) )
1217  {
1218  playsound( localClientNum, alais, (0,0,0) );
1219  wait RandomFloatRange( min, max );
1220  }
1221  }
1222 }
1223 
1224 function ‪sndTacRig(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
1225 {
1226  if( newVal )
1227  {
1228  self.sndTacRigEmergencyReserve = true;
1229  }
1230  else
1231  {
1232  self.sndTacRigEmergencyReserve = false;
1233  }
1234 }
1235 
1236 
1237 function ‪doRattle(origin, min, max)
1238 {
1239  if( isdefined( min ) && min > 0 )
1240  {
1241  if( isdefined( max ) && max <= 0 )
1242  {
1243  max = undefined;
1244  }
1245 
1246  soundrattle(origin,min,max);
1247  }
1248 }
1249 function ‪sndRattle_Server(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
1250 {
1251  if( newVal )
1252  {
1253  if( self.model == "wpn_t7_bouncing_betty_world" )
1254  {
1255  betty = getweapon( "bouncingbetty" );
1256  level thread ‪doRattle(self.origin, betty.soundRattleRangeMin, betty.soundRattleRangeMax);
1257  }
1258  else
1259  {
1260  level thread ‪doRattle(self.origin, 25, 600);
1261  }
1262  }
1263 }
1265 {
1266  while(1)
1267  {
1268  level waittill( "explode", localClientNum, position, mod, weapon, owner_cent );
1269  level thread ‪doRattle(position, weapon.soundRattleRangeMin, weapon.soundRattleRangeMax);
1270  }
1271 }
1272 
1273 function ‪weapon_butt_sounds(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
1274 {
1275 
1276  if(newVal)
1277  {
1278  self.meleed = true;
1279  level.mysnd = playsound(localClientNum, "chr_melee_tinitus", (0,0,0));
1280  forceambientroom("sndHealth_Melee");
1281  }
1282  else
1283  {
1284  self.meleed = false;
1285  forceambientroom( "" );
1286 
1287  if( isdefined( level.mySnd ) )
1288  stopsound(level.mySnd);
1289  }
1290 
1291 }
1293 {
1294  wait(2);
1295  setsoundcontext ("foley", "normal");
1296 
1297 }
1298 
1299 // 1 = PreMatch
1300 function ‪sndMatchSnapshot(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
1301 {
1302  if( newVal )
1303  {
1304  switch( newVal )
1305  {
1306  case 1:
1307  ‪audio::snd_set_snapshot( "mpl_prematch" );
1308  break;
1309  case 2:
1310  ‪audio::snd_set_snapshot( "mpl_postmatch" );
1311  break;
1312  case 3:
1313  ‪audio::snd_set_snapshot( "mpl_endmatch" );
1314  break;
1315  }
1316  }
1317  else
1318  {
1319  ‪audio::snd_set_snapshot( "default" );
1320  }
1321 }
1322 function ‪sndFoleyContext(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
1323 {
1324  // hack to work around weird issue where we need foley to be set to normal or else footsteps won't play
1325  // if we actually want to set up a foley context to be switchable from GSC then this should be re-enabled
1326  // and the aliases should be set up to properly support this
1327 
1328 // if( newVal )
1329 // setsoundcontext ("foley", "igc");
1330 // else
1331 
1332  setsoundcontext ("foley", "normal");
1333 }
1334 
1335 function ‪sndKillcam()
1336 {
1337  level thread ‪sndFinalKillcam_Slowdown();
1338  level thread ‪sndFinalKillcam_Deactivate();
1339 }
1341 {
1342  while(1)
1343  {
1344  level waittill( "sndDED" );
1345 
1346  ‪audio::snd_set_snapshot( "mpl_death" );
1347  }
1348 }
1350 {
1351  while(1)
1352  {
1353  level waittill( "sndDEDe" );
1354 
1355  ‪audio::snd_set_snapshot( "default" );
1356  }
1357 }
1359 {
1360  while(1)
1361  {
1362  level waittill( "sndFKs" );
1363  playsound( 0, "mpl_final_killcam_enter", (0,0,0) );
1364  ‪audio::snd_set_snapshot( "mpl_final_killcam" );
1365  }
1366 }
1368 {
1369  while(1)
1370  {
1371  level waittill( "sndFKsl" );
1372  playsound( 0, "mpl_final_killcam_enter", (0,0,0) );
1373  playsound( 0, "mpl_final_killcam_slowdown", (0,0,0) );
1374  ‪audio::snd_set_snapshot( "mpl_final_killcam_slowdown" );
1375  }
1376 }
1378 {
1379  while(1)
1380  {
1381  level waittill( "sndFKe" );
1382  ‪audio::snd_set_snapshot( "default" );
1383  }
1384 }
1385 
1386 function ‪sndSwitchVehicleContext(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
1387 {
1388  if( self IsLocalClientDriver( localClientNum ) )
1389  {
1390  //self setsoundentcontext("drivableveh", "1stperson");
1391  setsoundcontext( "plr_impact", "veh" );
1392  }
1393  else
1394  {
1395  //self setsoundentcontext("drivableveh", "3rdperson");
1396  setsoundcontext( "plr_impact", "" );
1397  }
1398 }
1399 
1401 {
1402  self waittill( "death");
1403  soundsetmusicstate("death");
1404 }
1405 function ‪sndCChacking(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
1406 {
1407  if( newVal )
1408  {
1409  switch( newVal )
1410  {
1411  case 1:
1412  playsound(0, "gdt_cybercore_hack_start_plr", (0,0,0));
1413  self.hsnd = self playloopsound("gdt_cybercore_hack_lp_plr", .5);
1414  break;
1415  case 2:
1416  playsound(0, "gdt_cybercore_prime_upg_plr", (0,0,0));
1417  self.hsnd = self playloopsound("gdt_cybercore_prime_loop_plr", .5);
1418  break;
1419  }
1420  }
1421  else
1422  {
1423  if(isdefined(self.hsnd))
1424  {
1425  self stoploopsound(self.hsnd, .5);
1426  }
1427 
1428  if( oldVal == 1 )
1429  playsound(0, "gdt_cybercore_hack_success_plr", (0,0,0));
1430  else if( oldVal == 2 )
1431  playsound(0, "gdt_cybercore_activate_fail_plr", (0,0,0));
1432  }
1433 
1434 }
1435 
1436 #define SNAPSHOT_SPECIAL_SILENT 1
1437 #define SNAPSHOT_AMB_SILENT 2
1438 #define SNAPSHOT_FOLEY_QUIETER 3
1439 #define SNAPSHOT_LEVEL_END 4
1440 #define SNAPSHOT_LEVEL_END_IMMEDIATE 5
1441 function ‪sndIGCsnapshot(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
1442 {
1443  if( newVal )
1444  {
1445  switch( newVal )
1446  {
1448  ‪audio::snd_set_snapshot( "cmn_igc_bg_lower" );
1449  level.sndIGCsnapshotOverride = false;
1450  break;
1452  ‪audio::snd_set_snapshot( "cmn_igc_amb_silent" );
1453  level.sndIGCsnapshotOverride = true;
1454  break;
1456  ‪audio::snd_set_snapshot( "cmn_igc_foley_lower" );
1457  level.sndIGCsnapshotOverride = false;
1458  break;
1459  case ‪SNAPSHOT_LEVEL_END:
1460  ‪audio::snd_set_snapshot( "cmn_level_fadeout" );
1461  level.sndIGCsnapshotOverride = false;
1462  break;
1464  ‪audio::snd_set_snapshot( "cmn_level_fade_immediate" );
1465  level.sndIGCsnapshotOverride = false;
1466  break;
1467  }
1468  }
1469  else
1470  {
1471  level.sndIGCsnapshotOverride = false;
1472  ‪audio::snd_set_snapshot( "default" );
1473  }
1474 }
1475 function ‪sndLevelStartSnapOff(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
1476 {
1477  if( newVal )
1478  {
1479  if( !‪IS_TRUE( level.sndIGCsnapshotOverride ) )
1480  {
1481  ‪audio::snd_set_snapshot( "default" );
1482  }
1483  }
1484 }
1485 function ‪sndZMBFadeIn( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
1486 {
1487  if( newVal )
1488  {
1489  ‪audio::snd_set_snapshot( "default" );
1490  }
1491 }
1492 function ‪sndChyronLoop(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
1493 {
1494  if( newVal )
1495  {
1496  if (!isdefined (level.chyronLoop))
1497  {
1498  level.chyronLoop = ‪spawn( 0, (0,0,0), "script_origin" );
1499  level.chyronLoop PlayLoopSound ("uin_chyron_loop");
1500  }
1501  }
1502  else
1503  {
1504  if (isdefined (level.chyronLoop))
1505  {
1506  level.chyronLoop Delete();
1507  }
1508  }
1509 }
‪sndOnWait
‪function sndOnWait()
Definition: audio_shared.csc:177
‪waitforclient
‪function waitforclient(client)
Definition: util_shared.csc:60
‪snd_underwater
‪function snd_underwater(localClientNum)
Definition: audio_shared.csc:927
‪sndFinalKillcam_Deactivate
‪function sndFinalKillcam_Deactivate()
Definition: audio_shared.csc:1377
‪audio_step_trigger
‪function audio_step_trigger(localClientNum)
Definition: audio_shared.csc:543
‪on_localplayer_spawned
‪function on_localplayer_spawned(local_client_num)
Definition: _perks.csc:109
‪trig_enter_audio_step_trigger
‪function trig_enter_audio_step_trigger(trigPlayer)
Definition: audio_shared.csc:600
‪trig_enter_audio_material_trigger
‪function trig_enter_audio_material_trigger(player)
Definition: audio_shared.csc:566
‪trig_leave_bump
‪function trig_leave_bump(ent)
Definition: audio_shared.csc:735
‪sndSwitchVehicleContext
‪function sndSwitchVehicleContext(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: audio_shared.csc:1386
‪SNAPSHOT_AMB_SILENT
‪#define SNAPSHOT_AMB_SILENT
Definition: audio_shared.csc:1437
‪soundplayuidecodeloop
‪function soundplayuidecodeloop(decodeString, playTimeMs)
Definition: audio_shared.csc:1037
‪sndLevelStartSnapOff
‪function sndLevelStartSnapOff(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: audio_shared.csc:1475
‪player_init
‪function player_init(localClientNum)
Definition: audio_shared.csc:73
‪sndDeath_Activate
‪function sndDeath_Activate()
Definition: audio_shared.csc:1340
‪sndFoleyContext
‪function sndFoleyContext(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: audio_shared.csc:1322
‪trig_leave_audio_material_trigger
‪function trig_leave_audio_material_trigger(player)
Definition: audio_shared.csc:581
‪sndChyronLoop
‪function sndChyronLoop(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: audio_shared.csc:1492
‪stoploopat
‪function stoploopat(aliasname, origin)
Definition: audio_shared.csc:914
‪soundwait
‪function soundwait(id)
Definition: audio_shared.csc:919
‪sndDoubleJump_Watcher
‪function sndDoubleJump_Watcher()
Definition: audio_shared.csc:90
‪CF_CALLBACK_ZERO_ON_NEW_ENT
‪#define CF_CALLBACK_ZERO_ON_NEW_ENT
Definition: version.gsh:103
‪VERSION_SHIP
‪#define VERSION_SHIP
Definition: version.gsh:36
‪debug_line_emitter
‪function debug_line_emitter()
Definition: audio_shared.csc:856
‪doRattle
‪function doRattle(origin, min, max)
Definition: audio_shared.csc:1237
‪get_array
‪function get_array(kvp_value, kvp_key="targetname")
Definition: struct.csc:34
‪sndRattle_Server
‪function sndRattle_Server(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: audio_shared.csc:1249
‪startSoundLoops
‪function startSoundLoops()
Definition: audio_shared.csc:427
‪sndFinalKillcam_Activate
‪function sndFinalKillcam_Activate()
Definition: audio_shared.csc:1358
‪sndDeath_Deactivate
‪function sndDeath_Deactivate()
Definition: audio_shared.csc:1349
‪trace
‪function trace(from, to, target)
Definition: grapple.gsc:369
‪register_clientfields
‪function register_clientfields()
Definition: audio_shared.csc:34
‪SetPfxContext
‪function SetPfxContext()
Definition: audio_shared.csc:1011
‪bump_trigger_listener
‪function bump_trigger_listener()
Definition: audio_shared.csc:741
‪sndFinalKillcam_Slowdown
‪function sndFinalKillcam_Slowdown()
Definition: audio_shared.csc:1367
‪spawn
‪function spawn(v_origin=(0, 0, 0), v_angles=(0, 0, 0))
Definition: struct.csc:23
‪waittill_any_timeout
‪function waittill_any_timeout(n_timeout, string1, string2, string3, string4, string5)
Definition: util_shared.csc:423
‪IS_TRUE
‪#define IS_TRUE(__a)
Definition: shared.gsh:251
‪sndZMBFadeIn
‪function sndZMBFadeIn(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: audio_shared.csc:1485
‪get
‪function get(kvp_value, kvp_key="targetname")
Definition: struct.csc:13
‪delay
‪function delay(time_or_notify, str_endon, func, arg1, arg2, arg3, arg4, arg5, arg6)
Definition: util_shared.csc:784
‪weapon_butt_sounds
‪function weapon_butt_sounds(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: audio_shared.csc:1273
‪sndMusicDeathWatcher
‪function sndMusicDeathWatcher()
Definition: audio_shared.csc:1400
‪trig_enter_bump
‪function trig_enter_bump(ent)
Definition: audio_shared.csc:688
‪scale_speed
‪function scale_speed(x1, x2, y1, y2, z)
Definition: audio_shared.csc:752
‪swimCancel
‪function swimCancel(localClientNum)
Definition: audio_shared.csc:1032
‪soundLineThink
‪function soundLineThink()
Definition: audio_shared.csc:365
‪get_vol_from_speed
‪function get_vol_from_speed(player)
Definition: audio_shared.csc:767
‪set_sound_context_defaults
‪function set_sound_context_defaults()
Definition: audio_shared.csc:1292
‪soundRandom_NotifyWait
‪function soundRandom_NotifyWait(notify_name, randSound)
Definition: audio_shared.csc:262
‪init_audio_triggers
‪function init_audio_triggers(localClientNum)
Definition: audio_shared.csc:525
‪sndMatchSnapshot
‪function sndMatchSnapshot(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: audio_shared.csc:1300
‪soundLineCheckpointRestore
‪function soundLineCheckpointRestore(target)
Definition: audio_shared.csc:420
‪waittill_any_ex
‪function waittill_any_ex(...)
Definition: util_shared.csc:270
‪on_localclient_connect
‪function on_localclient_connect(localClientNum)
Definition: ctf.csc:20
‪SNAPSHOT_FOLEY_QUIETER
‪#define SNAPSHOT_FOLEY_QUIETER
Definition: audio_shared.csc:1438
‪soundLoopCheckpointRestore
‪function soundLoopCheckpointRestore()
Definition: audio_shared.csc:357
‪underwaterBegin
‪function underwaterBegin()
Definition: audio_shared.csc:1001
‪swimBegin
‪function swimBegin()
Definition: audio_shared.csc:1022
‪sndDniRepair
‪function sndDniRepair(localClientNum, alais, min, max)
Definition: audio_shared.csc:1205
‪sndKillcam
‪function sndKillcam()
Definition: audio_shared.csc:1335
‪end
‪function end(final)
Definition: _killcam.gsc:511
‪thread_bump_trigger
‪function thread_bump_trigger(localClientNum)
Definition: audio_shared.csc:672
‪sndVoNotify
‪function sndVoNotify(notifyString, dialog)
Definition: audio_shared.csc:129
‪move_sound_along_line
‪function move_sound_along_line()
Definition: audio_shared.csc:874
‪CF_HOST_ONLY
‪#define CF_HOST_ONLY
Definition: version.gsh:102
‪swimEnd
‪function swimEnd(localClientNum)
Definition: audio_shared.csc:1027
‪underwaterEnd
‪function underwaterEnd()
Definition: audio_shared.csc:1006
‪startLineEmitters
‪function startLineEmitters()
Definition: audio_shared.csc:462
‪sndTacRig
‪function sndTacRig(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: audio_shared.csc:1224
‪sndIGCsnapshot
‪function sndIGCsnapshot(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: audio_shared.csc:1441
‪audio_material_trigger
‪function audio_material_trigger(trig)
Definition: audio_shared.csc:555
‪sndRattle_Grenade_Client
‪function sndRattle_Grenade_Client()
Definition: audio_shared.csc:1264
‪setCurrentAmbientState
‪function setCurrentAmbientState(ambientRoom, ambientPackage, roomColliderCent, packageColliderCent, defaultRoom)
Definition: audio_shared.csc:1055
‪script_wait
‪function script_wait(called_from_spawner=false)
Definition: util_shared.gsc:1930
‪trig_leave_audio_step_trigger
‪function trig_leave_audio_step_trigger(trigPlayer)
Definition: audio_shared.csc:630
‪soundRandom_Thread
‪function soundRandom_Thread(localClientNum, randSound)
Definition: audio_shared.csc:216
‪isPlayerInfected
‪function isPlayerInfected()
Definition: audio_shared.csc:1063
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪snd_play_auto_fx
‪function snd_play_auto_fx(fxid, alias, offsetx, offsety, offsetz, onground, area, threshold, alias_override)
Definition: audio_shared.csc:841
‪snd_print_fx_id
‪function snd_print_fx_id(fxid, type, ent)
Definition: audio_shared.csc:846
‪absolute_value
‪function absolute_value(fowd)
Definition: audio_shared.csc:792
‪closest_point_on_line_to_point
‪function closest_point_on_line_to_point(Point, LineStart, LineEnd)
Definition: audio_shared.csc:801
‪soundLoopThink
‪function soundLoopThink()
Definition: audio_shared.csc:301
‪SNAPSHOT_SPECIAL_SILENT
‪#define SNAPSHOT_SPECIAL_SILENT
Definition: audio_shared.csc:1436
‪snd_snapshot_think
‪function snd_snapshot_think()
Definition: audio_shared.csc:193
‪function_thread
‪function function_thread(ent, on_enter_payload, on_exit_payload)
Definition: trigger_shared.csc:6
‪SNAPSHOT_LEVEL_END
‪#define SNAPSHOT_LEVEL_END
Definition: audio_shared.csc:1439
‪register
‪function register()
Definition: _ai_tank.gsc:126
‪mantle_wait
‪Function mantle_wait(alias, localClientNum)
Definition: audio_shared.csc:725
‪startRattles
‪function startRattles()
Definition: audio_shared.csc:497
‪__init__
‪function __init__()
Definition: audio_shared.csc:20
‪startSoundRandoms
‪function startSoundRandoms(localClientNum)
Definition: audio_shared.csc:274
‪WAIT_CLIENT_FRAME
‪#define WAIT_CLIENT_FRAME
Definition: shared.gsh:266
‪SNAPSHOT_LEVEL_END_IMMEDIATE
‪#define SNAPSHOT_LEVEL_END_IMMEDIATE
Definition: audio_shared.csc:1440
‪clientVoiceSetup
‪function clientVoiceSetup(localClientNum)
Definition: audio_shared.csc:111
‪sndHealthSystem
‪function sndHealthSystem(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: audio_shared.csc:1135
‪snd_snapshot_init
‪function snd_snapshot_init()
Definition: audio_shared.csc:142
‪playloopat
‪function playloopat(aliasname, origin)
Definition: audio_shared.csc:909
‪snd_set_snapshot
‪function snd_set_snapshot(state)
Definition: audio_shared.csc:184
‪local_player_spawn
‪function local_player_spawn(localClientNum)
Definition: audio_shared.csc:49
‪bump_trigger_start
‪function bump_trigger_start(localClientNum)
Definition: audio_shared.csc:662
‪sndCChacking
‪function sndCChacking(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: audio_shared.csc:1405