Needing to Control a Certain Amount of Points

Discussion in 'Mapping Questions & Discussion' started by Digaag Wa Riz, Jun 6, 2013.

  1. Digaag Wa Riz

    Digaag Wa Riz L3: Member

    Messages:
    121
    Positive Ratings:
    84
    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.
     
  2. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    4,113
    Positive Ratings:
    6,077
    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.
     
  3. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    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.
     
  4. Digaag Wa Riz

    Digaag Wa Riz L3: Member

    Messages:
    121
    Positive Ratings:
    84
    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.

    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: Jun 6, 2013
  5. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    math_counter has an OutValue output that immediately passes along it's current value whenever it is changed.
     
  6. Digaag Wa Riz

    Digaag Wa Riz L3: Member

    Messages:
    121
    Positive Ratings:
    84
    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.
     
  7. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    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?)
    Column 1 Column 2 Column 3
    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:
    Column 1 Column 2 Column 3 Column 4
    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:
    Column 1 Column 2 Column 3 Column 4
    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:
    Column 1 Column 2 Column 3 Column 4 Column 5
    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.
     
    • Thanks Thanks x 1
    Last edited: Jun 7, 2013