‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
zm_giant_amb.csc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\audio_shared;
4 #using scripts\shared\array_shared;
5 #insert scripts\shared\shared.gsh;
6 
7 function ‪main()
8 {
9  thread ‪start_lights();
10 
11  //TELEPORTER
12  thread ‪teleport_pad_init(0);
13  thread ‪teleport_pad_init(1);
14  thread ‪teleport_pad_init(2);
15 
16  thread ‪teleport_2d();
17 
18  thread ‪pa_init(0);
19  thread ‪pa_init(1);
20  thread ‪pa_init(2);
21  thread ‪pa_single_init();
22 
23  thread ‪homepad_loop();
24  thread ‪power_audio_2d();
25  thread ‪linkall_2d();
26 
27  thread ‪crazy_power();
28  thread ‪flip_sparks();
29 
30  thread ‪play_added_ambience();
31  thread ‪play_flux_whispers();
33 }
34 
35 function ‪start_lights()
36 {
37  level waittill ("pl1");
38 
39  array::thread_all(‪struct::get_array( "dyn_light", "targetname" ),&‪light_sound);
40  array::thread_all(‪struct::get_array( "switch_progress", "targetname" ),&‪switch_progress_sound);
41  array::thread_all(‪struct::get_array( "dyn_generator", "targetname" ),&‪generator_sound);
42  array::thread_all(‪struct::get_array( "dyn_breakers", "targetname" ),&‪breakers_sound);
43 
44 }
45 
46 function ‪light_sound()
47 {
48  if(isdefined( self ) )
49  {
50  playsound(0,"evt_light_start", self.origin);
51  e1 = ‪audio::playloopat("amb_light_buzz",self.origin);
52  }
53 }
54 
56 {
57  if(isdefined( self ) )
58  {
59  wait(3);
60  playsound(0, "evt_switch_progress", self.origin);
61  playsound(0, "evt_gen_start", self.origin);
62  g1 = ‪audio::playloopat("evt_gen_loop",self.origin);
63  }
64 }
65 
67 {
68  if(isdefined( self ) )
69  {
70  playsound(0, "evt_break_start", self.origin);
71  b1 = ‪audio::playloopat("evt_break_loop",self.origin);
72  }
73 }
74 
76 {
77  if(isdefined( self.script_noteworthy ) )
78  {
79  if( self.script_noteworthy == "1" )
80  time = .5;
81  else if( self.script_noteworthy == "2" )
82  time = 1;
83  else if( self.script_noteworthy == "3" )
84  time = 1.5;
85  else if( self.script_noteworthy == "4" )
86  time = 2;
87  else if( self.script_noteworthy == "5" )
88  time = 2.5;
89  else
90  time = 0;
91 
92  wait(time);
93  playsound(0, "evt_switch_progress", self.origin);
94  }
95 }
96 
97 
98 //TELEPORTER
99 function ‪homepad_loop()
100 {
101  level waittill( "pap1" );
102  homepad = ‪struct::get( "homepad_power_looper", "targetname" );
103  home_breaker = ‪struct::get( "homepad_breaker", "targetname" );
104 
105  if(isdefined( homepad ))
106  {
107  ‪audio::playloopat( "amb_homepad_power_loop", homepad.origin );
108  }
109  if(isdefined( home_breaker ) )
110  {
111  ‪audio::playloopat( "amb_break_arc", home_breaker.origin );
112  }
113 }
114 
115 function ‪teleport_pad_init( pad ) //Plays loopers on each pad as they get activated, threads the teleportation audio
116 {
117  telepad = ‪struct::get_array( "telepad_" + pad, "targetname" );
118  ‪telepad_loop = ‪struct::get_array( "telepad_" + pad + "_looper", "targetname" );
119  homepad = ‪struct::get_array( "homepad", "targetname" );
120 
121  level waittill( "tp" + pad);
122  array::thread_all( ‪telepad_loop,&‪telepad_loop );
123  array::thread_all( telepad,&‪teleportation_audio, pad );
124  array::thread_all( homepad,&‪teleportation_audio, pad );
125 }
126 
127 function ‪telepad_loop()
128 {
129  ‪audio::playloopat( "amb_power_loop", self.origin );
130 }
131 
132 function ‪teleportation_audio( pad ) //Plays warmup and cooldown audio for homepad and telepads
133 {
134  teleport_delay = 2;
135 
136  while(1)
137  {
138  level waittill( "tpw" + pad );
139 
140  if(IsDefined( self.script_sound ))
141  {
142  if(self.targetname == "telepad_" + pad) //Sounds play right after each other
143  {
144  playsound( 0, self.script_sound + "_warmup", self.origin );
145  wait(2);
146  playsound( 0, self.script_sound + "_cooldown", self.origin );
147  }
148  if(self.targetname == "homepad") //Sounds wait until 2 seconds before transportation
149  {
150  wait(2);
151  playsound( 0, self.script_sound + "_warmup", self.origin );
152  playsound( 0, self.script_sound + "_cooldown", self.origin );
153  }
154  }
155  }
156 }
157 
158 //***PA System***
159 //Plays sounds off of PA structs strewn throughout the map
160 
161 
162 function ‪pa_init( pad )
163 {
164  pa_sys = ‪struct::get_array( "pa_system", "targetname" );
165 
166  //array::thread_all( pa_sys,&pa_teleport, pad );
167  //array::thread_all( pa_sys,&pa_countdown, pad );
168  //array::thread_all( pa_sys,&pa_countdown_success, pad );
169 }
170 
172 {
173  pa_sys = ‪struct::get_array( "pa_system", "targetname" );
174 
175  //array::thread_all( pa_sys,&pa_electric_trap, "bridge" );
176  //array::thread_all( pa_sys,&pa_electric_trap, "wuen" );
177  //array::thread_all( pa_sys,&pa_electric_trap, "warehouse" );
178  //array::thread_all( pa_sys,&pa_level_start );
179  //array::thread_all( pa_sys,&pa_power_on );
180 
181 }
182 
183 function ‪pa_countdown( pad )
184 {
185  level endon( "scd" + pad );
186 
187  while(1)
188  {
189  level waittill( "pac" + pad );
190 
191  playsound( 0, "evt_pa_buzz", self.origin );
192  self thread ‪pa_play_dialog( "vox_pa_audio_link_start" );
193 
194  count = 30;
195  while ( count > 0 )
196  {
197  ‪play = count == 20 || count == 15 || count <= 10;
198  if ( ‪play )
199  {
200  playsound( 0, "vox_pa_audio_link_" + count, self.origin );
201  //println("play @: " + self.origin);
202  }
203 
204  playsound( 0, "evt_clock_tick_1sec", (0,0,0) );
205  waitrealtime( 1 );
206  count--;
207  }
208  playsound( 0, "evt_pa_buzz", self.origin );
209  wait(1.2);
210  self thread ‪pa_play_dialog( "vox_pa_audio_link_fail" );
211  }
212  wait(1);
213 }
214 
215 function ‪pa_countdown_success( pad )
216 {
217  level waittill( "scd" + pad );
218 
219  playsound( 0, "evt_pa_buzz", self.origin );
220  wait(1.2);
221  //self pa_play_dialog( "pa_audio_link_yes" );
222  self ‪pa_play_dialog( "vox_pa_audio_act_pad_" + pad );
223 }
224 
225 function ‪pa_teleport( pad ) //Plays after successful teleportation, threads cooldown count
226 {
227  while(1)
228  {
229  level waittill( "tpc" + pad );
230  wait(1);
231 
232  playsound( 0, "evt_pa_buzz", self.origin );
233  wait(1.2);
234  self ‪pa_play_dialog( "vox_pa_teleport_finish" );
235  }
236 }
237 
238 function ‪pa_electric_trap( location )
239 {
240  while(1)
241  {
242  level waittill( location );
243 
244  playsound( 0, "evt_pa_buzz", self.origin );
245  wait(1.2);
246  self thread ‪pa_play_dialog( "vox_pa_trap_inuse_" + location );
247  waitrealtime(48.5);
248  playsound( 0, "evt_pa_buzz", self.origin );
249  wait(1.2);
250  self thread ‪pa_play_dialog( "vox_pa_trap_active_" + location );
251  }
252 }
253 
254 function ‪pa_play_dialog( alias )
255 {
256  if( !IsDefined( self.pa_is_speaking ) )
257  {
258  self.pa_is_speaking = 0;
259  }
260 
261  if( self.pa_is_speaking != 1 )
262  {
263  self.pa_is_speaking = 1;
264  self.pa_id = playsound( 0, alias, self.origin );
265  while( SoundPlaying( self.pa_id ) )
266  {
267  wait( 0.01 );
268  }
269  self.pa_is_speaking = 0;
270  }
271 }
272 
273 function ‪teleport_2d() //Plays a 2d sound for a teleporting player 1.7 seconds after activating teleporter
274 {
275  while(1)
276  {
277  level waittill( "t2d" );
278  playsound( 0, "evt_teleport_2d_fnt", (0,0,0) );
279  playsound( 0, "evt_teleport_2d_rear", (0,0,0) );
280  }
281 }
282 
284 {
285  level waittill ("pl1");
286  playsound( 0, "evt_power_up_2d", (0,0,0) );
287 }
288 
289 function ‪linkall_2d()
290 {
291  level waittill( "pap1" );
292  playsound( 0, "evt_linkall_2d", (0,0,0) );
293 }
294 
296 {
297 }
298 
299 function ‪pa_power_on()
300 {
301  level waittill ("pl1");
302 
303  playsound( 0, "evt_pa_buzz", self.origin );
304  wait(1.2);
305  self ‪pa_play_dialog( "vox_pa_power_on" );
306 }
307 
308 function ‪crazy_power()
309 {
310  level waittill ("pl1");
311  playsound( 0, "evt_crazy_power_left", (-510, 394, 102) );
312  playsound( 0, "evt_crazy_power_right", (554, -1696, 156) );
313 }
314 
315 function ‪flip_sparks()
316 {
317  level waittill ("pl1");
318  playsound( 0, "evt_flip_sparks_left", (511, -1771, 116 ) );
319  playsound( 0, "evt_flip_sparks_right", (550, -1771, 116 ) );
320 }
322 {
323  ‪audio::playloopat("amb_snow_transitions", (-181, -455, 6));
324  ‪audio::playloopat("amb_snow_transitions", (1315, -1428, 227));
325  ‪audio::playloopat("amb_snow_transitions", (-1365, -1597, 295));
326  ‪audio::playloopat("amb_extreme_fire_dist", (1892, -2563, 1613));
327  ‪audio::playloopat("amb_extreme_fire_dist", (1441, -1622, 1603));
328  ‪audio::playloopat("amb_extreme_fire_dist", (-1561, 410, 1559));
329  ‪audio::playloopat("amb_extreme_fire_dist", (844, 2038, 915));
330  ‪audio::playloopat("amb_small_fire", (779, -2249, 326));
331  ‪audio::playloopat("amb_small_fire", (-2, -1417, 124));
332  ‪audio::playloopat("amb_small_fire", (1878, 911, 189));
333 }
335 {
336  while(1)
337  {
338  playsound( 0, "amb_creepy_whispers", (-339, 271, 207));
339  playsound( 0, "amb_creepy_whispers", (234, 110, 310));
340  playsound( 0, "amb_creepy_whispers", (-17, -564, 255));
341  playsound( 0, "amb_creepy_whispers", (743, -1859, 210));
342  playsound( 0, "amb_creepy_whispers", (790, -748, 181));
343  wait RandomIntRange(1,4);
344  }
345 }
347 {
348  while(1)
349  {
350  wait(60);
351  playsound( 0, "amb_creepy_children", (-2637, -2403, 413));
352  }
353 }
354 
355 
356 
‪telepad_loop
‪function telepad_loop()
Definition: zm_giant_amb.csc:127
‪pa_teleport
‪function pa_teleport(pad)
Definition: zm_giant_amb.csc:225
‪pa_level_start
‪function pa_level_start()
Definition: zm_giant_amb.csc:295
‪play_backwards_children
‪function play_backwards_children()
Definition: zm_giant_amb.csc:346
‪pa_power_on
‪function pa_power_on()
Definition: zm_giant_amb.csc:299
‪homepad_loop
‪function homepad_loop()
Definition: zm_giant_amb.csc:99
‪play_added_ambience
‪function play_added_ambience()
Definition: zm_giant_amb.csc:321
‪power_audio_2d
‪function power_audio_2d()
Definition: zm_giant_amb.csc:283
‪generator_sound
‪function generator_sound()
Definition: zm_giant_amb.csc:55
‪play
‪function play(animation, v_origin_or_ent, v_angles_or_tag, n_rate=1, n_blend_in=.2, n_blend_out=.2, n_lerp, b_link=false)
Definition: animation_shared.csc:44
‪get_array
‪function get_array(kvp_value, kvp_key="targetname")
Definition: struct.csc:34
‪linkall_2d
‪function linkall_2d()
Definition: zm_giant_amb.csc:289
‪pa_electric_trap
‪function pa_electric_trap(location)
Definition: zm_giant_amb.csc:238
‪pa_single_init
‪function pa_single_init()
Definition: zm_giant_amb.csc:171
‪pa_init
‪function pa_init(pad)
Definition: zm_giant_amb.csc:162
‪get
‪function get(kvp_value, kvp_key="targetname")
Definition: struct.csc:13
‪teleport_pad_init
‪function teleport_pad_init(pad)
Definition: zm_giant_amb.csc:115
‪main
‪function main()
Definition: zm_giant_amb.csc:7
‪pa_countdown_success
‪function pa_countdown_success(pad)
Definition: zm_giant_amb.csc:215
‪flip_sparks
‪function flip_sparks()
Definition: zm_giant_amb.csc:315
‪light_sound
‪function light_sound()
Definition: zm_giant_amb.csc:46
‪crazy_power
‪function crazy_power()
Definition: zm_giant_amb.csc:308
‪breakers_sound
‪function breakers_sound()
Definition: zm_giant_amb.csc:66
‪teleport_2d
‪function teleport_2d()
Definition: zm_giant_amb.csc:273
‪pa_countdown
‪function pa_countdown(pad)
Definition: zm_giant_amb.csc:183
‪play_flux_whispers
‪function play_flux_whispers()
Definition: zm_giant_amb.csc:334
‪switch_progress_sound
‪function switch_progress_sound()
Definition: zm_giant_amb.csc:75
‪start_lights
‪function start_lights()
Definition: zm_giant_amb.csc:35
‪teleportation_audio
‪function teleportation_audio(pad)
Definition: zm_giant_amb.csc:132
‪pa_play_dialog
‪function pa_play_dialog(alias)
Definition: zm_giant_amb.csc:254
‪playloopat
‪function playloopat(aliasname, origin)
Definition: audio_shared.csc:909