Detecting when a unit stops channeling

Weep

Godspeed to the sound of the pounding
Reaction score
400
Unit - A unit Stops casting an ability
...
 

kingkwong92

Well-Known Member
Reaction score
25
Doesn't work.
I have a sliding trigger.
I start sliding when I start channeling and stop when I stop channeling. But when I stop channeling I keep sliding.

Unit stops casting an ability
ability being cast equal to slide
remove unit from slide_group
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Works for me...

What spell is is based on?
 

kingkwong92

Well-Known Member
Reaction score
25
channel
every 0.05 seconds
pick every unit in slide_group
move picked unit

unit stops casting
ability equal to slide
remove unit from slide_group
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Same for me. Double-check your trigger?
 

kingkwong92

Well-Known Member
Reaction score
25
Its a big trigger but I'll post it anyway

Code:
[WC3]Learn Chidori
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to Chidori (learn)
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Chidori (spellbook) for (Triggering unit)) Equal to 0
            Then - Actions
                Unit - Add Chidori (spellbook) to (Triggering unit)
            Else - Actions
        Unit - Set level of Chidori  for (Triggering unit) to (Level of Chidori (learn) for (Triggering unit))
        Player - Disable Chidori  for (Owner of (Triggering unit))
[/WC3]

[WC3]Charge
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Charge (chidori)
    Actions
        Hashtable - Create a hashtable
        Set charge_ht = (Last created hashtable)
        Hashtable - Save 0 as 1 of (Key (Triggering unit)) in charge_ht
        Unit Group - Add (Triggering unit) to charge_group
        Animation - Play (Triggering unit)'s spell work animation
        Special Effect - Create a special effect attached to the hand right of (Triggering unit) using Abilities\Spells\Orc\Purge\PurgeBuffTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the hand right of (Triggering unit) using Abilities\Weapons\Bolt\BoltImpact.mdl
        Special Effect - Destroy (Last created special effect)
        Special Effect - Create a special effect attached to the hand right of (Triggering unit) using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
        Hashtable - Save Handle Of(Last created special effect) as 1 of (Key (Triggering unit)) in charge_ht
        Player - Enable Chidori  for (Owner of (Triggering unit))
        Player - Disable Charge (chidori) for (Owner of (Triggering unit))
        Trigger - Turn on Charging <gen>
[/WC3]

