- Joined
- May 16, 2020
- Messages
- 660
Hi guys,
In my map I will have 6-8 different gates, which I want to open/close when specific units are nearby/are no longer nearby. The two triggers below work for what I want, but since I would need to create 2 triggers for every gate I end up with 12-16 triggers for just this function, which in my opinion is inefficient.
Also, when some of the gates are open and some closed, my hero takes an inefficient path to the gates which are open, instead of through the closest gates which would would open for him.
So 2 questions:
In my map I will have 6-8 different gates, which I want to open/close when specific units are nearby/are no longer nearby. The two triggers below work for what I want, but since I would need to create 2 triggers for every gate I end up with 12-16 triggers for just this function, which in my opinion is inefficient.
Also, when some of the gates are open and some closed, my hero takes an inefficient path to the gates which are open, instead of through the closest gates which would would open for him.
So 2 questions:
- Is it possible to condense these triggers for every door on the map?
- Is it possible for units to treat the gate as "open", even when it's closed?
-
Gate Enter
-
Events
- Unit - A unit enters Gate North <gen>
-
Conditions
- Gate_Boolean[1] Equal to False
-
Or - Any (Conditions) are true
-
Conditions
- (Owner of (Triggering unit)) Equal to Player 1 (Red)
-
And - All (Conditions) are true
-
Conditions
- ((Triggering unit) is A Hero) Equal to True
- ((Triggering unit) belongs to an ally of Player 1 (Red).) Equal to True
-
Conditions
-
Conditions
-
Actions
- Set VariableSet Gate_Boolean[1] = True
- Destructible - Open Gate[1]
-
Events
-
Gate Exit
-
Events
- Unit - A unit leaves Gate North <gen>
-
Conditions
- Gate_Boolean[1] Equal to True
- (Number of units in (Units in Gate North <gen>)) Equal to 0
-
Or - Any (Conditions) are true
-
Conditions
- (Owner of (Triggering unit)) Equal to Player 1 (Red)
-
And - All (Conditions) are true
-
Conditions
- ((Triggering unit) is A Hero) Equal to True
- ((Triggering unit) belongs to an ally of Player 1 (Red).) Equal to True
-
Conditions
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
-
Then - Actions
- Set VariableSet Gate_Boolean[1] = False
- Destructible - Close Gate[1]
- Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events