Why does it crash?
This is a spell creating a ring of lightning balls pushing enemies away from the field when they come near (they are pushed out when trying to enter and pushed in when trying to leave) this ring also follows the casting unit.
This spell sometimes make the game crash. Can anyone detect why?
This is a spell creating a ring of lightning balls pushing enemies away from the field when they come near (they are pushed out when trying to enter and pushed in when trying to leave) this ring also follows the casting unit.
This spell sometimes make the game crash. Can anyone detect why?
-
Energy Field
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Energy Field
-
Actions
- Set EnergyFieldCaster = (Triggering unit)
-
For each (Integer A) from 1 to 16, do (Actions)
-
Loop - Actions
- Set PositionSpawnEnergyField1 = (Position of EnergyFieldCaster)
- Set PositionSpawnEnergyField2[(Integer A)] = (PositionSpawnEnergyField1 offset by 525.00 towards ((Real((Integer A))) x 22.50) degrees)
- Unit - Create 1 Energy Field for (Owner of EnergyFieldCaster) at PositionSpawnEnergyField2[(Integer A)] facing Default building facing degrees
- Set EnergyFieldDummy[(Integer A)] = (Last created unit)
-
Loop - Actions
- Trigger - Turn on Energy Field Loop <gen>
- Wait (5.00 + (3.00 x (Real((Level of Energy Field for EnergyFieldCaster))))) seconds
- Trigger - Turn off Energy Field Loop <gen>
-
For each (Integer A) from 1 to 16, do (Actions)
-
Loop - Actions
- Unit - Remove EnergyFieldDummy[(Integer A)] from the game
-
Loop - Actions
-
For each (Integer A) from 1 to EnergyFieldLightningCount, do (Actions)
-
Loop - Actions
- Lightning - Destroy EnergyFieldLightningEffects[(Integer A)]
-
Loop - Actions
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[1])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[2])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[3])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[4])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[5])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[6])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[7])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[8])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[9])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[10])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[11])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[12])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[13])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[14])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[15])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[16])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField1)
-
Events
-
Energy Field Loop
-
Events
- Time - Every 0.04 seconds of game time
- Conditions
-
Actions
-
For each (Integer A) from 1 to EnergyFieldLightningCount, do (Actions)
-
Loop - Actions
- Lightning - Destroy EnergyFieldLightningEffects[(Integer A)]
-
Loop - Actions
- Set EnergyFieldLightningCount = 0
-
For each (Integer A) from 1 to 16, do (Actions)
-
Loop - Actions
- Set EnergyFieldDummyPosition = (Position of EnergyFieldDummy[(Integer A)])
- Set EnergyFieldPushedUnits = (Units within 175.00 of EnergyFieldDummyPosition matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) belongs to an enemy of (Owner of EnergyFieldCaster)) Equal to True) and (((Matching unit) is A structure) Not equal to True))))
-
Unit Group - Pick every unit in EnergyFieldPushedUnits and do (Actions)
-
Loop - Actions
- Set EnergyFieldPushedFrom = (Position of (Picked unit))
- Set EnergyFieldPushedTo = (EnergyFieldPushedFrom offset by 35.00 towards (Angle from EnergyFieldDummyPosition to EnergyFieldPushedFrom) degrees)
- Unit - Move (Picked unit) instantly to EnergyFieldPushedTo
- Lightning - Create a Chain Lightning - Primary lightning effect from source EnergyFieldDummyPosition to target EnergyFieldPushedFrom
- Set EnergyFieldLightningCount = (EnergyFieldLightningCount + 1)
- Set EnergyFieldLightningEffects[EnergyFieldLightningCount] = (Last created lightning effect)
-
Loop - Actions
-
Loop - Actions
- Set PositionSpawnEnergyField1 = (Position of EnergyFieldCaster)
- Unit Group - Remove all units of EnergyFieldPushedUnits from EnergyFieldPushedUnits
-
For each (Integer A) from 1 to 16, do (Actions)
-
Loop - Actions
- Set PositionSpawnEnergyField2[(Integer A)] = (PositionSpawnEnergyField1 offset by 475.00 towards ((Real((Integer A))) x 22.50) degrees)
- Unit - Move EnergyFieldDummy[(Integer A)] instantly to PositionSpawnEnergyField2[(Integer A)]
-
Loop - Actions
- Custom script: call DestroyGroup (udg_EnergyFieldPushedUnits)
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[1])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[2])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[3])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[4])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[5])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[6])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[7])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[8])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[9])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[10])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[11])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[12])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[13])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[14])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[15])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField2[16])
- Custom script: call RemoveLocation (udg_PositionSpawnEnergyField1)
- Custom script: call RemoveLocation (udg_EnergyFieldPushedFrom)
- Custom script: call RemoveLocation (udg_EnergyFieldPushedTo)
- Custom script: call RemoveLocation (udg_EnergyFieldDummyPosition)
-
For each (Integer A) from 1 to EnergyFieldLightningCount, do (Actions)
-
Events