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

[Trigger] I can't get 'IssueTargetOrderById' to work.

Status
Not open for further replies.
Level 4
Joined
Nov 20, 2006
Messages
71
  • Far Sight
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Far Sight
    • Actions
      • Set FarSightUnit = (Triggering unit)
      • Set Temp_Pt = (Position of FarSightUnit)
      • Unit - Create 1 Shaman for Player 1 (Red) at Temp_Pt facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Set Dummy = (Last created unit)
      • Custom script: call UnitAddAbility(udg_Dummy,'A002')
      • Custom script: call IssueTargetOrderById(udg_Dummy,'A002',udg_FarSightUnit)
      • Custom script: call RemoveLocation(udg_Temp_Pt)
I am experimenting with a way to get a dummy unit to cast a item skill. In this case the unit would be casting a healing salve on the Farseer after the Farseer casts Far Sight. The dummy unit (shaman) spawns and receives the skill, but it doesn't follow the order to cast the healing salve. I can't figure out what is causing the problem.

Edit: Solved. The issue was that there was no order ID when IssueTargetOrderByID was called. In this case, A002 is an ability ID, not an order ID. To find an order ID for an ability you can use edo494's method below.
 
Last edited:
because that changes it into an integer which is why it won't give errors...

I believe the ID here is the order ID not the abilityID because 'A002' is abilityID of your spell and not the orderID of the healing salve's order string... there is a native for converting an orderstring (which you can see at the ability "Order string - use") into its orderID equivalent... there's also a resource/thread here somewhere that lists all orderIDs...

so since 'A002' is not the orderID for healing salve, there's now way that your unit will cast healing salve...
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
Change your 'A002' to 1093677104.
Remember, that is in its raw ID, therefore, no single quote is needed to enclose the raw ID.

its rawcode of ability not orderId

the orderId of normal Healing Salve effect is 852008

Ive used this piece of code to get it:

  • test
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Custom script: call BJDebugMsg(I2S(GetIssuedOrderId()))
 
Level 4
Joined
Nov 20, 2006
Messages
71
its rawcode of ability not orderId

the orderId of normal Healing Salve effect is 852008

Ive used this piece of code to get it:

  • test
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Custom script: call BJDebugMsg(I2S(GetIssuedOrderId()))
Thanks, I was able to get it work using this.
 
Status
Not open for further replies.
Top