Does this trigger leak?

Zanderist

New Member
Reaction score
5
So all the regions get set by...

Trigger:
  • Events
    • Map initialization
    • Conditions
    • Actions
      • -------- ZombieSpawn Regions --------
      • Set ZombieSpawnX[1] = ZombieSpawn West <gen>
      • Set ZombieSpawnX[2] = ZombieSpawn SouthValleyTop <gen>
      • Set ZombieSpawnX[3] = ZombieSpawn South MountianSide <gen>
      • Set ZombieSpawnX[4] = ZombieSpawn South <gen>
      • Set ZombieSpawnX[5] = ZombieSpawn SafeZone South <gen>
      • ....
      • Set ZombieSpawnX[11] = ZombieSpawn LargeValley <gen>
      • Set ZombieSpawnX[12] = ZombieSpawn East <gen>
      • Set ZombieSpawnX[13] = ZombieSpawn Bridge <gen>


And then when they all spawn...this is the one I feel has some leaks to it.

It's turned on by another trigger then turned off by a another.
Trigger:
  • Events
    • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 13, do (Actions)
        • Loop - Actions
          • Unit - Create Rabid_Zombie_Number Rabid Zombie for Player 4 (Purple) at (Center of ZombieSpawnX[(Integer A)]) facing (Center of Town Falls <gen>)
 

Carnerox

The one and only.
Reaction score
84
Trigger:
  • Events
    • Map initialization
    • Conditions
    • Actions
      • -------- ZombieSpawn Regions --------
      • Set ZombieSpawnX[1] = ZombieSpawn West <gen>
      • Set ZombieSpawnX[2] = ZombieSpawn SouthValleyTop <gen>
      • Set ZombieSpawnX[3] = ZombieSpawn South MountianSide <gen>
      • Set ZombieSpawnX[4] = ZombieSpawn South <gen>
      • Set ZombieSpawnX[5] = ZombieSpawn SafeZone South <gen>
      • ....
      • Set ZombieSpawnX[11] = ZombieSpawn LargeValley <gen>
      • Set ZombieSpawnX[12] = ZombieSpawn East <gen>
      • Set ZombieSpawnX[13] = ZombieSpawn Bridge <gen>
      • Trigger - Turn (This trigger) off


