• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Is this trigger leakless?

Status
Not open for further replies.
Level 4
Joined
Sep 22, 2011
Messages
70
Title says it all, I need to know if this trigger is leakless or not, or if i need to temporarily create a variable region for each lava spawn to spawn at, then destroy them once they have all spawned.

  • Lava Spawns
    • Events
      • Unit - Rayvan 0034 <gen> Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Summon Lava Spawn (Rayvan)
    • Actions
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at (Center of Spawn 1 <gen>) facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at (Center of Spawn 2 <gen>) facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at (Center of Spawn 3 <gen>) facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at (Center of Spawn 4 <gen>) facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at (Center of Spawn 5 <gen>) facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at (Center of Spawn 6 <gen>) facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at (Center of Spawn 7 <gen>) facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at (Center of Spawn 8 <gen>) facing Default building facing degrees
      • Unit - Move Rayvan 0034 <gen> instantly to (Center of Fire Lords <gen>)
      • Unit - Remove Summon Lava Spawn (Rayvan) from Rayvan 0034 <gen>
  • Unit Group - Pick every unit in (Units in Rayvans Platform <gen> owned by Neutral Hostile) and do (Unit - Order (Picked unit) to Attack (Random unit from Random_Unit_Rayvan))
 
Level 4
Joined
Sep 22, 2011
Messages
70
I tried and this is what I got, it disabled the trigger giving the error "Expected Function name"
  • Lava Spawns
    • Events
      • Unit - Rayvan 0034 <gen> Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Summon Lava Spawn (Rayvan)
    • Actions
      • Set LavaSpawn_Loc[1] = (Center of Spawn 1 <gen>)
      • Set LavaSpawn_Loc[2] = (Center of Spawn 2 <gen>)
      • Set LavaSpawn_Loc[3] = (Center of Spawn 3 <gen>)
      • Set LavaSpawn_Loc[4] = (Center of Spawn 4 <gen>)
      • Set LavaSpawn_Loc[5] = (Center of Spawn 5 <gen>)
      • Set LavaSpawn_Loc[6] = (Center of Spawn 6 <gen>)
      • Set LavaSpawn_Loc[7] = (Center of Spawn 7 <gen>)
      • Set LavaSpawn_Loc[8] = (Center of Spawn 8 <gen>)
      • Set Rayvan_Spawns = (Center of Fire Lords <gen>)
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[1] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[2] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[3] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[4] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[5] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[6] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[7] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[8] facing Default building facing degrees
      • Custom script: call DestroyLocation(udg_LavaSpawn_Loc)
      • Unit - Move Rayvan 0034 <gen> instantly to Rayvan_Spawns
      • Unit - Remove Summon Lava Spawn (Rayvan) from Rayvan 0034 <gen>
      • Set LavaSpawns = (Units in Rayvans Platform <gen> owned by Neutral Hostile)
      • Unit Group - Pick every unit in LavaSpawns and do (Unit - Order (Picked unit) to Attack (Random unit from Random_Unit_Rayvan))
      • Custom script: call DestroyGroup(udg_LavaSpawns)
LavaSpawns_Loc is a Point Variable Array
 
It's not DestroyLocation, it's RemoveLocation.

Here's how you should remove the 9 locations you created:

  • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[1])
  • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[2])
  • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[3])
  • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[4])
  • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[5])
  • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[6])
  • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[7])
  • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[8])
  • // All the actions here
  • // This line at the end of the trigger
  • Custom script: call RemoveLocation(udg_Rayvan_Spawns)
 
Level 4
Joined
Sep 22, 2011
Messages
70
so will this be leakless?
  • Lava Spawns
    • Events
      • Unit - Rayvan 0034 <gen> Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Summon Lava Spawn (Rayvan)
    • Actions
      • Set LavaSpawn_Loc[1] = (Center of Spawn 1 <gen>)
      • Set LavaSpawn_Loc[2] = (Center of Spawn 2 <gen>)
      • Set LavaSpawn_Loc[3] = (Center of Spawn 3 <gen>)
      • Set LavaSpawn_Loc[4] = (Center of Spawn 4 <gen>)
      • Set LavaSpawn_Loc[5] = (Center of Spawn 5 <gen>)
      • Set LavaSpawn_Loc[6] = (Center of Spawn 6 <gen>)
      • Set LavaSpawn_Loc[7] = (Center of Spawn 7 <gen>)
      • Set LavaSpawn_Loc[8] = (Center of Spawn 8 <gen>)
      • Set Rayvan_Spawns = (Center of Fire Lords <gen>)
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[1] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[2] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[3] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[4] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[5] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[6] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[7] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[8] facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[1])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[2])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[3])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[4])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[5])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[6])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[7])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[8])
      • Unit - Move Rayvan 0034 <gen> instantly to Rayvan_Spawns
      • Custom script: call RemoveLocation(udg_Rayvan_Spawns)
      • Unit - Remove Summon Lava Spawn (Rayvan) from Rayvan 0034 <gen>
      • Set LavaSpawns = (Units in Rayvans Platform <gen> owned by Neutral Hostile)
      • Unit Group - Pick every unit in LavaSpawns and do (Unit - Order (Picked unit) to Attack (Random unit from Random_Unit_Rayvan))
      • Custom script: call DestroyGroup(udg_LavaSpawns)
Creating the points, spawning the lava spawns at them, removing the points, creating the point to move the boss, moving him, removing the point, setting the lavaspawns into a unit group, ordering them to attack a random unit from a existing unit group, then destroying the lava spawns unit group?

