Trigger Fails

Hot

New Member
Reaction score
9
This is what im trying to do:
When the timer expires i pick all units owned by player Red and move them to the Battle Grounds.

This is what happends: When the timer expires only the hero gets picked and the footman stays...

Trigger:
  • Battle Timer
    • Events
      • Time - BattleTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy TimerWindow
      • Player Group - Pick every player in InGamePlayers and do (Actions)
        • Loop - Actions
          • Set TmpPoint = (Random point in Arena <gen>)
          • Unit Group - Pick every unit in (Units in Regions[(Player number of (Picked player))] owned by (Picked player)) and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to TmpPoint
              • Custom script: call RemoveLocation( udg_TmpPoint )
 

Virus

New Member
Reaction score
3
Trigger:
  • Events
    • Time - BattleTimer Expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy TimerWindow
      • Unit Group - Pick every unit in (Units owned by Player 1(Red)) and do (Unit - Move (Picked Unit) instantly to (YourRegion))
 

Virus

New Member
Reaction score
3
And here's the random one:

Trigger:
  • Actions
    • For each (IntegerA) from 1 to (Number of units in (Units owned by Player 1 (Red))), do (Actions)
      • Loop - Actions
        • Set TempLoc = (Random point in (Playable map area))
        • Unit - Move (Picked unit) instantly to TempLoc


TempLoc = Point variable
 

Azlier

Old World Ghost
Reaction score
461
I'll go ahead and say it's because you're destroying the location inside the unit group loop. Take it out of there.

You also have a unit group leak, which this modification fixes. Somewhat. There's still a small leak, no matter what you do.

Trigger:
  • Battle Timer
    • Events
      • Time - BattleTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy TimerWindow
      • Player Group - Pick every player in InGamePlayers and do (Actions)
        • Loop - Actions
          • Set TmpPoint = (Random point in Arena <gen>)
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in Regions[(Player number of (Picked player))] owned by (Picked player)) and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to TmpPoint
          • Custom script: call RemoveLocation( udg_TmpPoint )
 

Komaqtion

You can change this now in User CP.
Reaction score
469
No, don't do what Virus says. ( It's besically the same as yours, just that his only works for "Player 1 (Red)" :p)

Your problem is that you're destroying "TmpPoint", inside the loop, meaning that after the loop has picked one unit, it'll destroy the point, rendering it useless for the other units in the group ;)

So, simply move this line, outside the unit.group loop:
Trigger:
  • Custom script: call RemoveLocation( udg_TmpPoint )


And you should be fine ;)

Note:
Code:
Unit Group - Pick every unit in [COLOR="Red"](Units in Regions[(Player number of (Picked player))] owned by (Picked player))[/COLOR] and do (Actions)

Leaks ;)
 
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