Trigger:
  • Events
    • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 13, do (Actions)
        • Loop - Actions
          • Unit - Create Rabid_Zombie_Number Rabid Zombie for Player 4 (Purple) at (Center of ZombieSpawnX[(Integer A)]) facing (Center of Town Falls <gen>)
          • Call RemoveLocation (udg_ZombieSpawnX[(Integer A)]
 

Zanderist

New Member
Reaction score
5
How are you supposed type in the custom script for the second part.

I keep getting a expected a name error.
 

Happy

Well-Known Member
Reaction score
71
Trigger:
  • custom script : call RemoveLocation (udg_ZombieSpawnX[(Integer A)])
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Neither of what these guys have said is correct...
Trigger:
  • Custom script : call RemoveLocation (udg_ZombieSpawnX[bj_forLoopAIndex])

In that case, but since the "ZombieSpawnX[]" arrays are all rect variables, this won't work...

You should instead just make them point variables, and set them to (Center of ZombieSpawn West <gen>) etc...
Then you won't even have to remove them... ;)

Because the way Undead.Cow put it would still leak... And wouldn't work after the first run :(
 

Zanderist

New Member
Reaction score
5
The trigger as it is now:

Trigger:
  • Spawn Zombies
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 13, do (Actions)
        • Loop - Actions
          • Unit - Create Rabid_Zombie_Number Rabid Zombie for Player 4 (Purple) at ZombieSpawnX[(Integer A)] facing (Center of Town Falls &lt;gen&gt;)
      • Custom script: call RemoveLocation (udg_ZombieSpawnX[(Integer A)])
 

Zanderist

New Member
Reaction score
5
Neither of what these guys have said is correct...
Trigger:
  • Custom script : call RemoveLocation (udg_ZombieSpawnX[bj_forLoopAIndex])

In that case, but since the "ZombieSpawnX[]" arrays are all rect variables, this won't work...

You should instead just make them point variables, and set them to (Center of ZombieSpawn West <gen>) etc...
Then you won't even have to remove them... ;)

Because the way Undead.Cow put it would still leak... And wouldn't work after the first run :(

The funny part is I did put them as point variables after the lesson I learned from shura with this trigger.

Trigger:
  • Move to Here
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set Zombies = (Units in (Playable map area) owned by Player 4 (Purple))
      • Set Move_to_Here = (Center of The Town &lt;gen&gt;)
      • Unit Group - Pick every unit in Zombies and do (Actions)
        • Loop - Actions
          • Unit Group - Order Zombies to Attack-Move To Move_to_Here
      • Custom script: call DestroyGroup ( udg_Zombies )
      • Custom script: call RemoveLocation ( udg_Move_to_Here )


That works.

EDIT:Komaqtion, I copied and pasted your custom script and re-enabled.

VICTORY!!!

Rep+
 

Carnerox

The one and only.
Reaction score
84
Also don't double post, just use the
edit.gif
button. :thup:
 

Zanderist

New Member
Reaction score
5
Okay now I have a new problem.

I have 13 regions,

I want them to spawn at the first region, and then plus another, and then plus another, etc.

What the problem is now is that they just keep spawning at the one region, no where else.

Trigger:
  • Spawn Zombies
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_Number Equal to 13
        • Then - Actions
          • Set Wave_Number = 1
          • Set Rabid_Zombie_Number = (Rabid_Zombie_Number + 1)
        • Else - Actions
          • For each (Integer A) from 1 to Wave_Number, do (Actions)
            • Loop - Actions
              • Unit - Create Rabid_Zombie_Number Rabid Zombie for Player 4 (Purple) at ZombieSpawnX[(Integer A)] facing (Center of Town Falls &lt;gen&gt;)
      • Set Wave_Number = (Wave_Number + 1)
      • Custom script: call RemoveLocation (udg_ZombieSpawnX[bj_forLoopAIndex])


I've also found that a massive number of units spawning was causing the game to slow down.

I changed it to one unit and it went very smoothly.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Why is this there ?!
Trigger:
  • Custom script: call RemoveLocation (udg_ZombieSpawnX[bj_forLoopAIndex])


Also, I suggest you move this to the top:
Trigger:
  • Set Wave_Number = (Wave_Number + 1)


Otherwise it should work ;)

Though, this still leaks...
Code:
Unit - Create Rabid_Zombie_Number Rabid Zombie for Player 4 (Purple) at ZombieSpawnX[(Integer A)] facing [COLOR="Red"](Center of Town Falls <gen>)[/COLOR]
 

Zanderist

New Member
Reaction score
5
Why is this there ?!
Trigger:
  • Custom script: call RemoveLocation (udg_ZombieSpawnX[bj_forLoopAIndex])

Because it works


Why is this there ?!
Also, I suggest you move this to the top:
Trigger:
  • Set Wave_Number = (Wave_Number + 1)


Otherwise it should work ;)

I'll try that.

EDIT: I've Tried it, and what happens is that 1 unit spawns in the same region then 2 in the same then 3 in the same etc.

Trigger:
  • Spawn Zombies
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set Wave_Number = (Wave_Number + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_Number Equal to 13
        • Then - Actions
          • Set Wave_Number = 0
          • Set Rabid_Zombie_Number = (Rabid_Zombie_Number + 1)
        • Else - Actions
          • For each (Integer A) from 1 to Wave_Number, do (Actions)
            • Loop - Actions
              • Unit - Create Rabid_Zombie_Number Rabid Zombie for Player 4 (Purple) at ZombieSpawnX[(Integer A)] facing (Center of Town Falls &lt;gen&gt;)
      • Custom script: call RemoveLocation (udg_ZombieSpawnX[bj_forLoopAIndex])


Though, this still leaks...
Code:
Unit - Create Rabid_Zombie_Number Rabid Zombie for Player 4 (Purple) at ZombieSpawnX[(Integer A)] facing [COLOR="Red"](Center of Town Falls <gen>)[/COLOR]

Any way to fix that?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Because it works

No it doesn't...
There is no bj_forLoopAIndex, because that's the equivalent to (Integer A), and you're not using a loop there...

I'll try that

Do so ;)

Any way to fix that?

Sure, just set a Point typ variable to that, then use that point variable in the action, and after use this custom script:
Trigger:
  • Custom script: call RemoveLocation (udg_Variable_Name)
