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

Is it possible to order a unit to channel?

Status
Not open for further replies.
Level 19
Joined
Jul 2, 2011
Messages
2,162
I'm not sure about the other problem, but you can order a unit to both channel and use channel animation.

create a trig which

generic event unit is given an order
unit is a hero
game message, order of unit issued order.

this will show you what string to used to activate the channel of ability you can't.

then look through animations and orders in trig
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Because you don't necessarily order the unit to use Channel.
You can change the Base Order Id (which is a field per level) and you can set your preferred order string in there.
When you want to use Channel in GUI, you have to use an order string that is allowed to be used by the given targeting type.
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
I could provide a solution for you when I get home but for now I'll have to rely on memory.

in my previous suggestion,.change the event to: generic unit giving an ordered with no target

which will give you the correct order string of channel(which by the way not every unit can do.

then order your unit to do that string name

issue order to unit(string.name)
 
Level 7
Joined
Nov 19, 2015
Messages
283
Use this to find a spells order ID
  • Order ID
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • Custom script: call BJDebugMsg(I2S(GetIssuedOrderId()))
Use this to order them to cast.

Target a unit
call IssueTargetOrderById(udg_<cast unit>,<orderID>,udg_<target unit>)

Target a point
IssuePointOrderById(udg_<unit>,<orderID>,GetLocationX(udg_<point>),GetLocationY(udg_<point>))
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
"Unit - Move BS_caster instantly to BS_tempLoc, facing BS_targetLoc
Unit - Order BS_caster to Attack BS_target"
there you go.

You could use SetUnitX() and SetUnitY() as custom scripts to replace the "Move unit" to avoid him interrupting his spell cast and you can use this script to delay the order by 0 seconds (which still happens after the spell goes on cooldown).

About how to use SetUnitX() and SetUnitY() in GUI and use variables in custom scripts, there should be quite a few tutorials here in the hive.
 
Level 12
Joined
Jan 13, 2008
Messages
559
I dont get it..I put a timer of wait 0.01 sec in the beginning of the trigger and the spell works totally different..he jumps not at the unit but in the total different direction o_O Ok but I fixed it now by moving the wait shortly before the move unit. I know wait 0.01 sec is not the best solution but i take it
 
Status
Not open for further replies.
Top