HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why OH WHY!...does this spell keep breaking?

04-02-2007, 09:31 AM#1
Moss
I have had so many ongoing problems with the simplest spell in my map it is ridiculous. I'm not sure that they have all been related.

The spell is simply supposed to be a version of the Cloud ability that doesn't have to be channeled. So I have a dummy ability based on Channel, and then a trigger that fires when that ability is cast which simply uses the Caster System to cast a modified version of Cloud at the targeted point. I don't see how it could go wrong. But once in a blue moon it will just not work at all in a game. When the dummy ability is cast...nothing happens (besides mana/cooldown). I can't change stuff and test if it worked because it always works when I test. I have a feeling it is something else in my map because the problem seems more likely in multiplayer and the trigger is so simple, I don't see what could be wrong with it. Or maybe Cloud is a buggy ability? Here is the trigger:

Trigger:
Blinding Fog Channeller
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Blinding Fog.
Collapse Actions
Set p = (Target point of ability being cast)
Set i = (Level of (Ability being cast) for (Triggering unit))
Custom script: call CasterCastAbilityLevelPointLoc( GetOwningPlayer(GetTriggerUnit()), 'A00J', udg_i, "cloudoffog", udg_p, false)
Custom script: call RemoveLocation(udg_p)

If people want to see the object data I can do that later but right now I'm tired and need to sleep.
04-02-2007, 01:05 PM#2
tamisrah
I can only see three chances on how your trigger might fail:
1. You might have more levels of the Blinding Fog ability then of the cloud of
fog ability you use.
2. As you suggested there might be something in your map that causes the
problems: A trigger that sets udg_i or udg_p to different values
3. You might have used delayhack (I think it's called like that) to change the
time until a caster is recycled so your caster might be recycled before
actually casting the ability.
04-02-2007, 03:30 PM#3
Vexorian
I will blame your double frees of udg_p as if you could see with the other function you made.

You should either change your way to handle points and groups so they always use local variables OR always set the points to null after issues RemoveLocation.



Quote:
3. You might have used delayhack (I think it's called like that) to change the
time until a caster is recycled so your caster might be recycled before
actually casting the ability.

That doesn't work like that.
04-02-2007, 06:45 PM#4
Moss
OK, I will convert this trigger to jass and use local variables. And I will continue to hunt down the double free errors.
04-04-2007, 07:06 AM#5
Moss
So yeah, double frees definitely screw this thing up. Problem is that it could take a long time before I clean out all the double frees in my game, and as soon as one happens this spell - and probably my Fire Wyrm spell based on Vex's Hydra - go kaput. So is there a way to double-free-proof this spell so that it can keep working? I don't understand the nature of double frees so perhaps this is a foolish question, but one can hope.

I don't understand why these certain spells are so sensitive to the errors and the vast majority of everything else in my map seems impervious to them.

EDIT: Urgh! Very strange. Now when I tested again by forcing double frees, it still works just fine...are all double frees created equal?
04-04-2007, 12:11 PM#6
Vexorian
You don't need a single double free to screw it , you probably need many of them and multiplayer may also affect the effect of double frees
04-05-2007, 12:26 AM#7
Moss
So there is now way to make such a simple spell immune to double frees? Just a trigger that casts an ability at a point with a certain level equal to the level of the dummy ability that triggered it?