(It's case sensitive)
 

Zanderist

New Member
Reaction score
5
No it doesn't...
There is no bj_forLoopAIndex, because that's the equivalent to (Integer A), and you're not using a loop there...

For some reason though, when I entered that in, it allowed the trigger to turn back on.



I've Tried it, and what happens is that 1 unit spawns in the same region then 2 in the same then 3 in the same etc.

Trigger:
  • Spawn Zombies
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set Wave_Number = (Wave_Number + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_Number Equal to 13
        • Then - Actions
          • Set Wave_Number = 0
          • Set Rabid_Zombie_Number = (Rabid_Zombie_Number + 1)
        • Else - Actions
          • For each (Integer A) from 1 to Wave_Number, do (Actions)
            • Loop - Actions
              • Unit - Create Rabid_Zombie_Number Rabid Zombie for Player 4 (Purple) at ZombieSpawnX[(Integer A)] facing (Center of Town Falls &lt;gen&gt;)
      • Custom script: call RemoveLocation (udg_ZombieSpawnX[bj_forLoopAIndex])



Sure, just set a Point typ variable to that, then use that point variable in the action, and after use this custom script:
Trigger:
  • Custom script: call RemoveLocation (udg_Variable_Name)
(It's case sensitive)

It's arrayed though, and I had been trying this to no success.

Trigger:
  • Events
    • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 13, do (Actions)
        • Loop - Actions
          • Unit - Create Rabid_Zombie_Number Rabid Zombie for Player 4 (Purple) at (Center of ZombieSpawnX[(Integer A)]) facing (Center of Town Falls &lt;gen&gt;)
          • Call RemoveLocation (udg_ZombieSpawnX[(Integer A)]
 

Komaqtion

You can change this now in User CP.
Reaction score
469
For some reason though, when I entered that in, it allowed the trigger to turn back on.

That's because you typed it in incorrecty before, and you can't run a trigger with a syntax error, which is why you could enable it when you typed it correctly ;)

I've Tried it, and what happens is that 1 unit spawns in the same region then 2 in the same then 3 in the same etc.

May I ask, could you explain again what it is you want ? :S
Do you want it to be like a pyramid ? :S
Like you first create 1 unit a region 1, then 1 at region 1 and region 2 etc... ?

It's arrayed though, and I had been trying this to no success.

What is arrayed ? :S
You know you can have several variables of the same type...
 

Zanderist

New Member
Reaction score
5
That's because you typed it in incorrecty before, and you can't run a trigger with a syntax error, which is why you could enable it when you typed it correctly ;)
How would I type it in correctly?


May I ask, could you explain again what it is you want ? :S
Do you want it to be like a pyramid ? :S
Like you first create 1 unit a region 1, then 1 at region 1 and region 2 etc... ?

Yes like that. Starts off at 1 region then Starts again at Region 1 and 2 etc...

I've done it before, but not using For each integer A. I did it by using that wavenumber integer, and when it would reach a certain number it would turn off a trigger and turn on another one.

What is arrayed ? :S
You know you can have several variables of the same type...

The region point spawn
 

Komaqtion

You can change this now in User CP.
Reaction score
469
How would I type it in correctly?

Well, since you can enable the trigger, it correctly now but that doesn't mean it works, or is any good... :p

Yes like that. Starts off at 1 region then Starts again at Region 1 and 2 etc...

I've done it before, but not using For each integer A. I did it by using that wavenumber integer, and when it would reach a certain number it would turn off a trigger and turn on another one.

Ok, but I see nothing wrong with you last code, other than the custom script :p

The region point spawn

Yeah, but I meant using another variable, like this:
Trigger:
  • Spawn Zombies
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set Wave_Number = (Wave_Number + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Wave_Number Equal to 13
        • Then - Actions
          • Set Wave_Number = 0
          • Set Rabid_Zombie_Number = (Rabid_Zombie_Number + 1)
        • Else - Actions
          • For each (Integer A) from 1 to Wave_Number, do (Actions)
            • Loop - Actions
              • Set TempPoint = (Center of Town Falls &lt;gen&gt;)
              • Unit - Create Rabid_Zombie_Number Rabid Zombie for Player 4 (Purple) at ZombieSpawnX[(Integer A)] facing TempPoint
              • Custom script: call RemoveLocation(udg_TempPoint)


TemPoint is a Point variable, and is case sensitive ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top