- Joined
- May 21, 2014
- Messages
- 580
The trigger:
Closed gates have a pathing and collision, while open gates do not.
Without the trigger above, the the gates cannot be opened (obviously), AND...
If there is a unit within the opened gate and the gate is commanded to close, and the said unit blocks the pathing of the Closed Gate object, then the gate will move forcefully to another position.
With the tirgger above, I picked units one by one within the pathing of the gate, and Moved them outwards before replacing the gate to a closed one.
The trigger works, but for larger units, the trigger fails.
It seems that the value I specify in the offset value is not enough.
I want the offset value to be variable; I want it to depend on how big the unit is. The bigger the unit, the farther it gets sent away just for the sake the gate wont be moved from its position.
How can I do this? Is there really no way but to use a Hashtable to store EVERY POSSIBLE unit that I have in my map?
-
Close Horizontal Gate 1st tier
-
Events
-
Unit - A unit Begins casting an ability
-
-
Conditions
-
(Ability being cast) Equal to Close
-
(Unit-type of (Casting unit)) Equal to Gate (horizontal,open)
-
-
Actions
-
Set ClosingHorizontalGate1stPoint = (Position of (Casting unit))
-
Set ClosingHorizontalGate1stRegion = (Region centered at ClosingHorizontalGate1stPoint with size (ValueHorizontalGateWidth, ValueHorizontalGateHeight))
-
Set ClosingHorizontalGate1stGroup = (Units in ClosingHorizontalGate1stRegion matching ((Matching unit) Not equal to (Casting unit)))
-
Unit Group - Pick every unit in ClosingHorizontalGate1stGroup and do (Actions)
-
Loop - Actions
-
Set ClosingHorizontalGate1stPUPos = (Position of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
(Angle from ClosingHorizontalGate1stPoint to ClosingHorizontalGate1stPUPos) Greater than or equal to 0.00
-
(Angle from ClosingHorizontalGate1stPoint to ClosingHorizontalGate1stPUPos) Less than 180.00
-
-
-
-
Then - Actions
-
Unit - Move (Picked unit) instantly to (ClosingHorizontalGate1stPUPos offset by 100.00 towards 90.00 degrees)
-
-
Else - Actions
-
Unit - Move (Picked unit) instantly to (ClosingHorizontalGate1stPUPos offset by 100.00 towards 270.00 degrees)
-
-
-
Custom script: call RemoveLocation(udg_ClosingHorizontalGate1stPUPos)
-
Custom script: set udg_ClosingHorizontalGate1stPUPos = null
-
-
-
Custom script: call RemoveRect(udg_ClosingHorizontalGate1stRegion)
-
Custom script: set udg_ClosingHorizontalGate1stRegion = null
-
Custom script: call DestroyGroup(udg_ClosingHorizontalGate1stGroup)
-
Custom script: set udg_ClosingHorizontalGate1stGroup = null
-
Custom script: call RemoveLocation(udg_ClosingHorizontalGate1stPoint)
-
Custom script: set udg_ClosingHorizontalGate1stPoint = null
-
Unit - Replace (Casting unit) with a Gate (horizontal,close) using The old unit's relative life and mana
-
Unit Group - Add (Last replaced unit) to PlayerUnits
-
Unit Group - Add (Last replaced unit) to Walls
-
Player Group - Pick every player in PlayerGroupUser and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Triggering unit) is selected by (Picked player)) Equal to True
-
-
Then - Actions
-
Selection - Add (Last replaced unit) to selection for (Picked player)
-
-
Else - Actions
-
-
-
-
-
Closed gates have a pathing and collision, while open gates do not.
Without the trigger above, the the gates cannot be opened (obviously), AND...
If there is a unit within the opened gate and the gate is commanded to close, and the said unit blocks the pathing of the Closed Gate object, then the gate will move forcefully to another position.
With the tirgger above, I picked units one by one within the pathing of the gate, and Moved them outwards before replacing the gate to a closed one.
The trigger works, but for larger units, the trigger fails.
It seems that the value I specify in the offset value is not enough.
I want the offset value to be variable; I want it to depend on how big the unit is. The bigger the unit, the farther it gets sent away just for the sake the gate wont be moved from its position.
How can I do this? Is there really no way but to use a Hashtable to store EVERY POSSIBLE unit that I have in my map?