• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Triggered spell freeze my comp

Status
Not open for further replies.
Level 6
Joined
Oct 11, 2005
Messages
142
Every time i cast this spell WC freezes and i end up having to Ctrl Alt Delete. Anyone know how to fix it?


Events
Unit - A unit Begins casting an ability
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to Dark Mana
Then - Actions
Unit - Order (Casting unit) to damage area in 0.00 seconds of size 400.00 at (Target point of ability being cast) for (Mana of (Casting unit)) using attack type Chaos and damage type Universal.
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within 400.00 of (Target point of ability being cast)) and do (Unit - Set mana of (Picked unit) to 0.00)
Unit - Set mana of (Casting unit) to 0.00
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 36.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 72.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 108.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 144.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 180.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 216.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 252.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 288.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 324.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 360.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Else - Actions
Do nothing
 
Level 10
Joined
Jul 14, 2004
Messages
463
I don't see the reason of freezing just now, but some general things:
-generally, use action "Unit starts the effect of an ability" to create spells
-Just put your condition to "Conditions" of the trigger instead of creating a new if/then/else and using only the then of it

I don't know what you know and what not, please post an actual version. You can do the special effects in a loop. Anyway, I'd write Creating/Destroying in one JASS line. To do that, create a trigger, copy one of the Create SFX lines to it and convert to custom Text. Copy the whole line with CreateEffect except the "call" and make a custom script function in the old trigger this way:
call DestroyEffect( insert copied text )

Maybe this works. Another tip for testing: Insert a "Skip remaining actions" at the beginning of the trigger and just move it downwards to see what works and what not! :wink:
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
I believe what is happening is because of
A unit Begins casting an ability
Before the mana is deducted to cast the spell its mana is set to 0 and so when the spell finaly is cast it removes the spell mana cost from 0 mana and sees.

WTF "-" Mana? ERROR DOES NOT COMPUTE! ABORT GAME!

Since its obvious you can not have negative mana in the game.
 
Level 6
Joined
Oct 11, 2005
Messages
142
I get to see all the effects and the spell does do the right damage but from then on lag increase very rapidly about 2 secs after the casting and within bout 5 secs the comps just freezes
 
Level 27
Joined
Feb 22, 2006
Messages
3,052
BlazeLancer said:
Every time i cast this spell WC freezes and i end up having to Ctrl Alt Delete. Anyone know how to fix it?


Events
Unit - A unit Begins casting an ability
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to Dark Mana
Then - Actions
Unit - Order (Casting unit) to damage area in 0.00 seconds of size 400.00 at (Target point of ability being cast) for (Mana of (Casting unit)) using attack type Chaos and damage type Universal.
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within 400.00 of (Target point of ability being cast)) and do (Unit - Set mana of (Picked unit) to 0.00)
Unit - Set mana of (Casting unit) to 0.00
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 36.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 72.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 108.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 144.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 180.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 216.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 252.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 288.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 324.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 360.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Else - Actions
Do nothing
The lag increases? I'd say its due to the neglect to remove the points, therefore causing massive massive leaks, lagging your game into oblivion.
Fix your point leaks with a
Code:
For each integer a 1 to 10
Set Var_AntiLeakPoint = (Target point of ability being cast) offset by 400.00 towards ((Real (integer A)) x 36) degrees)
 Special Effect - Create a special effect at Var_AntiLeakPoint Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Custom Script: call RemoveLocation (udg_Var_AntiLeakPoint)
--donut3.5--
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Damn, donut beat me to it, cause i had to close my inter - im supposed to be doing hw, and parents came in :roll:

anyways

Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 36.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 72.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 108.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 144.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 180.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 216.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 252.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 288.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 324.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)
Special Effect - Create a special effect at ((Target point of ability being cast) offset by 400.00 towards 360.00 degrees) using Abilities\Spells\Items\AIre\AIreTarget.mdl
Special Effect - Destroy (Last created special effect)

Will leak about 40 locations and 20 SFX every cast.
 
Level 6
Joined
Oct 11, 2005
Messages
142
i have custom spells in the same map with much with leaks that this one and they don't lag like this one, but ill try fixing the leaks
 
Status
Not open for further replies.
Top