• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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])
 
Level 6
Joined
Dec 8, 2009
Messages
179
wow great and thank you very much for those solutions.

I got this problem now since several weeks and that was the reason why I stopped my project cause it really pissed m off not getting the trigger to do what I want.

Again thanks. (+rep to all of you)
 
Status
Not open for further replies.
Top