- Joined
- Aug 29, 2008
- Messages
- 325
Hi fellow hivers, I made a lightning move system that makes my map to lag, so naturally I know it must be leaking, but i have no idea what is leaking so much so if you please could help me i would be very glad.
-
Move Lightning
-
Events
-
Time - Every 0.01 seconds of game time
-
-
Conditions
-
Actions
-
Set UnitG = (Units in (Playable map area) matching (((Matching unit) has buff Time Ray ) Equal to True))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in UnitG) Greater than 0
-
-
Then - Actions
-
Unit Group - Pick every unit in UnitG and do (Actions)
-
Loop - Actions
-
Custom script: local real lx1
-
Custom script: local real ly1
-
Custom script: local real lz1
-
Custom script: local real lx2
-
Custom script: local real ly2
-
Custom script: local real lz2
-
Set PU = (Picked unit)
-
Set LPU = (Position of PU)
-
Custom script: set udg_Handle = udg_PU
-
Set TU = (Load 22 of (Key Handle) in Arcanum_Race)
-
Set LTU = (Position of TU)
-
Custom script: set lx1 = GetUnitX(udg_TU)
-
Custom script: set ly1 = GetUnitY(udg_TU)
-
Custom script: set lz1 = 75
-
Custom script: set lx2 = GetUnitX(udg_PU)
-
Custom script: set ly2 = GetUnitY(udg_PU)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(PU is A flying unit) Equal to True
-
-
Then - Actions
-
Custom script: set lz2 = GetLocationZ(GetUnitLoc(udg_PU)) + GetUnitFlyHeight(udg_PU) + 50
-
-
Else - Actions
-
Custom script: set lz2 = 50
-
-
-
Set Lightning = (Load 20 of (Key Handle) in Arcanum_Race)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(PU is A flying unit) Equal to True
-
-
Then - Actions
-
Custom script: call MoveLightningEx(udg_Lightning,true,lx1,ly1,lz1,lx2,ly2,lz2)
-
-
Else - Actions
-
Custom script: call MoveLightningLoc(udg_Lightning,GetUnitLoc(udg_PU),udg_LTU)
-
-
-
Set Lightning = (Load 21 of (Key Handle) in Arcanum_Race)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(PU is A flying unit) Equal to True
-
-
Then - Actions
-
Custom script: call MoveLightningEx(udg_Lightning,true,lx1,ly1,lz1,lx2,ly2,lz2)
-
-
Else - Actions
-
Custom script: call MoveLightningLoc(udg_Lightning,GetUnitLoc(udg_PU),udg_LTU)
-
-
-
Custom script: call DestroyGroup(udg_UnitG)
-
-
-
-
Else - Actions
-
-
Custom script: call DestroyGroup(udg_UnitG)
-
-