• 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.

Function called: "Unit finishes an order"?

Status
Not open for further replies.
Level 4
Joined
Sep 6, 2010
Messages
100
Is there a condition/event function called "Unit finishes an order"? Or similar?
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Basically what you are asking is that:

1. All orders must be stored when they are given.
2. When the order of a unit changes, then detect it and still keep the previous order stored somewhere(temporarily)

I have somewhat done the first part(only stores orders; doesn't check when the order is finished)
 
Level 4
Joined
Sep 6, 2010
Messages
100
well if we only talk about the move order its easy.

1. create a empty trigger and add the action kill triggering unit no event.
2. create another trigger with the event unit is issued tatgeting a point and the action trigger add unit comes with in range of point of issued order.

and dont forget to fix leaks
Thanks

PS: Is there a function that detects whether a unit has stopped? As in, stopped moving?
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
There are events for gaining an order +event responses as well as a function to get a unit's current order.

So on gain event, save the issued order, then periodically check if the unit's order is reset, reset the saved order too. Furthermore, the gain event can also be the point in time a previous order is overwritten, therefore check the previously saved order. Exceptions are instant parallel orders like learning an ability since those do not cancel anything.
 
Level 4
Joined
Sep 6, 2010
Messages
100
If a unit does absolutely nothing, but stands still, it's order is most likely (null)
Oh... ok, thanks.

Thanks for your help guys.

EDIT: When I try the order comparison in the condition category, I pick the "Convert order to string" and I put in the string "null", but when the unit stops doing anything (just stands there) he doesn't die!
Fixed.
 
Status
Not open for further replies.
Top