74
74
---- -------------------------------------------------------------
75
75
---- -------------------------------------------------------------
76
76
77
- print (" ME5_CombatManager: Entered" )
77
+ local __SCRIPT_NAME = " ME5_CombatManager" ;
78
+ local debug = true
79
+
80
+ local function PrintLog (...)
81
+ if debug == true then
82
+ print (" [" .. __SCRIPT_NAME .. " ]" , unpack (arg ));
83
+ end
84
+ end
85
+
86
+ PrintLog (" Entered" )
78
87
79
88
80
89
-- =================================
@@ -142,7 +151,7 @@ function WaveSequence:AddWave(...)
142
151
-- Update totalEnemies with the number of enemies that are spawned in the wave
143
152
self .totalEnemies = self .totalEnemies + wave .numDudes
144
153
145
- print (" WaveSequence:AddWave(): totalEnemies:" , self .totalEnemies )
154
+ PrintLog (" WaveSequence:AddWave(): totalEnemies:" , self .totalEnemies )
146
155
end
147
156
148
157
table.insert (self .waveSets , arg )
162
171
-- Call this to activate the first wave and initialize event logic.
163
172
--
164
173
function WaveSequence :Start (combatZoneID , musicID )
165
- print (" WaveSequence:Start(): Starting combat zone" )
174
+ PrintLog (" WaveSequence:Start(): Starting combat zone" )
166
175
167
176
-- Initialize values for data fields (even if they don't exist)
168
177
-- self.pathNode = self.pathNode or 0
@@ -171,7 +180,7 @@ function WaveSequence:Start(combatZoneID, musicID)
171
180
-- Store the number of waves in this sequence
172
181
self .totalWaves = table .getn (self .waveSets )
173
182
if (self .totalWaves == 0 ) then
174
- print (" WaveSequence:Start(): WARNING: No waves were added to the WaveSequence" )
183
+ PrintLog (" WaveSequence:Start(): WARNING: No waves were added to the WaveSequence" )
175
184
return
176
185
end
177
186
@@ -232,7 +241,7 @@ function WaveSequence:Start(combatZoneID, musicID)
232
241
233
242
-- Increment the kill count
234
243
self .killCount = self .killCount + 1
235
- print (" WaveSequence:Start(): killCount:" , self .killCount )
244
+ PrintLog (" WaveSequence:Start(): killCount:" , self .killCount )
236
245
237
246
238
247
-- Have all the enemies been killed?
@@ -282,15 +291,15 @@ end
282
291
-- Updates the current wave set number, and activates all the waves within that set.
283
292
--
284
293
function WaveSequence :ActivateWaveSet (whichSet )
285
- print (" WaveSequence:ActivateWaveSet(): Spawning wave " .. whichSet )
294
+ PrintLog (" WaveSequence:ActivateWaveSet(): Spawning wave " .. whichSet )
286
295
287
296
-- Is debug messages enabled?
288
297
if self .bDebug == true then
289
298
ShowMessageText (" level.EUR.debug.comzone_spawning" , REP )
290
299
end
291
300
292
301
if whichSet == table .getn (self .waveSets ) then
293
- print (" EURn_c.SpawnNextWave(): NOTICE: Final wave" )
302
+ PrintLog (" EURn_c.SpawnNextWave(): NOTICE: Final wave" )
294
303
295
304
-- Is debug messages enabled?
296
305
if self .bDebug == true then
322
331
-- Call this to complete the wave sequence.
323
332
--
324
333
function WaveSequence :Complete ()
325
- print (" WaveSequence:Complete(): Combat zone cleared" )
334
+ PrintLog (" WaveSequence:Complete(): Combat zone cleared" )
326
335
327
336
-- Is debug messages enabled?
328
337
if bDebug == true then
@@ -390,23 +399,23 @@ function SmartSpawn:Start()
390
399
391
400
-- Initialize data fields
392
401
if self .regionName == nil then
393
- print (" SmartSpawn:Start(): WARNING: regionName must be specified! Exiting function" )
402
+ PrintLog (" SmartSpawn:Start(): WARNING: regionName must be specified! Exiting function" )
394
403
return
395
404
end
396
405
if self .allySpawnIn == nil then
397
- print (" SmartSpawn:Start(): WARNING: allySpawnIn must be specified! Exiting function" )
406
+ PrintLog (" SmartSpawn:Start(): WARNING: allySpawnIn must be specified! Exiting function" )
398
407
return
399
408
end
400
409
if self .allySpawnOut == nil then
401
- print (" SmartSpawn:Start(): WARNING: allySpawnOut must be specified! Exiting function" )
410
+ PrintLog (" SmartSpawn:Start(): WARNING: allySpawnOut must be specified! Exiting function" )
402
411
return
403
412
end
404
413
if self .enemySpawnIn == nil then
405
- print (" SmartSpawn:Start(): WARNING: enemySpawnIn must be specified! Exiting function" )
414
+ PrintLog (" SmartSpawn:Start(): WARNING: enemySpawnIn must be specified! Exiting function" )
406
415
return
407
416
end
408
417
if self .enemySpawnOut == nil then
409
- print (" SmartSpawn:Start(): WARNING: enemySpawnOut must be specified! Exiting function" )
418
+ PrintLog (" SmartSpawn:Start(): WARNING: enemySpawnOut must be specified! Exiting function" )
410
419
return
411
420
end
412
421
@@ -455,7 +464,7 @@ function SmartSpawn:Start()
455
464
self .playerIs = " in"
456
465
457
466
if self .bDebug == true then
458
- print (" SmartSpawn:Start(): Player entered region" )
467
+ PrintLog (" SmartSpawn:Start(): Player entered region" )
459
468
ShowMessageText (" level.common.debug.smartspawn_entered" )
460
469
end
461
470
@@ -471,7 +480,7 @@ function SmartSpawn:Start()
471
480
self .playerIs = " out"
472
481
473
482
if self .bDebug == true then
474
- print (" SmartSpawn:Start(): Player exited region" )
483
+ PrintLog (" SmartSpawn:Start(): Player exited region" )
475
484
ShowMessageText (" level.common.debug.smartspawn_exited" )
476
485
end
477
486
@@ -567,13 +576,13 @@ end
567
576
function CombatWave :Start ()
568
577
-- Is the team set? If not, print an error message and exit the function
569
578
if self .team == nil then
570
- print (" CombatWave:Start(): WARNING: team must be specified! Exiting function" )
579
+ PrintLog (" CombatWave:Start(): WARNING: team must be specified! Exiting function" )
571
580
return
572
581
end
573
582
574
583
-- Is the spawnPath set? If not, print an error message and exit the function
575
584
--[[ if self.spawnPath == nil then
576
- print ("CombatWave:Start(): WARNING: spawnPath must be specified! Exiting function")
585
+ PrintLog ("CombatWave:Start(): WARNING: spawnPath must be specified! Exiting function")
577
586
return
578
587
end]]
579
588
@@ -588,10 +597,10 @@ function CombatWave:Start()
588
597
589
598
-- Spawn the enemies
590
599
print ()
591
- print (" CombatWave:Start(): Spawning " .. self .numDudes .. " enemies from team " .. self .team .. " at " .. self .container .spawnPath )
600
+ PrintLog (" CombatWave:Start(): Spawning " .. self .numDudes .. " enemies from team " .. self .team .. " at " .. self .container .spawnPath )
592
601
Ambush (self .container .spawnPath , self .numDudes , self .team )
593
602
594
- print (" CombatWave:Start(): Total enemiesRemaining:" , self .enemiesRemaining )
603
+ PrintLog (" CombatWave:Start(): Total enemiesRemaining:" , self .enemiesRemaining )
595
604
596
605
597
606
@@ -611,7 +620,7 @@ function CombatWave:Start()
611
620
612
621
-- Decrement enemies remaining
613
622
self .enemiesRemaining = self .enemiesRemaining - 1
614
- print (" CombatWave:Start(): enemiesRemaining:" , self .enemiesRemaining )
623
+ PrintLog (" CombatWave:Start(): enemiesRemaining:" , self .enemiesRemaining )
615
624
616
625
617
626
-- Has spawnValue been met?
648
657
-- NOTE: The definition of a "finished wave" is when the spawnValue is met, i.e., the next wave is triggered.
649
658
--
650
659
function CombatWave :Complete ()
651
- print ( " ME5_CombatManager. CombatWave.Complete(): Exited" )
660
+ PrintLog ( " CombatWave.Complete(): Exited" )
652
661
653
662
if self .isComplete then return end
654
663
@@ -661,4 +670,4 @@ function CombatWave:Complete()
661
670
self :OnComplete ()
662
671
end
663
672
664
- print ( " ME5_CombatManager: Exited" )
673
+ PrintLog ( " Exited" )
0 commit comments