• 🏆 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!

[Solved] Save unit's order and later issue it

Status
Not open for further replies.
Level 4
Joined
Feb 9, 2010
Messages
48
Greetings,

I'm trying to create a trigger that would do the following:

1) Save unit's current order
2) Issue unit to activate mana shield
3) Load saved order and make the unit execute it

So for example:
Unit has an order to attack-move to some location. Trigger occurs, unit activates the mana shield and proceeds to attack-move.

The question is how to make this work. I believe there is 'order' variable, which would allow me to save the order, but I don't know how to make the unit do the saved order.
 
You use one of this depending one the Type of Order (Ground, Unit, No target, built ...)
  • Custom script:call IssueTargetOrderBJ( udg_Unit, udg_Order, udg_Target )
  • Custom script:call IssuePointOrderLocBJ( udg_Unit, udg_Order, udg_Loc )
  • Custom script:call IssueImmediateOrderBJ( udg_Unit, udg_Order )
  • Custom script:call IssueTargetDestructableOrder( udg_Unit, udg_Order, udg_Tree )
  • Custom script:call IssueTargetItemOrder( udg_Unit, udg_Order, udg_Item )
  • Custom script: call IssueTrainOrderByIdBJ( udg_Unit, udg_Order )
udg_Order is a String.
 
Level 11
Joined
May 16, 2016
Messages
730
Greetings,

I'm trying to create a trigger that would do the following:

1) Save unit's current order
2) Issue unit to activate mana shield
3) Load saved order and make the unit execute it

So for example:
Unit has an order to attack-move to some location. Trigger occurs, unit activates the mana shield and proceeds to attack-move.

The question is how to make this work. I believe there is 'order' variable, which would allow me to save the order, but I don't know how to make the unit do the saved order.
Here is my flawless template for you. Priest would buff itself before engaging your order.
Available orders: move (point and unit), patrol (point and unit), attack (point and unit), smart (point and unit).

According to your request this template meets all your requirements. + I've made some kind of AI here: If saved current order was attack unit and target of order is dead or invisible, then the priest just move on the point of unit.
 

Attachments

  • ORDER AFTER USING ABILITY (2).w3x
    17.2 KB · Views: 51
Orders are integer though... Not all orders have a string equivalent, eg Want of Illusion.
Indeed, Orders are at the End ID's (Numbers), but you don't get the ID with GUI.
The functions i Posted are from the Blizzard-J API, which don't contain ID-Orders except for Building, Techs and Training.
 
Status
Not open for further replies.
Top