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

Triggering Casting Time

Status
Not open for further replies.
Level 13
Joined
Nov 22, 2006
Messages
1,260
What is the best way to trigger casting time (in abilities)? I know I can just add casting time in the Object Editor, but this time I need to trigger it. Is there a good way, without any stupid consequences?

Remember some stuff about casting time, unlike channeling time...

...it is the time that passes before the spell effect happens
...during casting time the caster cannot move
...during casting time other abilities are not disabled

Tell me if I missed something.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Set the speed of the hero in a real variable, then Unit - Set Movement Speed of (Triggering unit) to 0 and create a timer that expires in X seconds (the ones you want the casting time to last). Run another timer (repeating one) or a periodic event with the strings "|", that depict the casting time. Nothing more, nothing less.

I believe that in your solution the unit will still be able to turn (I forgot to mention that the unit has to be paused, but without disabling other abilities). Also, I totally don't understand the second part about the periodic timer/trigger.

Should I just set the movement speed to 0 and make a periodic trigger that will keep the unit from turning?
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
this will stop the unit to move,you might want to add some conditions....,if you would like unit to attack but not move,(distance greater than attack range equal to true than - stop unit)

  • run action stop ordered unit
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(smart))
          • (Issued order) Equal to (Order(move))
          • (Issued order) Equal to (Order(patrol))
          • (Issued order) Equal to (Order(attack))
    • Actions
      • Set ORDERED_UNIT = (Ordered unit)
      • Countdown Timer - TIMER as a One-shot timer that will expire in 0.00 seconds

  • stop ordered unit
    • Events
      • Time - TIMER expires
    • Conditions
    • Actions
      • Unit - Order ORDERED_UNIT to Stop
      • set ORDERED_UNIT = No unit

you need to wait "0" seconds so your warcraft cant crash

not sure what did you want abut the casting time but i think this could help if your uni does not move

create a dummy unit and add countdown timer <X> sec,when dummy unit dies,set your unit group = units within 0.01 range of dying unit matching condition matching unit is alive equal to true

with would men than random unit from unit group is the targeted one
......
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
@ALiEN95
I already know how to make the unit stop, but I don't know how to make it not able to turn. Well, I'm asking for a non-periodic solution.

@Child_0f_Bodom
Actually, that might just work fine. I completely forgot that you can set the channel not to disable other abilities.

The reason why I need triggered casting time is because I needed to set the casting time from a certain value to 0 (instant) through triggers. This way I can just have all casting times as channel, and just remove them when I need an instant cast.

Thanks, all three of you. (Sorry Bodom, I need to spread first :p)
 
Status
Not open for further replies.
Top