- Joined
- Feb 8, 2015
- Messages
- 123
So I've created a spell that sends a line of 8 explosions down a path, dealing damage.
The explosions proc every 0.85 seconds, so a full line takes about 7 seconds to complete.
The spell works just fine, but the Hero has a "cooldown reset" ability, so it has to be MUI - and indeed, with hashtables, I can run several cycles at a time.
But there's this odd effect where after trying to run two casts at a time, the next cast will only make 1-2 explosions, and then stop completely. The next few are similarly dysfunctional, before eventually returning to normal.
It seems as if the SmoldTrail_i (which counts numbers of explosions) gets overridden by other casts somehow, but I can't seem to find out why - I feel like my hashtables are in order.
Also, there are several Point variables that aren't cleared - because when I did, the trigger refused to function. Is overwriting with a hashtable Location-handle-load okay? Or is this leaking like crazy?
(P.S. there's also a "dummy catapult does a burning oil effect" on target, but that's left disabled in my copy-paste, along with the visual effect)
The explosions proc every 0.85 seconds, so a full line takes about 7 seconds to complete.
The spell works just fine, but the Hero has a "cooldown reset" ability, so it has to be MUI - and indeed, with hashtables, I can run several cycles at a time.
But there's this odd effect where after trying to run two casts at a time, the next cast will only make 1-2 explosions, and then stop completely. The next few are similarly dysfunctional, before eventually returning to normal.
It seems as if the SmoldTrail_i (which counts numbers of explosions) gets overridden by other casts somehow, but I can't seem to find out why - I feel like my hashtables are in order.
Also, there are several Point variables that aren't cleared - because when I did, the trigger refused to function. Is overwriting with a hashtable Location-handle-load okay? Or is this leaking like crazy?
(P.S. there's also a "dummy catapult does a burning oil effect" on target, but that's left disabled in my copy-paste, along with the visual effect)
-
Smoldering Trail Cast
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Good: Smoldering Trail (Channel)
-
-

Actions
-


Set SmoldTrail_cast = (Triggering unit)
-


Set SmoldTrail_dist = 800.00
-


Set SmoldTrail_i = 8
-


Set SmoldTrail_jumpdist = (SmoldTrail_dist / (Real(SmoldTrail_i)))
-


-------- Calculates the angle of explosion-path --------
-


Set SmoldTrail_CastP = (Position of SmoldTrail_cast)
-


Set SmoldTrail_TargP = (Target point of ability being cast)
-


Set SmoldTrail_ang = (Angle from SmoldTrail_CastP to SmoldTrail_TargP)
-


-------- Sets the damage formula (50*x+25) where x is level of ability --------
-


Set SmoldTrail_dmg = (25.00 + (50.00 x (Real((Level of (Ability being cast) for SmoldTrail_cast)))))
-


-------- Creates a dummy (handle) --------
-


Unit - Create 1 Dummy for (Owner of SmoldTrail_cast) at SmoldTrail_CastP facing Default building facing degrees
-


Unit Group - Add (Last created unit) to SmoldTrail_ug
-


-------- Saves the angle, damage, and number of explosions to this unique dummy --------
-


Hashtable - Save SmoldTrail_i as 0 of (Key (Last created unit)) in SmoldTrail_hash
-


Hashtable - Save SmoldTrail_dmg as 1 of (Key (Last created unit)) in SmoldTrail_hash
-


Hashtable - Save SmoldTrail_ang as 2 of (Key (Last created unit)) in SmoldTrail_hash
-


Hashtable - Save Handle OfSmoldTrail_CastP as 3 of (Key (Last created unit)) in SmoldTrail_hash
-


-------- Cleans up the Locations --------
-


Custom script: call RemoveLocation(udg_SmoldTrail_TargP)
-
-
-
Smoldering Trail Loop
-

Events
-


Time - Every 0.85 seconds of game time
-
-

Conditions
-

Actions
-


Unit Group - Pick every unit in SmoldTrail_ug and do (Actions)
-



Loop - Actions
-




Set SmoldTrail_Loopu = (Picked unit)
-




