• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

How to fix a random location spawn leak?

Status
Not open for further replies.
Level 5
Joined
Jun 8, 2009
Messages
101
  • OS1
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
      • SpawnArray Equal to 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Unit - Create 1 Stalfos (Lv1) for Player 12 (Brown) at (Random point in OverworldSpawn1 <gen>) facing Default building facing degrees
          • Set OS[0] = (Position of (Last created unit))
          • Wait 0.02 seconds
          • Custom script: call RemoveLocation(udg_OS[0])
        • Else - Actions
          • Do nothing
      • -------- After Temples Spawn --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SpawnArray Equal to 1
        • Then - Actions
        • Else - Actions
          • Do nothing
      • -------- End Game Spawn --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SpawnArray Equal to 2
        • Then - Actions
        • Else - Actions
          • Do nothing
does this leak?
 
lol this trigger.. does close to nothing

first off, it leaks at the region location. but most of this will be questions.

why do you set a temp point var after you already created the unit?
why do you have the 2nd 2 if-then's they do literally nothing for the Then AND the Else.
you can nOt have a wait when your removing a location

this is how to fix it set the temp point to the center or a random point in that regrion create the unit in that temp point and then remove it with no wait.
Then delete the 2nd to if-then's doing nothing.

  • OS1
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
      • SpawnArray Equal to 0
    • Actions
      • Set OS[0] = (Random point in OverworldSpawn1 <gen>)
      • Unit - Create 1 Stalfos (Lv1) for Player 12 (Brown) at (OS[0]) facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_OS[0])

thats all your trigger needs to look like.
 
Status
Not open for further replies.
Back
Top