• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] Starts casting an ability vs Finishes casting an ability

Level 31
Joined
Dec 3, 2020
Messages
1,237
I think this kinda stupid but just to make sure:
Starts casting an ability triggers before the unit's "spell" animation is over, correct?
And finishes casting an ability triggers after the unit's "spell" animation is over?
So if the unit dies before it finishes its animation, the trigger won't run?

For an ability such as Faerie Fire, it's somewhat clear to me, but what about Immolation for example? Is there any difference there?

Edit #1:
Just replaced "Starts casting an ability" with "Finishes casting an ability" for a trigger which uses the Faerie Fire ability and it stopped working.
The issue I had before is that the Firebolt was instantly cast, 0.01 seconds into the beginning of the spell cast animation. I'd like it there to be a slight delay and I think using "wait 0.50 seconds" is bad since I need the trigger to be global cause there can be dozens of units on the map with that spell at the same time.
 
Last edited:
You might want to use "Starts the effects of an ability" instead as your event. Starts casting as the name implies is the moment the caster begins "channelling" to cast the ability. Finished is once everything has finished and the mana cost and cool down has started.
 
Begins Casting:
This happens when the Cast - Point animation begins playing but before any costs have been paid.
It's useful for cancelling your ability early. Do not put any important effects here (ie: damage, dummy units, etc).

Starts Effect:
This is what you'll be using the majority of the time. It guarantees that the effects of the ability have launched (but costs may have not been paid yet).

Finishes Casting:
This happens last and ONLY if you allow the full Cast - Backswing animation to play out. This can be unsafe to use since Players can simply animation-cancel and prevent it from ever firing. I'd avoid this unless you're certain it's guaranteed to work.

Stops Casting:
Similar to Finishes Casting, but it's guaranteed to happen and actually runs prior to Finishes Casting (same step though). It will occur early if the ability is cancelled (ie: new Order, Stun, Silence).

If I recall correctly, Channeling abilities fire all of these Events since they skip animations (at least Backswing). Also, I think the "Finishes Casting" event is useful in this scenario to detect a "full channel". Lastly, the "Begins Channeling" event may have some timing related properties that make it useful here, and I believe it occurs around the same step as "Starts Effect".
--
Immolation uses Orders and doesn't fire any of these Events.

Waits are fine as long as you use them properly.

For the delay you could add a Casting Time to your Firebolt ability. That would be precise and remove the need for a Wait in your trigger.
 
Last edited:
Thanks guys and thanks Uncle (common Uncle W).
About "Finishes Casting", it could be very useful using it for the AI ngl, since they always let the animation play out until the end.

"For the delay you could add a Casting Time to your Firebolt ability. That would be precise and remove the need for a Wait in your trigger."

Yes, but no! Since the unit is simply "afk" while waiting and then when it begins casting the spell, within 0.01 seconds the Firebolt will be fired.
Unless... I make the warlocks' spell animation play through the trigger? But I think you cannot simply do that while the unit is waiting to cast a spell.
 
Thanks guys and thanks Uncle (common Uncle W).
About "Finishes Casting", it could be very useful using it for the AI ngl, since they always let the animation play out until the end.
If you were to Stun that AI unit and interrupt the animation then it will not fire the "Finshes Casting" Event. You'll notice this trend, it's not a great Event to rely on since it's not 100% guaranteed in most cases.

"For the delay you could add a Casting Time to your Firebolt ability. That would be precise and remove the need for a Wait in your trigger."

Yes, but no! Since the unit is simply "afk" while waiting and then when it begins casting the spell, within 0.01 seconds the Firebolt will be fired.
Unless... I make the warlocks' spell animation play through the trigger? But I think you cannot simply do that while the unit is waiting to cast a spell.
I was thinking that you were using a Dummy unit to cast the Fireball ability for some reason.

Anyway, you can control animations with triggers, but often you have to wait a frame to control the animation since you're fighting with the animation associated with the ability itself. A Wait action guarantees that at least 1 frame will pass so that's all you need. I have a system showcasing this idea:
 
In this case just use Animation - Cast backswing which determines the delay between an animation starting a spell and it actually being cast (like the Paladin raising his hammer and opening his book). So just use the "unit starts the effects of an ability" for your firebolt and make the dummy cast it as normal with your original unit's backswing set to an appropriate value.
 
Ok ok. I think the issue was that the dummy had its animaiton - cast backswing set to 0 (just realized this xD), so it insta cast the spells.
I will make a few different dummy units and each one will have different cast backswing.

Thank you!

@Footman16 what about Animation - Cast Point?
Cast - Point controls the delay before the spell is cast. The spell animation plays during this time.
Cast - Backswing controls how long the remainder of the spell animation continues afterwards, which can be cancelled.

For example, if you had a 1.50 second long spell "punch" animation, and a Caster with a Cast Point of 0.50 and a Cast Backswing of 1.00:

1. A 3rd of the punch animation (0.50s) would have to play before the effects of the ability would start (fireball launches, mana is spent, cooldown begins).
This can be cancelled, which will end the attempt to cast the spell and skip step #2.

2. The rest of the punch animation would play over the Backswing period (1.00s).
This portion is cancellable (animation-cancelling) without any consequences.
It balances AI a bit since they don't abuse this mechanic.


So use a unique Dummy unit and set it's Cast Point to the amount of time needed before the effects of the ability start. This is your Wait period.
Then set it's Cast Backswing to an amount equal to the remainder of the spell animation.
 
Last edited:
Back
Top