minikrampan
Ultra Cool Member
- Reaction score
- 28
Hey, I am just building a spell for fun. But it starts to lagg after a while and i don't know why. Help me find the leak or whatever it is.
I was thinking it is the unit group but woulnt destroying it cause the spell to malfunction?
I know the Target-point is not being removed but the spell isnt finished yet.
and it shouldnt leak if i don't move the point right?
And it isnt the nova spawn either because if i change so it spawns every 5 seconds it works fine but after something like 10 pulses it starts lagging.
Or is it just to much stuff going on at the same time?
I was thinking it is the unit group but woulnt destroying it cause the spell to malfunction?
Trigger:
- Spell
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Spell
- Actions
- Set Target = (Target point of ability being cast)
- Set Castingunit = (Casting unit)
- Set Timer = 0.00
- Set Timer2 = 0.03
- Environment - Create a 0.01 second Permanent crater deformation at Target with radius 400.00 and depth -500.00
- Events
Trigger:
- Timer
- Events
- Time - Every 0.03 seconds of game time
- Conditions
- Actions
- Set Timer = (Timer + Timer2)
- If (Timer2 Less than 3.00) then do (Set Timer2 = (Timer2 + 0.01)) else do (Do nothing)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Timer Greater than or equal to 200.00
- Then - Actions
- For each (Integer A) from 1 to 45, do (Actions)
- Loop - Actions
- If (anglecounter Equal to 360) then do (Set anglecounter = 0) else do (Set anglecounter = (anglecounter + 8))
- Unit - Create 1 dummy Fire for (Owner of Castingunit) at Target facing Default building facing (270.0) degrees
- Unit - Set the custom value of (Last created unit) to anglecounter
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit Group - Add (Last created unit) to unit_group
- Loop - Actions
- Set Timer = 0.00
- For each (Integer A) from 1 to 45, do (Actions)
- Else - Actions
- If - Conditions
- Unit Group - Pick every unit in unit_group and do (Actions)
- Loop - Actions
- Set temp_point2 = (Position of (Picked unit))
- Set temp_point = (temp_point2 offset by 5.00 towards (Real((Custom value of (Picked unit)))) degrees)
- Unit - Move (Picked unit) instantly to temp_point
- Custom script: call RemoveLocation(udg_temp_point)
- Custom script: call RemoveLocation(udg_temp_point2)
- Loop - Actions
- Events
I know the Target-point is not being removed but the spell isnt finished yet.
and it shouldnt leak if i don't move the point right?
And it isnt the nova spawn either because if i change so it spawns every 5 seconds it works fine but after something like 10 pulses it starts lagging.
Or is it just to much stuff going on at the same time?