- Joined
- Sep 29, 2004
- Messages
- 52
Well, I havent seen a post that exactly answers problems with GUI loops, so I decided to post this. When it comes to making GUI triggers with loops it sometimes bug, for example this soul fissure spell trigger I'm working on:
Actions
Set SoulFissureCaster = (Casting unit)
Set SoulFissureCasterLoc = (Position of SonicBoomCaster)
Set SoulFissurePoint = (Target point of ability being cast)
Set SoulFissureAng = (Angle from SoulFissureCasterLoc to SoulFissurePoint)
Set SoulOffset = 0.00
Set SoulFissureDamage = (Units within 250.00 of (SoulFissureCasterLoc offset by (300.00 + SoulOffset) towards SoulFissureAng degrees) matching (((Matching unit) belongs to an ally of (Owner of SoulFissureCaster)) Equal to False))
For each (Integer A) from 1 to 4, do (Actions)
Loop - Actions
Wait 0.05 seconds
Unit Group - Pick every unit in SoulFissureDamage and do (Actions)
Loop - Actions
Unit - Cause SoulFissureCaster to damage (Picked unit), dealing (((Real((Intelligence of SoulFissureCaster (Include bonuses)))) x (3.00 + (1.00 x (Real((Level of Sonic Boom (Wind Master) for SoulFissureCaster)))))) + 50.00) damage of attack type Spells and damage type Death
Special Effect - Create a special effect at (Position of (Picked unit)) using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
Special Effect - Destroy (Last created special effect)
Unit - Create 1 Dummy Caster3 for (Owner of SoulFissureCaster) at (SoulFissureCasterLoc offset by (300.00 + SoulOffset) towards SoulFissureAng degrees) facing SoulFissureAng degrees
Set SoulStomper = (Last created unit)
Unit - Add a 1.50 second Generic expiration timer to SoulStomper
Unit - Order SoulStomper to Orc Tauren Chieftain - War Stomp
Set SoulOffset = (SoulOffset + 300.00)
Set SoulFissureDamage = (Units within 250.00 of (SoulFissureCasterLoc offset by (300.00 + SoulOffset) towards SoulFissureAng degrees) matching (((Matching unit) belongs to an ally of (Owner of SoulFissureCaster)) Equal to False))
Custom script: call DestroyGroup(udg_SoulFissureDamage)
Custom script: call RemoveLocation(udg_SoulFissureCasterLoc)
Custom script: call RemoveLocation(udg_SoulFissurePoint)
With this trigger, instead of looping 4 times, sometimes it may loop 2 times, or 6 times, and on one occasion, 20 times @_@. Is there anyway to make a more efficient spell, I even used LeakCheck to catch all the leaks or any other deficiencies within this trigger, does anyone have a solution to this problem?
Actions
Set SoulFissureCaster = (Casting unit)
Set SoulFissureCasterLoc = (Position of SonicBoomCaster)
Set SoulFissurePoint = (Target point of ability being cast)
Set SoulFissureAng = (Angle from SoulFissureCasterLoc to SoulFissurePoint)
Set SoulOffset = 0.00
Set SoulFissureDamage = (Units within 250.00 of (SoulFissureCasterLoc offset by (300.00 + SoulOffset) towards SoulFissureAng degrees) matching (((Matching unit) belongs to an ally of (Owner of SoulFissureCaster)) Equal to False))
For each (Integer A) from 1 to 4, do (Actions)
Loop - Actions
Wait 0.05 seconds
Unit Group - Pick every unit in SoulFissureDamage and do (Actions)
Loop - Actions
Unit - Cause SoulFissureCaster to damage (Picked unit), dealing (((Real((Intelligence of SoulFissureCaster (Include bonuses)))) x (3.00 + (1.00 x (Real((Level of Sonic Boom (Wind Master) for SoulFissureCaster)))))) + 50.00) damage of attack type Spells and damage type Death
Special Effect - Create a special effect at (Position of (Picked unit)) using Objects\Spawnmodels\Undead\UndeadDissipate\UndeadDissipate.mdl
Special Effect - Destroy (Last created special effect)
Unit - Create 1 Dummy Caster3 for (Owner of SoulFissureCaster) at (SoulFissureCasterLoc offset by (300.00 + SoulOffset) towards SoulFissureAng degrees) facing SoulFissureAng degrees
Set SoulStomper = (Last created unit)
Unit - Add a 1.50 second Generic expiration timer to SoulStomper
Unit - Order SoulStomper to Orc Tauren Chieftain - War Stomp
Set SoulOffset = (SoulOffset + 300.00)
Set SoulFissureDamage = (Units within 250.00 of (SoulFissureCasterLoc offset by (300.00 + SoulOffset) towards SoulFissureAng degrees) matching (((Matching unit) belongs to an ally of (Owner of SoulFissureCaster)) Equal to False))
Custom script: call DestroyGroup(udg_SoulFissureDamage)
Custom script: call RemoveLocation(udg_SoulFissureCasterLoc)
Custom script: call RemoveLocation(udg_SoulFissurePoint)
With this trigger, instead of looping 4 times, sometimes it may loop 2 times, or 6 times, and on one occasion, 20 times @_@. Is there anyway to make a more efficient spell, I even used LeakCheck to catch all the leaks or any other deficiencies within this trigger, does anyone have a solution to this problem?