destroygroup

Status
Not open for further replies.
Level 7
Joined
Jun 15, 2010
Messages
218
  • Events
    • Game - The in-game time of day becomes Equal to 19.00
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Owner of Graveyard 0070 <gen>) Equal to Player 4 (Purple)
      • Then - Actions
        • Unit - Create 8 SPAWNS_Right_Top_Type_1 for Player 4 (Purple) at (Center of Human Spawn Point 2 <gen>) facing Default building facing degrees
        • Unit - Create 4 L_Spawns_Def_Archer_Goeie for Player 4 (Purple) at (Center of Human Spawn Point 2 <gen>) facing Default building facing degrees
        • Custom script: set bj_wantDestroyGroup = true
        • Unit Group - Order (Units in Human Spawn Point 2 <gen>) to Move To (Center of (Playable map area))
      • Else - Actions
why is bj_wantDestroyGroup = true before the group is set and not after?
 
because setting it after will do nothing...

the GUI group loop function checks whether or not its true at the middle of the code (and since you cannot add the script at the middle of the BJ's code, you do it at the start), if yes, it destroys the group after all of the actions inside the loop...
 
Unit Group - Order (Units in Human Spawn Point 2 <gen>) to Move To (Center of (Playable map area))

bj_wantDestroyGroup = true will not do anything for that action. The group will have to be set to a variable and then destroyed.

Also, this is leaking locations.

If you want to know a bit more about what bj_wantDestroyGroup does, click the link in my sig "GUI Advanced Triggering Tips"
 
Status
Not open for further replies.
Back
Top