• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Help with Unit orders

Status
Not open for further replies.
Level 6
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
 
Level 11
Joined
Feb 11, 2010
Messages
199
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:
Level 20
Joined
Jul 6, 2009
Messages
1,885
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.
Top