This spell trigger is making my game lag. After I cast it a few times it starts to get laggy, can anyone help me figure out why? I have tried multiple things. If I cast the spell like 20 times then it will get really really really laggy.
Just so you know what the trigger does, it just makes 6 dummy units in a straight line in whatever direction you are facing, then they all cast thunderclap. Its a beam spell.
Just so you know what the trigger does, it just makes 6 dummy units in a straight line in whatever direction you are facing, then they all cast thunderclap. Its a beam spell.
Trigger:
- Energy Beam
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Beam1
- Actions
- -------- Setting Variables --------
- Set ThunderCaster = (Casting unit)
- Set ThunderPoint = (Position of ThunderCaster)
- Set EffectPoint = 0.00
- -------- Finished Setting --------
- -------- ----------- --------
- -------- Pause Caster --------
- Wait 0.15 seconds
- Unit - Pause ThunderCaster
- -------- ----------- --------
- -------- Increase the "6" to make more and longer effects --------
- For each (Integer A) from 1 to 6, do (Actions)
- Loop - Actions
- -------- Setting Point Again --------
- -------- Increasing the "150" with make large spaces between effects and visa versa --------
- Set EffectPoint = (EffectPoint + 150.00)
- -------- ----------- --------
- -------- Special Effects --------
- Special Effect - Create a special effect at (ThunderPoint offset by EffectPoint towards (Facing of ThunderCaster) degrees) using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
- Special Effect - Destroy (Last created special effect)
- -------- ----------- --------
- -------- Creating Dummy and Setting Ability --------
- Unit - Create 1 Dummy (Ice Beam) for (Owner of ThunderCaster) at (ThunderPoint offset by EffectPoint towards (Facing of ThunderCaster) degrees) facing Default building facing degrees
- Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
- Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
- -------- ----------- --------
- -------- Unpausing Caster --------
- Loop - Actions
- Unit - Unpause ThunderCaster
- -------- ----------- --------
- -------- Clearing Leak --------
- Custom script: call RemoveLocation(udg_ThunderPoint)
- Set ThunderCaster = No unit
- -------- ----------- --------
- Events