[Trigger] Why it causes the game to CRASH ?

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
Can someone tell me WHY does this trigger causes the game to CRASH ???
  • Follower
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Ally with shared vision
      • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Ally with shared vision
  • Leader System
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set Leader = (Triggering unit)
      • Set Follower = (Units within 600.00 of (Position of Leader) matching (((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True))
      • Set MovingPoint = (Target point of issued order)
      • Unit Group - Pick every unit in Follower and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Move To MovingPoint
          • Custom script: call RemoveLocation(udg_MovingPoint)
      • Custom script: call DestroyGroup(udg_Follower)
I've made 2 triggers, both are connected somehow for a Leader System (leader moves...allies follow...)
WHAT causes the game to CRASH ?
I've run some few tests, the result is same
 
Level 8
Joined
Oct 3, 2008
Messages
367
It's elementary, good sir.

The second trigger has an event that causes it to fire when a unit is issued an order targetting a point, yes?

In that very trigger, an action orders a group of units to issue an order targetting a point.

And because of this, the trigger fires again. It then issues another order. The trigger fires again, ad infinitum. At this point WC3 suddenly shouts "WHAT HAVE I DONE?!" and explodes.
 
It's elementary, good sir.

The second trigger has an event that causes it to fire when a unit is issued an order targetting a point, yes?

In that very trigger, an action orders a group of units to issue an order targetting a point.

And because of this, the trigger fires again. It then issues another order. The trigger fires again, ad infinitum. At this point WC3 suddenly shouts "WHAT HAVE I DONE?!" and explodes.

Don't you see the conditions? It has to be hero, and i think he has only one hero there, if not you are right.
 
Try this;

  • Leader System
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set Leader = (Triggering unit)
      • Set Follower = (Units within 600.00 of (Position of Leader) matching (((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True))
      • Set MovingPoint = (Target point of issued order)
      • Trigger - Turn off (This trigger)
      • Unit Group - Pick every unit in Follower and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Move To MovingPoint
      • Trigger - Turn on (This trigger)
      • Custom script: call RemoveLocation(udg_MovingPoint)
      • Custom script: call DestroyGroup(udg_Follower)
You're also leaking a location btw (Position of Leader), though that's a different issue.
 
  • Leader System
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set Leader = (Triggering unit)
      • Set Follower = (Units within 600.00 of (Position of Leader) matching (((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True)) and (Matching unit) not equals to Leader
      • Set MovingPoint = (Target point of issued order)
      • Unit Group - Pick every unit in Follower and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Move To MovingPoint
          • Custom script: call DestroyGroup(udg_Follower)
      • Custom script: call RemoveLocation(udg_MovingPoint)
 
Status
Not open for further replies.
Top