Can you find my error? Custom Ability causing unit to "lock-up" on rare occasions

Sungazer

New Member
Reaction score
0
This is my first attempt at a Custom Ability, and aside from this error, it works beautifully.

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. :)
 

WolfieeifloW

WEHZ Helper
Reaction score
372
1. It'd be nice if you could put that trigger inside of code tags for us ;) .
Go to your trigger in World Editor.
Where it says Events, above that is the trigger name.
Right click on the trigger name and select "Copy As Text".
Now come back here and edit your post and paste this text inside of [noparse]
Code:
[/noparse]
tags.

2. We don't need the "synopsis", delete that part :p .

3. I'll (re)read your post when you fix those two things and try to help :) .
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Kay, here we go :p :

1. Change:
Code:
    Conditions
        ((Ability being cast) Equal to Phoenix Storm ) and ((Level of Phoenix Storm  for (Triggering unit)) Equal to 1)
To:
Code:
    Conditions
        ((Ability being cast) Equal to Phoenix Storm )
        ((Level of Phoenix Storm  for (Triggering unit)) Equal to 1)
It makes it easier to read.

2. I don't think this will be MUI with all the waits.

3. Don't base the ability off of Divine Shield.
You can trigger the invulnerability:
Code:
Actions
    Unit - Make (Triggering unit) Invulnerable
    Unit - Make (Triggering unit) Vulnerable

4. Try the above suggestions;
If they don't work, instead of pausing the unit, set his movement speed to 0?

5. Here's two tutorials for memory leaks [these are the two that I learned from]:
First
Second

EDIT: You said he stays invulnerable, but then you said he can't move.
You mean he stays paused, not invulnerable?
 

Immolation

Member
Reaction score
20
Trust me, pause is most of the time an epic fail. It's okay in cinematics, but sucks in abilities, especially if they aren't MUI. :thdown:

Set his movement speed to 0 is the right thing to do and trigger the invulnerability. ;)
 

Sungazer

New Member
Reaction score
0
Thank you for the timely, intelligent responses, fellas. A very warm welcome for me to this board! :D

Edit: Oh, I'm going to bed. Will make and test the changes tomorrow and post back with results.
 

Sungazer

New Member
Reaction score
0
*sigh* Just an update.

Trust me, pause is most of the time an epic fail. It's okay in cinematics, but sucks in abilities, especially if they aren't MUI.

So I had no idea what MUI was, and then I went and found out. Creating two heroes and using that spell twice in a row before the first finished was quite interesting.

As some of you can imagine, the second spell caster "crashed" the spellcast of the first, interrupting the first caster mid-cast and leaving the first caster at whatever height he was at when crashed.

Slightly intimidated and generally not ready to learn JASS, I found Flare's "GUI MUI" guide that involves using a Periodic trigger to deal with waits. Sounds great, that's exactly what I'm looking for, right?

Well, next road bump. I understand the system (sort of) and the idea behind creating a unique index for each array involved to keep spell casts seperate and avoid the use of "over-writing" global variables. The problem I'm having is figuring out how to apply it to my spell.

I'm going to try "working" this out in the thread where he posted his tutorial and see what kind of help I get, so check it out if you'd like to roll up your sleeves and pitch in!

Thanks again, especially for the Memory Leak tutorials, Wolfie.
 
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