Kitt
New Member
- Reaction score
- 5
Alright, what i'm making is a gate that opens itself when an allied unit comes close, and closes when it leaves. I have two triggers, one to detect when they're near and play an animation (opening animation) and one to detect when no allied unit is near, and play and animation (closing animation).
The open trigger works perfectly, however, the closing trigger never closes the gate.
Open trigger:
Close Trigger:
Any advice?
Mrow.
The open trigger works perfectly, however, the closing trigger never closes the gate.
Open trigger:
Code:
Open Gate
Events
Unit - A unit enters (Region centered at (Position of Orc Gate (north) 0005 <gen>) with size (400.00, 100.00))
Conditions
Or - Any (Conditions) are true
Conditions
(Owner of (Entering unit)) Equal to Player 1 (Red)
(Owner of (Entering unit)) Equal to Player 4 (Purple)
(Owner of (Entering unit)) Equal to Player 5 (Yellow)
(Owner of (Entering unit)) Equal to Player 6 (Orange)
Actions
Animation - Play Orc Gate (north) 0005 <gen>'s Death Alternate animation
Close Trigger:
Code:
Close Gate
Events
Unit - A unit leaves (Region centered at (Position of Orc Gate (north) 0005 <gen>) with size (400.00, 100.00))
Conditions
Actions
Unit Group - Pick every unit in (Units in (Region centered at (Position of Orc Gate (north) 0005 <gen>) with size (400.00, 100.00))) and do (Actions)
Loop - Actions
-------- If any Unit is an Orc Unit --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Owner of (Picked unit)) Equal to Player 1 (Red)
(Owner of (Picked unit)) Equal to Player 4 (Purple)
(Owner of (Picked unit)) Equal to Player 5 (Yellow)
(Owner of (Picked unit)) Equal to Player 6 (Orange)
Then - Actions
Set Orc_KeepGateOpen = True
Else - Actions
Do nothing
If (Orc_KeepGateOpen Equal to False) then do (Animation - Play Orc Gate (north) 0005 <gen>'s Stand animation) else do (Do nothing)
Set Orc_KeepGateOpen = False
Any advice?
Mrow.