• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Orders

Status
Not open for further replies.

Rei

Rei

Level 2
Joined
May 26, 2015
Messages
9
So, I had this idea I liked, in which a hero would actually take the form of two units. The second one would not be able to be selected, so the player would play using just one of em'.

Here's the tricky part. I would like the second unit to copy every spell and action done by the "main" unit.

However my map has spells not based on the usual spell order you can give with the GUI. I'm not sure it is likely to achieve what I want in GUI, or even JASS(although I'm a jass newt, so I have no idea what i am talking about), but if anyone knows of a way to give orders not included in the default GUI menu, please do tell.

Appreciate it.
 
Level 14
Joined
Jul 26, 2008
Messages
1,009
Code:
function Trig_GetSkillID_Actions takes nothing returns nothing
    call BJDebugMsg( I2S( GetIssuedOrderId() ) )
endfunction

//===========================================================================
function InitTrig_GetSkillID takes nothing returns nothing
    set gg_trg_GetSkillID = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_GetSkillID, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
    call TriggerAddAction( gg_trg_GetSkillID, function Trig_GetSkillID_Actions )
endfunction

Something like this.

It will tell you the Order ID # that you need to use instead of the OrderId string.

Not all Orders have strings tied to them, but they all have numbers. If you get the number, then you can use that instead.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
You mean like I have a tank and the gun on the top is a separate unit so it can rotate and shoot separately?

In that case, you have to have a 0.03 loop that updates the location (using SetUnitX() and SetUnitY()) of the gun to the exact location of the tank (might include offset as well).

After that, you use a few cases that can be optimized by an order tracking system to keep old orders of the tank and redirect the new order to the gun.
(I already mentioned two systems that I've never seen and want to make -_-)

But anyway, when your unit recieves an order, you give an order (by id) to the other unit.
That id is directly gotten from the issued order.
You need multiple triggers to handle all kinds of orders.

  • ImmediateOrder redirect
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Paladin
    • Actions
      • Set Unit = (Triggering unit)
      • Custom script: call IssueImmediateOrderById(udg_Unit, GetIssuedOrderId())
  • TargetOrder redirect
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Paladin
    • Actions
      • Set Unit = (Triggering unit)
      • Custom script: call IssueTargetOrderById(udg_Unit, GetIssuedOrderId(), GetOrderTarget())
  • PointOrder redirect
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Paladin
    • Actions
      • Set Unit = (Triggering unit)
      • Custom script: call IssuePointOrderById(udg_Unit, GetIssuedOrderId(), GetOrderPointX(), GetOrderPointY())
I used Paladin as the unit type of the unit that has a dummy unit on it.
I use a global variable called Unit (which is called udg_Unit in JASS).
You have to set that variable to the unit that has to copy the order.
 

Rei

Rei

Level 2
Joined
May 26, 2015
Messages
9
Wow. Will look into all of these, at first glance seems like that's gravitating towards what I need, although might need to get familiar with jass. Expect a feedack post in the near future, and thanks a lot guys.

Edit: Very well, currently testing the code you gave me, Titan. There must be a way to input that order number into another arbitrary unit? As in, get the number, and tell another unit: target (same target as primary unit) and carry out the order.

Because that is exactly what I thought Wietlol's triggers were supposed to do, but i must be doing something wrong, since

  • Gemini
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Triggering unit) Equal to Sophiana Sil 0058 <gen>
    • Actions
      • Set Unit = Sophiana Sil 0072 <gen>
      • Custom script: Custom script: call IssueImmediateOrderById(udg_Unit, GetIssuedOrderId())
where 0058 is the "primary unit" and 0072 "follows", but the trigger bugs out on me, giving me an error message along the lines of:

Expect a code statement (line 270),

said line being: Custom script: call IssueImmediateOrderById(udg_Unit, GetIssuedOrderId())


Thanking you in advance~
 
Last edited:
Status
Not open for further replies.
Top