Removing this leak?

hunterrravyn

TH.net Regular
Reaction score
19
Well how do we remove a random region leak?

This is the trig

Code:
E-
C-
A-Wait ((Real(ZombSpawn_Timer)) x 3.00) seconds
Unit - Create 1 Zombie for Player 12 (Brown) at (Center of ZombSpawn_Region[(Random integer number between 1 and 338)]) facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
Unit - Create 1 Zombie for Player 12 (Brown) at (Center of ZombSpawn_Region[(Random integer number between 1 and 338)]) facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
Unit - Create 1 Zombie for Player 12 (Brown) at (Center of ZombSpawn_Region[(Random integer number between 1 and 338)]) facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        Nooverflow Greater than or equal to 20
    Then - Actions
        Trigger - Clear the trigger queue
        Set Nooverflow = 0
        Trigger - Run (This trigger) (checking conditions)
    Else - Actions
        Set Nooverflow = (Sign((Nooverflow + 1)))
        Trigger - Run (This trigger) (checking conditions)
 

Jooster

New Member
Reaction score
7
well instead of using center of region. use a point. like this

Code:
Untitled Trigger 001
    Events
    Conditions
    Actions
        Set Temp_Point = (Center of (Playable map area))
        Unit - Create 1 Footman for Player 1 (Red) at Temp_Point facing Default building facing (270.0) degrees
        Custom script:    call RemoveLocation (udg_Temp_Point)

actually you would more then likelly want to make your spawning something like this

Temp_Point = Point variable
Random_Num = integer
Rect_Array = <--name speaks for itself

Code:
Untitled Trigger 001
    Events
    Conditions
    Actions
        Set Random_Num = (Random integer number between 1 and 338)
        Set Temp_Point = (Center of Rect_Array[Random_Num])
        Unit - Create 1 Footman for Player 1 (Red) at Temp_Point facing Default building facing (270.0) degrees
        Custom script:    call RemoveLocation (udg_Temp_Point)
        Set Random_Num = (Random integer number between 1 and 338)
        Set Temp_Point = (Center of Rect_Array[Random_Num])
        Unit - Create 1 Footman for Player 1 (Red) at Temp_Point facing Default building facing (270.0) degrees
        Custom script:    call RemoveLocation (udg_Temp_Point)
        Set Random_Num = (Random integer number between 1 and 338)
        Set Temp_Point = (Center of Rect_Array[Random_Num])
        Unit - Create 1 Footman for Player 1 (Red) at Temp_Point facing Default building facing (270.0) degrees
        Custom script:    call RemoveLocation (udg_Temp_Point)

you must set the Random_Num variable between each unit creation action or they will all spawn at the same place. same with the Temp_point
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,497
Store points instead of regions...
I.e.
Set myPoint[1] = Center of <region 1>
Set myPoint[2] = Center of <region 2>

And simply don't ever destroy anything.
See your previous thread too... :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top