[WC3]Charging
    Events
        Time - Every 0.50 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in charge_group and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in charge_group) Less than or equal to 0
                    Then - Actions
                        Trigger - Turn off (This trigger)
                    Else - Actions
                Set charge = (Load 1 of (Key (Picked unit)) from charge_ht)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Mana of (Picked unit)) Greater than or equal to (5.00 + (5.00 x (Real((Level of Chidori  for (Picked unit))))))
                    Then - Actions
                        Set charge = (charge + 1)
                        Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - (5.00 + (5.00 x (Real((Level of Chidori  for (Picked unit)))))))
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        charge Equal to 11
                    Then - Actions
                        Floating Text - Create floating text that reads IIIIIIIIII above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                        Floating Text - Change (Last created floating text): Disable permanence
                        Floating Text - Change the lifespan of (Last created floating text) to 0.60 seconds
                        Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
                    Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        charge Greater than 10
                    Then - Actions
                        Set charge = 10
                    Else - Actions
                Hashtable - Save charge as 1 of (Key (Picked unit)) in charge_ht
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        charge Less than or equal to 10
                    Then - Actions
                        For each (Integer A) from 1 to 10, do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        charge Less than or equal to (Integer A)
                                    Then - Actions
                                        Set charge_sfx[(Integer A)] = <Empty String>
                                    Else - Actions
                                        Set charge_sfx[(Integer A)] = I
                        Floating Text - Create floating text that reads IIIIIIIIII above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                        Floating Text - Change (Last created floating text): Disable permanence
                        Floating Text - Change the lifespan of (Last created floating text) to 0.60 seconds
                        Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
                        Floating Text - Create floating text that reads (((charge_sfx[1] + charge_sfx[2]) + charge_sfx[3]) + (((charge_sfx[4] + charge_sfx[5]) + charge_sfx[6]) + ((charge_sfx[7] + charge_sfx[8]) + (charge_sfx[9] + charge_sfx[10])))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (20.00%, 20.00%, 100.00%), and 0.00% transparency
                        Floating Text - Change (Last created floating text): Disable permanence
                        Floating Text - Change the lifespan of (Last created floating text) to 0.60 seconds
                        Floating Text - Change the fading age of (Last created floating text) to 0.00 seconds
                    Else - Actions
[/WC3]


[WC3]Stop Charging
    Events
        Unit - A unit Stops casting an ability
    Conditions
        (Ability being cast) Equal to Charge (chidori)
    Actions
        Unit Group - Remove (Triggering unit) from charge_group
        Player - Enable Charge (chidori) for (Owner of (Triggering unit))
[/WC3]

[WC3]Chidori
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Chidori 
    Actions
        Set chidori_caster_point = (Position of (Triggering unit))
        Set chidori_target_point = (Target point of ability being cast)
        Set chidori_distance = (3000.00 + (300.00 x (Real((Level of Chidori  for (Triggering unit))))))
        Set chidori_angle = (Angle from chidori_caster_point to chidori_target_point)
        Unit - Make (Triggering unit) face chidori_angle over 0.00 seconds
        Hashtable - Create a hashtable
        Set chidori_ht = (Last created hashtable)
        Hashtable - Save chidori_distance as 0 of (Key (Triggering unit)) in chidori_ht
        Hashtable - Save chidori_angle as 1 of (Key (Triggering unit)) in chidori_ht
        Camera - Lock camera target for (Owner of (Triggering unit)) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
        Unit Group - Remove (Triggering unit) from charge_group
        Unit Group - Add (Triggering unit) to chidori_group
        Player - Enable Charge (chidori) for (Owner of (Triggering unit))
        Player - Disable Chidori  for (Owner of (Triggering unit))
        Trigger - Turn on Chidori Movement 1 <gen>
        Unit - Set (Triggering unit) acquisition range to 0.00
        Custom script:   call RemoveLocation(udg_chidori_caster_point)
        Custom script:   call RemoveLocation(udg_chidori_target_point)
[/WC3]

[WC3]Chidori Movement 1
    Events
        Time - Every 0.05 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in chidori_group and do (Actions)
            Loop - Actions
                Set chidori_angle = (Load 1 of (Key (Picked unit)) from chidori_ht)
                Set chidori_point1 = (Position of (Picked unit))
                Set chidori_point2 = (chidori_point1 offset by ((Current movement speed of (Picked unit)) / 15.00) towards chidori_angle degrees)
                Set chidori_caster = (Picked unit)
                Custom script:   call SetUnitX(udg_chidori_caster,GetLocationX(udg_chidori_point2))
                Custom script:   call SetUnitY(udg_chidori_caster,GetLocationY(udg_chidori_point2))
                Set chidori_distance = (Load 0 of (Key (Picked unit)) from chidori_ht)
                Set chidori_distance = (chidori_distance - ((Current movement speed of (Picked unit)) / 15.00))
                Hashtable - Save chidori_distance as 0 of (Key (Picked unit)) in chidori_ht
                Set chidori_target_group = (Units within 100.00 of chidori_point2 matching (((((Matching unit) is A ground unit) Equal to True) and ((Matching unit) Not equal to (Picked unit))) and (((Matching unit) is alive) Equal to True)))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in chidori_target_group) Not equal to 0
                    Then - Actions
                        Set chidori_target = (Random unit from chidori_target_group)
                        Unit - Cause (Picked unit) to damage chidori_target, dealing ((200.00 x (Real((Level of Chidori  for (Picked unit))))) x ((Load 0 of (Key (Picked unit)) from charge_ht) / 10.00)) damage of attack type Spells and damage type Normal
                        Set chidori_distance = 0.00
                        Unit - Make (Picked unit) face chidori_target over 0.00 seconds
                        Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in charge_ht
                    Else - Actions
                Destructible - Pick every destructible within 100.00 of chidori_point2 and do (Actions)
                    Loop - Actions
                        Destructible - Kill (Picked destructible)
                        Set chidori_distance = (chidori_distance - 500.00)
                        Hashtable - Save chidori_distance as 0 of (Key (Picked unit)) in chidori_ht
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        chidori_distance Less than or equal to 0.00
                    Then - Actions
                        Camera - Reset camera for (Owner of (Picked unit)) to standard game-view over 0.10 seconds
                        Hashtable - Clear all child hashtables of child (Key (Picked unit)) in chidori_ht
                        Special Effect - Destroy (Load 1 of (Key (Picked unit)) in charge_ht)
                        Unit - Set (Picked unit) acquisition range to (Default acquisition range of (Picked unit))
                        Animation - Play (Picked unit)'s spell attack animation
                        Unit Group - Remove (Picked unit) from chidori_group
                    Else - Actions
                Custom script:   call RemoveLocation(udg_chidori_point1)
                Custom script:   call RemoveLocation(udg_chidori_point2)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in chidori_group) Less than or equal to 0
            Then - Actions
                Trigger - Turn off (This trigger)
            Else - Actions
[/WC3]

[WC3]Chidori Movement 2
    Events
        Unit - A unit Stops casting an ability
    Conditions
        (Ability being cast) Equal to Chidori 
    Actions
        Unit Group - Remove (Triggering unit) from chidori_group
        Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in chidori_ht
[/WC3]
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Odd, I don't see anything there that would make it not work. It works fine for me...
 

kingkwong92

Well-Known Member
Reaction score
25
Doesn't work for mine.
I disabled the ability after the stop casting instead of before but that still doesn't work.
Removing it from the unit_group shpould work but it doesn't

My spell is in a spellbook. Does this affect it somehow

EDIT!! Solved
 

Naga'sShadow

Ultra Cool Member
Reaction score
49
Something you should know using set unit position causes it to stop. So this could be an issue for you. If this turns out to be the case use the custom script SetUnitX() and SetUnitY(). These don't interrupt a unit's current order. You will have to store the X and the Y values and do the math yourself but a line isn't that difficult.

Another thing, rather than checking to see if a unit finished casting you can check what the caster's current order is. Compare the order sting of your spell with the units current order string and then you'll know when it stops. You can add that into your movement trigger rather than have another one.
 

kingkwong92

Well-Known Member
Reaction score
25
I know my trigger is huge so no one will read it but I have used custom script so that it doesn't stop the order.

Could youu please explain how do do the comparison of order IDs?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top