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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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