- Joined
- Oct 9, 2011
- Messages
- 101
My spell causes the game to lag after a few casts and I can't find the leak. Just started modding again after a few years and maybe I forgot something. Please help me know what's the cause of the lag.
-
Attack Loop
-
Events
- Time - Every 0.10 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in Attack_UnitGroup and do (Actions)
-
Loop - Actions
- Set TempUnit = (Picked unit)
- Set ID = (Custom value of TempUnit)
- Set TempPlayer = (Owner of TempUnit)
-
Set Attack_Duration[ID] = (Attack_Duration[ID] - 0.10)
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Attack_Duration[ID] Equal to (==) 0.50
-
Then - Actions
- Unit - Pause Attack_Caster[ID]
- Else - Actions
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Attack_Duration[ID] Less than or equal to (<=) 0.00
-
Then - Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Attack_Combo[ID] Equal to (==) 1
-
Then - Actions
-
Set TempReal = 0.00
-
Do Multiple ActionsFor each (Integer Attack_RangeIncrement[ID]) from 1 to 5, do (Actions)
-
Loop - Actions
- Set TempReal = (TempReal + Attack_Range[ID])
- Set Attack_DamagePoint[ID] = (Attack_Point[ID] offset by TempReal towards Attack_Angle[ID] degrees)
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within Attack_Radius[ID] of Attack_DamagePoint[ID]) and do (Actions)
-
Loop - Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Multiple ConditionsAnd - All (Conditions) are true
-
Conditions
- ((Picked unit) belongs to an enemy of TempPlayer) Equal to (==) True
- ((Picked unit) is alive) Equal to (==) True
-
Conditions
-
Multiple ConditionsAnd - All (Conditions) are true
-
Then - Actions
- Unit Group - Add (Picked unit) to Attack_DamageGroup[ID]
- Sound - Play MetalMediumSliceFlesh3 <gen> at 100.00% volume, attached to (Picked unit)
- Else - Actions
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in Attack_DamageGroup[ID] and do (Actions)
-
Loop - Actions
- Unit - Cause TempUnit to damage (Picked unit), dealing Attack_Damage[ID] damage of attack type Hero and damage type Normal
-
Loop - Actions
-
Loop - Actions
-
Do Multiple ActionsFor each (Integer Attack_RangeIncrement[ID]) from 1 to 5, do (Actions)
- Unit Group - Remove all units from Attack_DamageGroup[ID]
- Custom script: call DestroyGroup(udg_Attack_DamageGroup[udg_ID])
-
Set TempReal = 0.00
-
Else - Actions
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within Attack_Radius[ID] of Attack_DamagePoint[ID]) and do (Actions)
-
Loop - Actions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Multiple ConditionsAnd - All (Conditions) are true
-
Conditions
- ((Picked unit) belongs to an enemy of TempPlayer) Equal to (==) True
- ((Picked unit) is alive) Equal to (==) True
-
Conditions
-
Multiple ConditionsAnd - All (Conditions) are true
-
Then - Actions
- Sound - Play MetalMediumSliceFlesh3 <gen> at 100.00% volume, attached to (Picked unit)
- Unit - Cause TempUnit to damage (Picked unit), dealing Attack_Damage[ID] damage of attack type Hero and damage type Normal
- Else - Actions
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
If - Conditions
- Set Attack_IsAttacking[ID] = False
- Unit - Unpause Attack_Caster[ID]
- Custom script: call RemoveLocation(udg_Attack_DamagePoint[udg_ID])
-
Unit Group - Remove TempUnit from Attack_UnitGroup
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Attack_UnitGroup is empty) Equal to (==) True
-
Then - Actions
- Trigger - Turn off Attack Loop <gen>
- Else - Actions
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in Attack_UnitGroup and do (Actions)
-
Events
Last edited: