HUD / CP problems

Discussion in 'Mapping Questions & Discussion' started by mishi, Apr 9, 2014.

  1. mishi

    mishi L1: Registered

    Messages:
    38
    Positive Ratings:
    3
    Im trying to make a 5 CP map with a 2-1-2 structure. So like this:

    Red 1 ----- Red 2

    ------- Mid -------

    Blu 1 ----- Blu 2

    For the red team Red 1 and Red 2 dont have any requirements. Red 1 and Red 2 are needed to cap Mid and Mid is required for Blu 1 and Blu 2. Blu 1 / Blu 2 / Red 1 / Red 2 can all be capped at the same time. It's all the other way round for the blue team.

    Now I have three problems:

    1) Ingame the capping works the way it should, but the HUD doesn't display the 'locked' symbol over the last two points, the HUD only shows the lock on Mid. Screenshot of the CP settings

    2) I want the HUD to show a 2-1-2 structure instead of 1-1-1-1-1, how can I change that?

    3) Blu 1 / 2 or Red 1 / 2 can all be possible final capture points depending on which point is capped first, how can I tell the game when to do the final capture announcement?
     
    Last edited: Apr 9, 2014
  2. takabuschik

    aa takabuschik

    Messages:
    663
    Positive Ratings:
    315
    https://developer.valvesoftware.com/wiki/TF2/Setting_the_cap_point_layout
    This should help with the HUD
    About the cp's, maybe make it like they did on G-pit?
    for the warning you'll need some logic
    my idea (no promise it'll work...) is you can change all the warnings into ambient_generics with the flag that says Play Everywhere (or something like that) turned on
    there should be four: RED_final, BLU_final, RED_normal, BLU_normal

    Playing The Sounds:
    for cp BLU_1 and BLU_2:
    Code:
    OnStartTeam1   BLU_normal   PlaySound
    same for RED but w/ OnStartTeam2


    Changing Sounds to Final ones:
    for cp BLU_1:
    Code:
    OnCapTeam1  BLU_2   AddOutput   OnStartTeam1   BLU_normal   StopSound   0.01
    OnCapTeam1  BLU_2   AddOutput   OnStartTeam1   BLU_final   playsound
    same for BLU_2 w/ replaced names
    same for RED but w/ OnCapTeam2


    Removing Replacements in red/blu recaps
    for cp BLU_1:
    same for BLU_2 w/ replaced names
    same for RED but w/ OnCapTeam1
     
    • Thanks Thanks x 1
    Last edited: Apr 9, 2014
  3. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    For the locking symbols, try sending SetLocked 1 to the two CPs when the middle point is taken, and conversely SetLocked 0 to the other two. For both directions of course.


    For the sounds, takabuschik's idea won't work as it will just keep adding more outputs, and stuff will happen at the same time. You need some logic to keep track of what is owned by who.

    Start by setting every CP except the middle to "no announcements"

    Then make two logic_branch, which are true/false entities that we will use to answer the question "is it the last cp?" You probably already have a tf_gamerules, but if not, make one named whatever.

    logic_branch named: red_last_point
    OnTrue > tf_gamerules > PlayVORed > ControlPoint.CaptureWarn

    logic_branch named: blue_last_point
    OnTrue > tf_gamerules > PlayVOBlue > ControlPoint.CaptureWarn

    Those will let us play the warning sounds to each team when needed.

    EDIT: ignore everything in the quote box and follow the instructions afterward. after a few hours I realized a much simpler way to do it, but I wanted to leave this here if it is useful knowledge to anyone.
    On the trigger_capture_area for both of blue's CPs put:
    Column 1 Column 2 Column 3 Column 4
    OnStartTeam1 blue_last_point Test
    OnCapTeam1 blue_last_point SetValue 1
    OnCapTeam2 blue_last_point SetValue 0


    and likewise on red's:
    Column 1 Column 2 Column 3 Column 4
    OnStartTeam2 red_last_point Test
    OnCapTeam2 red_last_point SetValue 1
    OnCapTeam1 red_last_point SetValue 0


    This will try to play the sound when either point starts being taken, but the branch will only be true(1) if one of the points has already been lost.

    The only thing this can't account for is if both final CPs are being captured at the same time... and there isn't really any good way to handle that because neither one IS the last. Also, it assumed both teams capture both of their own points before the enemy is attempting to get a 4th, because the likelyhood of that not happening seems so low it isn't worth dealing with.
     
    • Thanks Thanks x 3
    Last edited: Apr 9, 2014
  4. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    doublepost because I edited the one above with a better solution.
     
  5. mishi

    mishi L1: Registered

    Messages:
    38
    Positive Ratings:
    3
    [​IMG]

    like this? it didnt work. wouldnt it also set the last 2 points locked only as soon as the middle point gets capped, so that they appear unlocked at the beginning of the match?
     
  6. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    The 1/0 should be flipped I think. OnCapTeam1 is when red takes it, at which point red's (which blue cannot take) should be locked (1), and blue's should be unlocked (0).

    If it doesn't work, you can try using the SetTeamCanCap input sent to the trigger_capture_area itself. The parameter for it is two numbers, team and allowed state. 2 0 = red can not cap. 3 1 = blue can cap. 2 1 = red can cap. The two teams are independent of each other, it is the same as changing the "Can X cap?" keys on the entity.

    I'm not sure what you mean by your question though. Yes it only sets it when the middle is taken. Your previous screenshot showed that all CPs start neutral so they would need to be unlocked to start?
     
  7. mishi

    mishi L1: Registered

    Messages:
    38
    Positive Ratings:
    3
    They start neutral, but until mid is capped Blue/Red should only be able to cap the points next to their spawns. They cant rush over to the other team's base and cap the points there, which should be symbolized by the lock, no?
     
  8. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    Oh, I see what you mean. However I don't think you can help that because the HUD is not team-specific, even if red cannot capture blue's CPs, blue themselves can, and thus they must be shown as unlocked.
     
    • Thanks Thanks x 1
  9. takabuschik

    aa takabuschik

    Messages:
    663
    Positive Ratings:
    315
    Well, now that I think of it, my way wouldn't have worked anyway because ambient_generics are for both teams...