And i have no exp in looping actions, do I make a integer variable array for it, and run it for 1 to 8 or use integer a from 1 to 8? and how would i set up the actions? just like this?
  • For each (Integer A) from 1 to 8, do (Actions)
    • Loop - Actions
      • Set LavaSpawn_Loc[1] = (Center of Spawn 1 <gen>)
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[1] facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[1])
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
1. you cant use the location in the "each interiger a"

2. you should set the location at map start

3. you cantuse the custom script also

4. the spawn look like this
  • For each (Integer A) from 1 to 8, do (Actions)
    • Loop - Actions
      • Unit - Create (Integer A) (Unit-type of Your_unit) for Neutral Hostile at lavaspawn_loc[(Integer A)] facing Default building facing degrees
 
Level 8
Joined
Jan 8, 2010
Messages
493
yes, it is leakless as far as i see it.
for the loop part, you can set the regions to a region variable, and run it in a loop. something like:
  • Set Region[1] = Spawn 1
  • Set Region[2] = Spawn 2
  • .
  • .
  • Set Region[8] = Spawn 8
  • For each (Integer A) from 1 to 8, do (Actions)
    • Loop - Actions
      • Set Point = Center of Region[Integer A]
      • Unit - Create 1 Unit for Player at Point facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Point)
 
Level 4
Joined
Sep 22, 2011
Messages
70
  • Stage 1
    • Events
      • Unit - A unit Gains a level
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero level of (Triggering unit)) Equal to 11
        • Then - Actions
          • Set stage = 1
          • Player Group - Pick every player in (All players) and do (Player - Set the current research level of War Veteran Upgrade to 2 for (Picked player))
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Do nothing
does this player group leak? leak check says no but i think it does?
 
Level 8
Joined
Dec 9, 2009
Messages
397
so will this be leakless?
  • Lava Spawns
    • Events
      • Unit - Rayvan 0034 <gen> Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Summon Lava Spawn (Rayvan)
    • Actions
      • Set LavaSpawn_Loc[1] = (Center of Spawn 1 <gen>)
      • Set LavaSpawn_Loc[2] = (Center of Spawn 2 <gen>)
      • Set LavaSpawn_Loc[3] = (Center of Spawn 3 <gen>)
      • Set LavaSpawn_Loc[4] = (Center of Spawn 4 <gen>)
      • Set LavaSpawn_Loc[5] = (Center of Spawn 5 <gen>)
      • Set LavaSpawn_Loc[6] = (Center of Spawn 6 <gen>)
      • Set LavaSpawn_Loc[7] = (Center of Spawn 7 <gen>)
      • Set LavaSpawn_Loc[8] = (Center of Spawn 8 <gen>)
      • Set Rayvan_Spawns = (Center of Fire Lords <gen>)
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[1] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[2] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[3] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[4] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[5] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[6] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[7] facing Default building facing degrees
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at LavaSpawn_Loc[8] facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[1])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[2])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[3])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[4])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[5])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[6])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[7])
      • Custom script: call RemoveLocation(udg_LavaSpawn_Loc[8])
      • Unit - Move Rayvan 0034 <gen> instantly to Rayvan_Spawns
      • Custom script: call RemoveLocation(udg_Rayvan_Spawns)
      • Unit - Remove Summon Lava Spawn (Rayvan) from Rayvan 0034 <gen>
      • Set LavaSpawns = (Units in Rayvans Platform <gen> owned by Neutral Hostile)
      • Unit Group - Pick every unit in LavaSpawns and do (Unit - Order (Picked unit) to Attack (Random unit from Random_Unit_Rayvan))
      • Custom script: call DestroyGroup(udg_LavaSpawns)
It's a lot easier to use "TempLoc" as your variable than having it be an array.
It's only being called once then cleared as long as you have no waits, you can have all your locs be "TempLoc"

So like:
  • Lava Spawns
    • Events
      • Unit - Rayvan 0034 <gen> Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Summon Lava Spawn (Rayvan)
    • Actions
      • Set TempLoc = (Center of Spawn 1 <gen>)
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at TempLoc facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempLoc = (Center of Spawn 2 <gen>)
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at TempLoc facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempLoc = (Center of Spawn 3 <gen>)
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at TempLoc facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempLoc = (Center of Spawn 4 <gen>)
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at TempLoc facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempLoc = (Center of Spawn 5 <gen>)
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at TempLoc facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempLoc = (Center of Spawn 6 <gen>)
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at TempLoc facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempLoc = (Center of Spawn 7 <gen>)
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at TempLoc facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set TempLoc = (Center of Spawn 8 <gen>)
      • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at TempLoc facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set Temploc = (Center of Fire Lords <gen>)
      • Unit - Move Rayvan 0034 <gen> instantly to Rayvan_Spawns
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Unit - Remove Summon Lava Spawn (Rayvan) from Rayvan 0034 <gen>
      • Set LavaSpawns = (Units in Rayvans Platform <gen> owned by Neutral Hostile)
      • Unit Group - Pick every unit in LavaSpawns and do (Unit - Order (Picked unit) to Attack (Random unit from Random_Unit_Rayvan))
      • Custom script: call DestroyGroup(udg_LavaSpawns)
This way you can just copy/paste the lines:
  • Unit - Create 1 Lava Spawn (Rayvan) for Neutral Hostile at TempLoc facing Default building facing degrees
  • Custom script: call RemoveLocation(udg_TempLoc)
Will save you time instead of setting array numbers for every single thing.
 
Status
Not open for further replies.
Top