• 🏆 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!

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?
 
Level 13
Joined
Mar 24, 2010
Messages
950
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.
Top