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

Issue Order Custom Spell

Status
Not open for further replies.
Level 5
Joined
Jun 30, 2004
Messages
170
Um... IssueTargetOrder.

JASS:
native IssueTargetOrder takes unit whichUnit, string order, widget targetWidget returns boolean
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Custom script: call IssueTargetOrder(unit, "order", target)
In place of unit, use the unit you want.

Triggering unit: GetTriggerUnit()
Picked unit: GetEnumUnit()
Last created unit: bj_lastCreatedUnit

Or if it is avariable then type the variable name and add udg_ to the variable's name. Like udg_tempUnit

For the order, type the order you want. "attack" or "smart" or whatever you want.
 
Order ID refers to an integer, while "order" refers to string.
If you want to use ID (Edit menu -> Display values as Raw object Data), the function becomes IssueTargetOrderById(), where in the place of the order an integer is set, e.g. 852676, unlike IssueTargetOrder(), where you place a string, e.g. "attack".

If you want to check how each unit event response is translated in Jass, create a trigger with the action "Unit - Kill unit". Pick the unit type you want (E.g. Damage source) and convert the trigger to Custom script). There, you have the Jass counterpart.
 
Each spell has a raw id. You can use this program (contains most of the game's orders): http://www.wc3c.net/showthread.php?t=85864 to obtain the ID of the ability (we prefer the ID, because not every order in-game has a string representation, for example the ability Item Illusions), causing IssueTargetOrder() to sometimes fail.
Additionally, you can use this trigger:
  • Tri
  • 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()))
Then, say the ID is 852274.
  • Set Target = (Target unit of ability being cast)
  • Unit - Create 1 Dummy for (Triggering player) at Point1 facing Default building facing degrees
  • Custom script: call IssueTargetOrderById (GetLastCreatedUnit(), 852274, udg_Target)
If Maker corrects me for the "GetLastCreatedUnit()", I haven't tested yet, whether bj_lastCreatedUnit can still refer to a GUI-created unit.
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
well the base ability is blood lust.
  • Fury
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Level of Fury for (Killing unit)) Greater than 0
    • Actions
      • Set Fury_Index = (Fury_Index + 1)
      • Set Fury_Point[Fury_Index] = (Position of (Killing unit))
      • Unit - Create 1 Fury Dummy for (Owner of (Killing unit)) at Fury_Point[Fury_Index] facing Default building facing degrees
      • Set Fury_Dummy[Fury_Index] = (Last created unit)
      • Unit - Hide (Last created unit)
      • Custom script: call IssueTargetOrderById((udg_Fury_Dummy[(udg_Fury_Index)]),852101,GetKillingUnit())
      • Custom script: call RemoveLocation(udg_Fury_Point[(udg_Fury_Index)])
and i changed the script using the variable and it still didnt work
 
Level 17
Joined
Jun 17, 2010
Messages
2,275
That is the exact trigger, and ill try the footmen thing..

i didnt work, this is the damage trigger that gives the unit its kills
  • Swift Assault
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Swift Assault
        • Then - Actions
          • Set SA_Index = (SA_Index + 1)
          • Set SA_Point[SA_Index] = (Position of (Target unit of ability being cast))
          • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing 100.00 damage of attack type Pierce and damage type Normal
          • Unit - Move (Triggering unit) instantly to SA_Point[SA_Index]
          • Set SA_Index = (SA_Index - 1)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_SA_Point[(udg_SA_Index)])
I know its not this because when i used melee attack, it still didnt work...
 
  • Fury
  • Events
    • Unit - A unit dies
  • Conditions
    • (Level of Fury for (Killing unit)) Greater than 0
  • Actions
    • Set Fury_Killer = (Killing unit)
    • Set Fury_Point = (Position of Fury_Killer)
    • Unit - Create 1 Fury Dummy for (Owner of Fury_Killer) at Fury_Point facing Default building facing degrees
    • Set Fury_Dummy = (Last created unit)
    • Unit - Add a 2.00 seconds generic expiration timer to Furry_Dummy
    • Custom script: call IssueTargetOrder (udg_Fury_Dummy, "bloodlust", udg_Fury_Killer)
    • Custom script: call RemoveLocation (udg_Fury_Point)
So this won't work?
 
Status
Not open for further replies.
Top