- Joined
- May 11, 2012
- Messages
- 2,108
Any clues on why does this cause game to freeze when even 1 unit gets in range of the spell?
-
Black Hole Loop
-
Events
-
Time - Every 0.03 seconds of game time
-
Unit - A unit Is issued an order targeting an object
-
Unit - A unit Is issued an order targeting a point
-
Unit - A unit Is issued an order with no target
-
-
Conditions
-
Actions
-
For each (Integer BH_Loop) from 1 to BH_MaxIndex, do (Actions)
-
Loop - Actions
-
-------- ------------------------------------------------------------------------------------- --------
-
Set BH_Point = (Position of BH_Dummy[BH_Loop])
-
-------- ------------------------------------------------------------------------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Life of BH_Dummy[BH_Loop]) Less than or equal to 0.41
-
(Ordered unit) Equal to BH_TrigUnit[BH_Loop]
-
-
-
-
Then - Actions
-
-------- ------------------------------------------------------------------------------------- --------
-
Unit - Kill BH_Dummy[BH_Loop]
-
-------- ------------------------------------------------------------------------------------- --------
-
Set BH_TrigUnit[BH_Loop] = BH_TrigUnit[BH_MaxIndex]
-
Set BH_TrigUnit[BH_MaxIndex] = No unit
-
Set BH_Dummy[BH_Loop] = BH_Dummy[BH_MaxIndex]
-
Set BH_Dummy[BH_MaxIndex] = No unit
-
Set BH_DamageUnit[BH_Loop] = BH_DamageUnit[BH_MaxIndex]
-
Set BH_SpellLvl[BH_Loop] = BH_SpellLvl[BH_MaxIndex]
-
Set BH_MaxIndex = (BH_MaxIndex - 1)
-
Set BH_Loop = (BH_Loop - 1)
-
-------- ------------------------------------------------------------------------------------- --------
-
-
Else - Actions
-
Set BH_UnitGroup = (Units within 550.00 of BH_Point matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) belongs to an enemy of (Owner of BH_TrigUnit[BH_Loop])) Equal to True) and ((((Matching unit) is dead) Not equal to True) and (((Matching un
-
-------- ------------------------------------------------------------------------------------- --------
-
Unit Group - Pick every unit in BH_UnitGroup and do (Actions)
-
Loop - Actions
-
-------- ------------------------------------------------------------------------------------- --------
-
Set BH_PickedUnit = (Picked unit)
-
Set BH_Point2 = (Position of BH_PickedUnit)
-
Set BH_Angle = ((Angle from BH_Point to BH_Point2) - 1.00)
-
Set BH_Point3 = (BH_Point offset by ((Distance between BH_Point and BH_Point2) - 7.00) towards BH_Angle degrees)
-
-------- ------------------------------------------------------------------------------------- --------
-
Unit - Turn collision for BH_PickedUnit Off
-
-------- ------------------------------------------------------------------------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between BH_Point and BH_Point2) Less than or equal to 75.00
-
-
Then - Actions
-
-------- ------------------------------------------------------------------------------------- --------
-
Unit - Kill BH_PickedUnit
-
-------- ------------------------------------------------------------------------------------- --------
-
-
Else - Actions
-
-------- ------------------------------------------------------------------------------------- --------
-
Unit - Order BH_PickedUnit to Stop
-
Unit - Make BH_PickedUnit face BH_Point over 0.00 seconds
-
Custom script: call SetUnitX(udg_BH_PickedUnit, GetLocationX(udg_BH_Point3))
-
Custom script: call SetUnitY(udg_BH_PickedUnit, GetLocationY(udg_BH_Point3))
-
Unit - Cause BH_TrigUnit[BH_Loop] to damage BH_PickedUnit, dealing BH_DamageUnit[BH_Loop] damage of attack type Spells and damage type Normal
-
-------- ------------------------------------------------------------------------------------- --------
-
-
-
-------- ------------------------------------------------------------------------------------- --------
-
Custom script: call RemoveLocation(udg_BH_Point2)
-
Custom script: call RemoveLocation(udg_BH_Point3)
-
-------- ------------------------------------------------------------------------------------- --------
-
-
-
-------- ------------------------------------------------------------------------------------- --------
-
Custom script: call DestroyGroup(udg_BH_UnitGroup)
-
-------- ------------------------------------------------------------------------------------- --------
-
-
-
-------- ------------------------------------------------------------------------------------- --------
-
Custom script: call RemoveLocation(udg_BH_Point)
-
-------- ------------------------------------------------------------------------------------- --------
-
-
-
-------- ------------------------------------------------------------------------------------- --------
-
Custom script: set udg_BH_Point = null
-
Custom script: set udg_BH_Point2 = null
-
Custom script: set udg_BH_Point3 = null
-
Custom script: set udg_BH_UnitGroup = null
-
-------- ------------------------------------------------------------------------------------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
BH_MaxIndex Equal to 0
-
-
Then - Actions
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-------- ------------------------------------------------------------------------------------- --------
-
-