• 🏆 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] Unit Orders

Status
Not open for further replies.
Level 4
Joined
Aug 22, 2008
Messages
100
Hello there. Im currently working on a Bossfighting system for my map.

My question is this:
Is it possible to save a unit order in a variable?

Example: I want my "Super Tauren" boss to use war stomp. I have to use
  • Unit - Order BOSSBoss to Orc Tauren Chieftain - War Stomp
What I want to do is this:
  • Unit - Order BOSSBoss to BossAbility[1]
or something similar.

Is this possible in GUI?
If not. Is it possible with custom scripts?

I never bothered to learn vJASS and I dont really have the motivation to do it now so if this is impossible Il just hardcode it.
 
Level 6
Joined
Aug 28, 2015
Messages
213
I don't think there is something in GUI for order from a variable but you can use custom script for
this. I just transfered gui to text and changed a bit to get this:
  • init
    • Ereignisse
      • Zeit - Elapsed game time is 0.30 seconds
    • Bedingungen
    • Aktionen
      • Set BOSSboss = Tauren-Häuptling 0000 <gen>
      • Set order_string[1] = stomp
  • order
    • Ereignisse
      • Spieler - Spieler 1 (Rot) skips a cinematic sequence
    • Bedingungen
    • Aktionen
      • Custom script: call IssueImmediateOrderBJ( udg_BOSSboss, udg_order_string[1] )
sorry my editor is still german but i hope you understand everything.
 
Level 8
Joined
Jan 28, 2016
Messages
486
Just to add to Apsyll's post, it would be slightly more efficient to use the native IssueImmediateOrder as opposed to the BJ function.
JASS:
native IssueImmediateOrder takes unit whichUnit, string order returns boolean
JASS:
function IssueImmediateOrderBJ takes unit whichUnit, string order returns boolean
    return IssueImmediateOrder( whichUnit, order )
endfunction

There's also the native IssueImmediateOrderById which uses the order's ID instead of it's string. To find the ID of an order, there's this: Order Ids.
JASS:
native IssueImmediateOrderById takes unit whichUnit, integer order returns boolean
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
  • Untitled Trigger 002
    • Events
    • Conditions
    • Actions
      • -------- --------
      • -------- onInit --------
      • Set AbilityOrderString = stomp
      • -------- ^ String Type Variable = <orderstring> ( ex: stomp, channel, move, attack, roar. ) --------
      • -------- --------
      • -------- onCast --------
      • Custom script: call IssueImmediateOrder( udg_UNIT, udg_AbilityOrderString )
      • -------- ^ Ordering the unit to cast that stored String Order variable. --------
      • -------- --------
^ Yes it is possible to store a unit's ability order via string variable.
 
Level 4
Joined
Aug 22, 2008
Messages
100
Thank you guys. I was up to 6 am last night and actually managed to fix it. But I still dont understand the difference between IssueImediateOrderBJ and IssueImediateOrder. Is there a difference or is the second one simply more effective?

I think this is solved now. Thanks all.
 
Status
Not open for further replies.
Top