This is my first attempt at a Custom Ability, and aside from this error, it works beautifully.
As per the subject, everything works fine, EXCEPT, right at the very end, when he's being put down, ONCE IN A BLUE MOON, he'll lock up, and stay invulnerable (the base spell is "Divine Shield", which is good, because I want him invulnerable in the air)
I can no longer select him or issue him commands. He remains in the spot he landed, in the standing animation, un-moving.
The crappiest thing about this "bug"? It's hard as hell to duplicate. I can't narrow down what is causing it. I can cast the spell 100 times in a row and it won't happen.
That being said, I have observed that it USUALLY happens when there is a lot of fighting going on and he's trying to land where another unit it is. But I've tried repeating this, and it doesn't always happens. The game will just set him down in the group and no collisions occur.
From a purely trigger/logic perspective, can you see something I did wrong? I read in another thread where someone was accused of "leaks" in their trigger? I understand "memory leaks" from a programming perspective, but how do triggers "leak"? I ask because often times, the lock-up occurs on the FIRST use of the spell. I point this out in case someone thinks my triggers' "leaks" (if it has any), are causing this. In other words, the number of times I cast the spell does not seem related to this error, but I could be wrong.
Thanks for any and all help, apologies for thread length.
Code:
Phoenix Storm Level 1
Events
Unit - A unit Starts the effect of an ability
Conditions
((Ability being cast) Equal to Phoenix Storm ) and ((Level of Phoenix Storm for (Triggering unit)) Equal to 1)
Actions
-------- Storm Begins --------
Set CastingUnit = (Casting unit)
-------- ** Pause CasterUnit ** Give CasterUnit Crow Form ** Turn CasterUnit ** Shake Camera ** Lift CasterUnit ** Slow CasterUnit Animation to 85% ** --------
Unit - Pause CastingUnit
Unit - Add Crow Form to CastingUnit
Unit - Make CastingUnit face 250.00 over 0.50 seconds
Wait 0.50 seconds
Camera - Shake the camera for Player 1 (Red) with magnitude 4.00
Animation - Change CastingUnit flying height to 250.00 at 375.00
Animation - Change CastingUnit's animation speed to 85.00% of its original speed
-------- Summon 5 Phoenix every (Index x 72) Degrees --------
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
Set PhSummonIndex = (Real((Integer A)))
Animation - Play CastingUnit's death animation
Wait 0.30 seconds
Unit - Create 1 PhoenixRain for Player 1 (Red) at ((Position of CastingUnit) offset by 325.00 towards ((PhSummonIndex - 1.00) x 72.00) degrees) facing Default building facing degrees
-------- Order the 5 summoned Phoenix to move to the caster and explode --------
Animation - Play CastingUnit's stand animation
Unit Group - Pick every unit in (Units of type PhoenixRain) and do (Unit Group - Order (Units of type PhoenixRain) to Move To (Position of CastingUnit))
Wait 0.40 seconds
Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type PhoenixRain) and do (Unit - Explode (Picked unit))
-------- Cause Damage - Create 5 Flamestrikes where the Phoenix exploded --------
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
Set PhStormIndex = (Real((Integer A)))
Special Effect - Create a special effect at ((Position of CastingUnit) offset by 155.00 towards ((PhStormIndex - 1.00) x 72.00) degrees) using Abilities\Spells\Human\FlameStrike\FlameStrike1.mdl
Unit Group - Pick every unit in (Units within 300.00 of (Position of CastingUnit) matching (((Matching unit) belongs to an enemy of (Owner of CastingUnit)) Equal to True)) and do (Unit - Cause CastingUnit to damage (Picked unit), dealing 60.00 damage of attack type Spells and damage type Fire)
Wait 1.00 seconds
-------- Undo all changes to CasterUnit --------
Animation - Change CastingUnit's animation speed to 100.00% of its original speed
Animation - Change CastingUnit flying height to 0.00 at 420.00
Unit - Remove Crow Form from CastingUnit
Camera - Stop swaying/shaking the camera for Player 1 (Red)
Unit - Unpause CastingUnit
-------- Storm Ends --------
As per the subject, everything works fine, EXCEPT, right at the very end, when he's being put down, ONCE IN A BLUE MOON, he'll lock up, and stay invulnerable (the base spell is "Divine Shield", which is good, because I want him invulnerable in the air)
I can no longer select him or issue him commands. He remains in the spot he landed, in the standing animation, un-moving.
The crappiest thing about this "bug"? It's hard as hell to duplicate. I can't narrow down what is causing it. I can cast the spell 100 times in a row and it won't happen.
That being said, I have observed that it USUALLY happens when there is a lot of fighting going on and he's trying to land where another unit it is. But I've tried repeating this, and it doesn't always happens. The game will just set him down in the group and no collisions occur.
From a purely trigger/logic perspective, can you see something I did wrong? I read in another thread where someone was accused of "leaks" in their trigger? I understand "memory leaks" from a programming perspective, but how do triggers "leak"? I ask because often times, the lock-up occurs on the FIRST use of the spell. I point this out in case someone thinks my triggers' "leaks" (if it has any), are causing this. In other words, the number of times I cast the spell does not seem related to this error, but I could be wrong.
Thanks for any and all help, apologies for thread length.