Help with Unit orders

Status
Not open for further replies.
Level 7
Joined
Dec 8, 2009
Messages
179
Hello dear hive members,

I got a really big problem with Unit orders.
It surely sounds stupid but is the following trigger possible in any way.

- Event - a unit receives a "patrol" or "attack-move" Order
- Actions - Order Unit to patrol or attack move to location with polar offset

I know this kind of trigger creates an infinite loop of unit orders and finally crashes wc3 in-game.

It would be really really great if anyone knows how to change the trigger that it won't crash wc3.

Greetz Grantuu
 
Hello dear hive members,

I got a really big problem with Unit orders.
It surely sounds stupid but is the following trigger possible in any way.

- Event - a unit receives a "patrol" or "attack-move" Order
- Actions - Order Unit to patrol or attack move to location with polar offset

I know this kind of trigger creates an infinite loop of unit orders and finally crashes wc3 in-game.

It would be really really great if anyone knows how to change the trigger that it won't crash wc3.

Greetz Grantuu

Don't execute it immediately. Instead, use some form of wait (preferably a timer, real variable, or something instead of Wait, I just plaind don't like that command) for about 0.01 seconds, then issue the order. That's how I did it for Creeping Madness (an ability which would reverse all of a buffed unit's controls). You also have to turn off the trigger and turn it back on while this is going on, IIRC.

Probablem solved :)
 
Last edited:
Would this help?
  • Trigger 1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hash = (Last created hashtable)
  • Trigger 2
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Load 0 of (Key (Triggering unit)) from Hash) Equal to False
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(patrol))
          • And - All (Conditions) are true
            • Conditions
              • (Issued order) Equal to (Order(attack))
              • (Target unit of issued order) Equal to No unit
    • Actions
      • Hashtable - Save True as 0 of (Key (Triggering unit)) in Hash
      • Set TempPoints[0] = (Target point of issued order)
      • Set TempPoints[1] = (TempPoints[0] offset by 600.00 towards 270.00 degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(patrol))
        • Then - Actions
          • Unit - Order (Triggering unit) to Patrol To TempPoints[1]
        • Else - Actions
          • Unit - Order (Triggering unit) to Attack-Move To TempPoints[1]
      • Custom script: call RemoveLocation(udg_TempPoints[0])
      • Custom script: call RemoveLocation(udg_TempPoints[1])
 
Status
Not open for further replies.
Back
Top