-------- Loads parameters for this unit (saved in Smoldering Trail Cast) --------
-




Set SmoldTrail_i = (Load 0 of (Key (Picked unit)) from SmoldTrail_hash)
-




Set SmoldTrail_dmg = (Load 1 of (Key (Picked unit)) from SmoldTrail_hash)
-




Set SmoldTrail_ang = (Load 2 of (Key (Picked unit)) from SmoldTrail_hash)
-




Set SmoldTrail_Tempp1 = (Load 3 of (Key (Picked unit)) in SmoldTrail_hash)
-




-------- Checks remaining explosion count --------
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






SmoldTrail_i Greater than 0
-
-





Then - Actions
-






-------- Duration remains... Periodic Damage (and Explosion accumulation) --------
-






Set SmoldTrail_Tempp2 = (SmoldTrail_Tempp1 offset by SmoldTrail_jumpdist towards SmoldTrail_ang degrees)
-






-------- Damages enemies around the point --------
-






Set SmoldTrail_Tempug = (Units within 150.00 of SmoldTrail_Tempp2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is dead) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of SmoldTrail_Loopu)) Equal to True) and ((((Matching un
-






Set SmoldTrail_AlreadyDamaged = (Load 4 of (Key (Picked unit)) in SmoldTrail_hash)
-






Unit Group - Pick every unit in SmoldTrail_Tempug and do (Actions)
-







Loop - Actions
-








Set SmoldTrail_Picked = (Picked unit)
-








Unit - Cause SmoldTrail_Loopu to damage SmoldTrail_Picked, dealing SmoldTrail_dmg damage of attack type Spells and damage type Normal
-








Unit Group - Add SmoldTrail_Picked to SmoldTrail_AlreadyDamaged
-








Hashtable - Save Handle OfSmoldTrail_AlreadyDamaged as 4 of (Key (Picked unit)) in SmoldTrail_hash
-
-
-






-------- Cleans up the tempgroup --------
-






Custom script: call DestroyGroup(udg_SmoldTrail_Tempug)
-






-------- Creates a dummy explosion effect --------
-






Unit - Create 1 Dummy Effect: Neutral Building Explosion for Neutral Passive at SmoldTrail_Tempp2 facing Default building facing degrees
-






Unit - Add a 0.98 second Generic expiration timer to (Last created unit)
-






-------- Creates a dummy to apply the Burning Oil effect --------
-






Unit - Create 1 Smoldering Trail Burning Oil Dummy for (Owner of SmoldTrail_Loopu) at SmoldTrail_Tempp2 facing Default building facing degrees
-






Set SmoldTrail_Tempu = (Last created unit)
-






Unit - Order SmoldTrail_Tempu to Attack Ground SmoldTrail_Tempp2
-






Unit - Add a 1.00 second Generic expiration timer to SmoldTrail_Tempu
-






-------- Resaves Variables (number of explosions left, and point of last explosion have changed) --------
-






Hashtable - Save (SmoldTrail_i - 1) as 0 of (Key (Picked unit)) in SmoldTrail_hash
-






Hashtable - Save Handle OfSmoldTrail_Tempp2 as 3 of (Key (Picked unit)) in SmoldTrail_hash
-
-





Else - Actions
-






-------- Cleans hashtable, removes unit from group --------
-






Unit Group - Remove SmoldTrail_Loopu from SmoldTrail_ug
-






Hashtable - Clear all child hashtables of child (Key (Picked unit)) in SmoldTrail_hash
-






Custom script: call RemoveLocation(udg_SmoldTrail_Tempp1)
-






Custom script: call RemoveLocation(udg_SmoldTrail_Tempp2)
-






Set SmoldTrail_AlreadyDamaged = (Load 4 of (Key (Picked unit)) in SmoldTrail_hash)
-






Custom script: call DestroyGroup(udg_SmoldTrail_AlreadyDamaged)
-






-------- Removes the dummy unit completely --------
-






Unit - Remove SmoldTrail_Loopu from the game
-
-
-




-------- Removes the previous point variable --------
-




Custom script: call RemoveLocation(udg_SmoldTrail_Tempp1)
-
-
-
-
