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

Cooldowns

Status
Not open for further replies.
Level 6
Joined
Nov 3, 2005
Messages
103
I'm having trouble with them. Sometimes when I create my own custom spells with triggers they refuse to work automatically. I'm under the impression that it's because of the stats of the spell itself. I've tried using multiple different spells for the custom spell's base such as Storm Bolt and Chain Lightning, but all of them don't use the spell's cool down timer. I'm assuming it's because the spell only starts the timer the second the Storm Bolt is thrown. Is there a way to counter this and do it via triggers?
 
Level 5
Joined
Jan 27, 2014
Messages
164
> I create my own custom spells with triggers they refuse to work automatically
That's because you did something wrongly?
Usually happens when you use 'Unit - Move unit'. This will interrupt the unit's order and cancel off the cooldown.
Assuming that this is the issue, pausing/unpausing the unit before/after movement will solve the issue.

Then again, it's always a good practice to post the triggers of the said issue.
 
Level 7
Joined
Mar 6, 2006
Messages
282
@Water - doesn't EFFECT runs after those? it was BEGINS that run before those things AFAIK

Ye, n it sounds like he's using SPELL_CAST which is "Begins casting an ability" in GUI.

As someone else said, you can easily disrupt the cost of the ability (and cooldown) by having certain actions run on "begins cast" because it hasn't actually casted yet.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
No, but begins cast is even worse because it triggers when the unit begins its cast animation timer (see unit editor cast point). No real effect of the ability is done at this moment in time. On spell effect at least is before mana cost and cooldown or if you take 'Berserk' for example, the buff has not been applied to the unit yet, which is why removing it at this point is ineffective. End cast ensures that the ability is completely done. Of course with channeling abilities it's after the channel but elsewhere it's directly after spell effect (under normal circumstances, maybe you can lock the unit or something on spell effect).
 
End cast is hard to use too, if they use the spell, starts effect then hit cancel before the whole casting ends, STOP won't be triggered... while the spell's effect are already there, + mana cost and cooldown are also used already.

that is why most spells (if you look at the spells section) uses STARTS EFFECT OF AN ABILITY, and I personally used it for too long now, even for spells that moves the unit etc, and it never bugs...
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
End cast will definitely be triggered, with or without the effect, when the unit finishes or cancels casting. But I stand corrected since end cast is after the unit's backswing, which makes no difference if your abilities base on Channel. And yes, there are difficulties connected to it, like I said it can even trigger without having had an effect. I actually use a combination. You also have to pass event responses that end cast does not deliver. When writing the script for an ability, you initially know what it does, if it executes some of those bad actions on the caster that would block mana/cd/order. However, your function implementations may change, be deeply branched with if selections or even dynamically invoke code.
 
No, it doesn't... I tried it out, if I cancel after effect but before the end, it won't trigger End Cast... you need cancel casting for that...

Plus most if not all spells on the section uses STARTS EFFECT, and nothing seems to be bugged.

This.

And.
-Use "Begins casting an ability" if you want something to activate instantly. Before animations, damage calculation and so on.
Do NOT use this for anything else. If you are fast you can cancel the effect if the unit is ordered to do something else before the mentioned cast point has been reached.

-Use "Starts the effect of an ability" if you want something to activate when the unit's cast point (the point of the animation where it looks like the unit actually cast the spell), right after damage is calculated, when the special effect occurs.

I'm having trouble with them. Sometimes when I create my own custom spells with triggers they refuse to work automatically. I'm under the impression that it's because of the stats of the spell itself. I've tried using multiple different spells for the custom spell's base such as Storm Bolt and Chain Lightning, but all of them don't use the spell's cool down timer. I'm assuming it's because the spell only starts the timer the second the Storm Bolt is thrown. Is there a way to counter this and do it via triggers?

Do you mean you use the same base spell fx. Storm Bolt for multiple spells on the same hero?
 
Level 5
Joined
Jan 27, 2014
Messages
164
A unit begins casting ability:
Ability is casted right before the unit plays the casting animation. Mana and cooldown are not fired at this point. The ability can still be cancelled while the trigger effect is still there.

A unit starts the effect of an ability:
As the name suggest. Mana and cooldown have been triggered.

A unit finishes casting an ability:
Usually for channeling abilities. The event fires when the unit has completed channeled/casted the ability.

A unit stops casting an ability:
Usually for channeling abilities. The event fires when the channeling ability is interrupted or stopped. This also fires when the ability is finished channeled. Meaning it will stack with 'A unit finishes casting an ability'.


These are based off my personal experience. Not theoretical.
Then again, I strongly believe the cooldown was not set because of the moving unit action. This happens even with 'A unit starts the effect of ability' event. A workaround is to pause and unpause the unit. Or add a lil wait before moving the unit.
 
@Water -You can always check issued order you know, if it's issued another order, then the casting is cancelled...

and seriously, if what you say is true that Starts actually starts before cooldown, then A LOT of spells on the section should have been rejected for bugs... even on my old rejected map, I've been moving casters on Starts Effect

@OP - post your triggers would you?
 
Level 5
Joined
Jan 27, 2014
Messages
164
> ...I've been moving casters on Starts Effect
You probably should review the said triggers. It's a known bug.
Well, at least in TH.

It's just a simple test.
Not sure if you've tried.
But I attached a map to simplify things.

Both Carrion Swarm and Channel have cooldown.

Code:
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
    Actions
        Unit - Move (Triggering unit) instantly to (Target point of ability being cast)
 

Attachments

  • Bug.w3x
    16.2 KB · Views: 79
Level 26
Joined
Aug 18, 2009
Messages
4,097
@Water -You can always check issued order you know, if it's issued another order, then the casting is cancelled...

and seriously, if what you say is true that Starts actually starts before cooldown, then A LOT of spells on the section should have been rejected for bugs... even on my old rejected map, I've been moving casters on Starts Effect

It just does not matter most of the time. The SetUnitX/Y natives do not reset the unit's order. And as I said above, end cast also comes with problems/difficulties, so for a public resource and for simplicity, it's probably better to stick to start effect.

Yeah and I asked for a test map for

No, it doesn't... I tried it out, if I cancel after effect but before the end, it won't trigger End Cast... you need cancel casting for that...

because I could not confirm that and ofc I had done some tests, too.
 
Level 6
Joined
Nov 3, 2005
Messages
103
Alright, so basically what I assumed was the problem. "Starts the effect of an ability" would just be starting the trigger right after the unit throws the Storm Bolt and calls the starting of the cooldown. I've tried modifying the triggers to use this event but it messes with the spell and cancels the unit's animations that I've set in the trigger.

Haven't tried fixing that problem yet. Going to see what's up now.

If this is true, is there an ability within the game that "starts the effect" right after targeting a unit? I would rather use that ability as a base instead.
 
Status
Not open for further replies.
Top