• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Issuing orders using order IDs

Status
Not open for further replies.
Level 13
Joined
Jan 2, 2016
Messages
978
Hidden Order Ids:

851971 (smart): This is a point or object targeted order that is like a right click.
852000 (skillmenu): This is an order with no target that opens the skill menu of heroes. If it is issued for a normal unit with triggers it will black out the command card for this unit, the command card will revert to normal after reselecting the unit.
851994 (buildmenu): This is an order with no target that opens up the build menu of a unit that can build structures.
852002 to 852007 (moveslot): These are item targeted orders that move the target item to a certain inventory slot of the ordered hero. The id 852002 will move it to slot 1, the id 852003 will move it to slot 2 and so on.
852008 to 852013 (useslot): These are orders that will make the ordered hero use the item in a certain inventory slot. If it's an order with no target or object or point targeted depends on the type of item. The id 852008 will use the item in slot 1, the id 852009 will use the item in slot 2 and so on.
851976 (cancel): This is an order with no target that is like a click on a cancel button. We used to be able to catch cancel clicks with this id back then but this id doesn't seem to work any more.
851973 (stunned): This order is issued to units that get stunned by a spell, for example War Stomp (AOws). This is probably a hold position + hold fire order. The ordered unit will be unable to move and attack.
When I saw this, I started wondering if this "skillmenu" can replace the "ward" classification (by ordering the unit to open the skillmenu when it's being selected), but I really have no idea how to order the unit to open skillmenu. I can't find this order in GUI and I couldn't find how to issue orders to units via custom scripts, using the orders' IDs (I couldn't find how to issue orders via orders' string either). Can anyone post a trigger how to issue an order to a unit via custom scripts?
 
Level 13
Joined
Jan 2, 2016
Messages
978
Thanks :)
But somewhy it doesn't work as I expected... do I need to add anything else to this trigger?
  • test
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Temp_Unit is selected by Player 1 (Red)) Equal to True
    • Actions
      • Custom script: call IssueImmediateOrderById(udg_Temp_Unit, 852000)
 
Level 13
Joined
Jan 2, 2016
Messages
978
In the initialization.
I made a test map, just for this testing purpose.. Wanted to make sure it works before adding it to my map.
I added a message to all players when the trigger runs, and it does run, just the order isn't issued, or it doesn't work properly.
 
Level 12
Joined
Mar 13, 2020
Messages
421
I tried adding all kind of different events.
I removed all the conditions.
I Set Temp_Unit in the begining of this trigger.

Still doesn't work.

After 7 Years i found the Solution!




  • Autocast Disable
    • Events
      • Game - Button for ability Schwarzer Pfeil (Test) and order Neutral Dark Ranger - Activate Black Arrow pressed.
    • Conditions
    • Actions
      • Wait 0.00 seconds
      • Set VariableSet OrderedUnit = Archer 0019 <gen>
      • Game - Display to (All players) the text: (Name of OrderedUnit)
      • Custom script: call IssueImmediateOrderById(udg_OrderedUnit,852579)


it didnt worked for me either... and then i put a 0 second wait before and it worked...

If you Order a Unit After a Order for example an Autocast you Need a 0 second wait
 
Level 21
Joined
Feb 27, 2019
Messages
627
WereElfs trigger works in the latest patch at least.

Timers are faster than 0.00 seconds waits, so something like this would deactivate black arrows smoother.
  • Arrow 1
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(blackarrowon))
    • Actions
      • Set VariableSet ArrowUnit = (Triggering unit)
      • Countdown Timer - Start ArrowTimer as a One-shot timer that will expire in 0.00 seconds
  • Arrow 2
    • Events
      • Time - ArrowTimer expires
    • Conditions
    • Actions
      • Custom script: call IssueImmediateOrderById(udg_ArrowUnit, 852579)
Issuing orders interrupts a units orders. If the order itself naturally doesnt interrupt orders then you can cause the unit to move on to its next order by temporarily disabling the ability. This way the remaining orders are still executed.
  • Arrow 1
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(blackarrowon))
    • Actions
      • Set VariableSet ArrowPlayer = (Triggering player)
      • Player - Disable Black Arrow for ArrowPlayer
      • Countdown Timer - Start ArrowTimer as a One-shot timer that will expire in 0.00 seconds
  • Arrow 2
    • Events
      • Time - ArrowTimer expires
    • Conditions
    • Actions
      • Player - Enable Black Arrow for ArrowPlayer
 
Status
Not open for further replies.
Top