Needing to Control a Certain Amount of Points

D

Digaag Wa Riz

Yeah, I know the title is not very straightforward. I have an idea for a gametype but I don't know how to make it work. Basically, there is a central control point. When either team captures it, they win. It does not start out locked but neither team is able to capture it. In order to be able to capture it, each team must take control of at least 3 of the various control points scattered around the main point.

*I don't need help with this part*
When a point is captured it becomes locked for 30 seconds to prevent it from just being captured by the other team, after which it may be captured.

*I need help with this part*
When a team has less than 3 points owned, they cannot capture the central control point. When they have 3 or more they can. So, if RED owns 4 points and BLU owns none, then RED can capture the central control point but BLU cannot. I don't know how to make it so that when a team has less than 3 points the central point becomes unavailable to capture for THEM, but once they have enough of the other points they can.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,670
To control who can capture the points, use the SetTeamCanCap input to the trigger_capture_area. For tracking the ownership, what swordfish said will work, but if your points start unowned (rather than 2/2 split) remember to account for that using one-time outputs. You'll also need the counter linked to logic_compare.
 
D

Digaag Wa Riz

Use a math_counter for each team. Add one each time a point is captured, remove one each time it's lost. When it hits 3, unlock the central point.

If I do that then the central point will be unlocked once a point has been captured three times and will stay unlocked since there's no way of relocking them. There are actually more than 3 small points anyway (five, to be exact). Basically, if a team controls 3 or more points at any time they can capture the central point but any less and they cannot.

To control who can capture the points, use the SetTeamCanCap input to the trigger_capture_area. For tracking the ownership, what swordfish said will work, but if your points start unowned (rather than 2/2 split) remember to account for that using one-time outputs. You'll also need the counter linked to logic_compare.

I could make it work if I knew how to set the value that I will compare to the compare value (which would be 3) as whatever value the math_counter currently has.
 
Last edited by a moderator:
D

Digaag Wa Riz

math_counter has an OutValue output that immediately passes along it's current value whenever it is changed.

What I want to do is set the current value of the math_counter as the value to compare against in the logic_compare. For instance, when RED captures a point, they will gain one on whatever value the logic_compare had before and compare it to 3.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,670
a math_counter for each team set with the following:
Min: 0
Max: 5
Initial: 0 (From the sounds of it, all points start neutral?)
Output|Target|Input
OutValue|logic_compare|SetValueCompare

a logic_compare for each team:
Initial Value: 0
Compare Value: 3

Red's compare should have these outputs:
Output|Target|Input|Parameter
OnLessThan|major trigger_capture_area|SetTeamCanCap|2 0
OnEqual|major trigger_capture_area|SetTeamCanCap|2 1

Blue's compare should have these outputs:
Output|Target|Input|Parameter
OnLessThan|major trigger_capture_area|SetTeamCanCap|3 0
OnEqual|major trigger_capture_area|SetTeamCanCap|3 1

Each of the five minor trigger_capture_area should have the following:
Output|Target|Input|Parameter|
OnCapTeam1|redmathcounter|Add|1
OnCapTeam2|bluemathcounter|Add|1
OnEndCap| !self |AddOutput|OnCapTeam1 bluemathcounter:Subtract:1| Only Once
OnEndCap| !self |AddOutput|OnCapTeam2 redmathcounter:Subtract:1| Only Once

You need the AddOutputs so subtraction only occurs after the first capture, since that one won't be taking the point from anyone. You could alternatively do it with relays that turn on, but then you'd end up with ten of them.
 
Last edited: