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

Check if unit is channeling

Status
Not open for further replies.
Level 9
Joined
Aug 7, 2009
Messages
380
Hello there,
I've been back for around a day after around 1 year of leaving warcraft now. And yet, i wanted to make something as i got addicted again :)
Well, the problem is, i'm making a channeling spell, but i need to know if he's channeling or not and then do some actions. How can i do that perfectly
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
stun actually gives unit special order that seems to be faking hold position + stop until the buff is lost

Yes, you can just loop every lets say 0.05 - 0.1 secs(that should be enough) and check if units order is the same as in the last cycle and is not something like smart or move, and if it is, it is channeling.
The other way but similar is when unit starts the effect of ability, set some variable to current order, and then again periodically(0.05 - 0.1 secs) if the order is the same as the one in variable, the unit is still channeling
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
^ No you don't need to loop that, you would need a Event - Unit begins channeling of an Ability

Edit: Edo beat ^^.

EDIT2:

You need two triggers: one for the Execution and Loop, the execution will be the event of - Unit Starts the effect of abil or begins channel abil, then the looping trigger will check if the unit's current order is still ( Order Id )
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Current order of WoS_Caster[WoS]) Not equal to (Order(flamestrike))
    • Then - Actions
      • Trigger - Turn off (This trigger)
    • Else - Actions
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
You just need to attach the data to the unit so you won't lose it when the event fires. A unit indexer could also be used.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
I know, I wasn't talking about indexing, I was talking about the alternative method that doesn't use a periodic check.
 
Status
Not open for further replies.
Top