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.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top