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

Blink Strike Trigger Won't Go On Cooldown

Status
Not open for further replies.
Level 3
Joined
Dec 30, 2015
Messages
33
I was attempting to make a blink strike ability, and for the most part it is functional. However, for whatever reason the ability itself won't actually go on cooldown at all. My trigger looks like this as of now. Does anyone know what I did wrong, or what I need to add for it to go on cooldown?




Screenshot (2554).png
 
At the moment the spell starts its effects, the spell cooldown hasn't started yet. It will only start after this event, if the caster is still casting said ability.

The move unit action in GUI subtly orders the unit to stop, so that leads to one instance of order interruption. Then, the issue attack action also orders the unit to attack, another source of order interruption.

To apply cooldown to the spell, you'll have to do everything in the trigger exactly 0 seconds after the event by using a (countdown) timer. Wait actions are not an acceptable substitute for this case (with exceptions when utilizing PerfectPolledWait).

Another way to apply cooldown would be to trigger it manually. AFAIK, this only applies to the Reforged version.

  • Comment: ---- abilCode refers to the rawcode of the ability (Ctrl + D in Object Editor) ----
  • Custom Script: call BlzStartUnitAbilityCooldown(unit, abilCode, duration)
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
You can also use the SetUnitX() and SetUnitY() jass functions which move a unit to the X/Y coordinate without interrupting order. I think it is SetUnitX(udg_unit_to_move, udg_real_var_for_x_coordinate) and similar to SetUnitY().
You can also use "Unit finishes casting an ability" event which is fired when unit successfully finishes casting an ability (contrary to Unit stops casting..., which fires even when unit is for example stunned). The disadvantage is that at this point, there is not target unit, nor target point, so you would actually have to have two MUI triggers:
1) when unit starts casting an ability, move the unit via SetUnitX and SetUnitY to the target point and save the target unit to variables (the MUI way)
2) when unit finishes casting an ability, load the target unit from variable and order caster to attack the target
 
Status
Not open for further replies.
Top