- Joined
- Mar 17, 2012
- Messages
- 582
Hello everyone! I have a small issue with gates that I haven't seen before.
Whenever I open and close the gate via triggers, it stops blocking units, they can walk through it.
Maybe you could help me to find the solution.
Here are the triggers:
open
close
off
Thanks in advance!
Whenever I open and close the gate via triggers, it stops blocking units, they can walk through it.
Maybe you could help me to find the solution.
Here are the triggers:
open
-
Gate Open Red
-
Events
- Unit - A unit enters Farm Gate Red <gen>
-
Conditions
-
And - All (Conditions) are true
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
And - All (Conditions) are true
-
Conditions
- (Owner of (Triggering unit)) Equal to Player 1 (Red)
- (Unit-type of (Triggering unit)) Equal to Peasant
-
Conditions
- (Unit-type of (Triggering unit)) Equal to Thief
-
And - All (Conditions) are true
-
Conditions
- (Current life of Gate[1]) Greater than 0.00
-
Or - Any (Conditions) are true
-
Conditions
-
And - All (Conditions) are true
-
Actions
- Set Gate_Health[1] = (Current life of Gate[1])
- Destructible - Open Gate[1]
- Destructible - Set life of Gate[1] to Gate_Health[1]
-
Events
-
Gate Close Red
-
Events
- Unit - A unit leaves Farm Gate Red <gen>
-
Conditions
-
And - All (Conditions) are true
-
Conditions
- (Owner of (Triggering unit)) Equal to Player 1 (Red)
- (Unit-type of (Triggering unit)) Equal to Peasant
- (Current life of Gate[1]) Greater than 0.00
-
Conditions
-
And - All (Conditions) are true
-
Actions
- Set Gate_Red_Group = (Units in Farm Gate Red <gen> matching ((((Matching unit) is A structure) Not equal to True) and ((Owner of (Matching unit)) Equal to Player 1 (Red))))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in Gate_Red_Group) Equal to 0
-
Then - Actions
- Set Gate_Health[1] = (Current life of Gate[1])
- Destructible - Close Gate[1]
- Destructible - Close Gate[1]
- Destructible - Set life of Gate[1] to Gate_Health[1]
- Else - Actions
-
If - Conditions
- Custom script: call DestroyGroup(udg_Gate_Red_Group)
-
Events
-
Gate off Red
-
Events
- Destructible - A destructible within Farm Gate Red <gen> dies
-
Conditions
-
And - All (Conditions) are true
-
Conditions
- (Dying destructible) Equal to Gate[1]
-
Or - Any (Conditions) are true
-
Conditions
- (Unit-type of (Killing unit)) Equal to Peasant
- (Unit-type of (Killing unit)) Equal to Thief
-
Conditions
-
Conditions
-
And - All (Conditions) are true
-
Actions
- Trigger - Turn off Gate Open Red <gen>
- Trigger - Turn off Gate Close Red <gen>
-
Events