| 01-29-2007, 05:25 PM | #1 |
It seems that I can't get the spell target unit if I use the event "A unit finishes casting an ability", strange, isn't it? Can someone tell me why? Thanks. |
| 01-29-2007, 05:44 PM | #2 |
That event response just doesn't work with that event. It only works with "begins casting an ability" and "starts the effect of an ability". Same happens with the "target point of ability being cast" event response. |
| 01-29-2007, 05:45 PM | #3 |
No idea why, but you can use "Starts the effects of an ability" with the target, I think they are closely related timing wise. I noticed you're problem as well, and once I switched it to starts the effects of an ability, it worked. |
| 01-29-2007, 07:00 PM | #4 |
Unfortunately I can't use the event "A unit starts the effect of an ability" because the ability is channeling... I think that I will have to store the target (when the unit starts the effect) restoring it later :( |
| 01-29-2007, 07:10 PM | #5 |
how about you make it a unit starts casting ability, polled wait for 4.5 secs, check if uit is still casting and if he is do the effects? |
| 01-29-2007, 08:10 PM | #6 |
Hmmm, did you base it on the channel spell? Then life would be easier cause you can just uas unit starts effect of ability + you would need an other trigger to check if it is stuned (Or anything like that) to cancel it -Av3n |
| 01-29-2007, 10:22 PM | #7 |
Well, I had that issue when I did the Kraken spell for the hero contest. The best option that I had (and it works perfectly) is doing a script like this: JASS:function MySpell_Conditions takes nothing returns boolean return GetSpellAbilityId() == 'A000' // Check Ability code endfunction function MySpell_Actions takes nothing returns nothing local unit c = GetTriggerUnit() local integer SpellOrder = GetUnitCurrentOrder(c) loop exitwhen GetUnitCurrentOrder(c) != SpellOrder or Your_Condition() // Your actions here or wherever you need... call TriggerSleepAction(0.0) endloop set c = null endfunction This spell saves in a variable the channeling spell order, and checks if it's changed, so if the caster is stunned, or decides to move, attack, etc, the spell will finish. |
| 01-30-2007, 10:13 AM | #8 |
Thanks to all for your help. I found a workaround storing the target in a variable when the spell starts the effect and then restoring it when the spell is finished. |
