Updating Payload HUD capture number without having someone actively capping the point

Discussion in 'Mapping Questions & Discussion' started by Sappykun, Nov 25, 2019.

  1. Sappykun

    Sappykun L1: Registered

    Messages:
    5
    Positive Ratings:
    0
    TL;DR: I want to control the capture counter on the Payload HUD (the displayed number of people actively capturing the point) with an arbitrary number at any point in time. How would I accomplish this?

    ----

    I am planning a map where the cart can move without having a player in the capture area, similar to wacky_races. The player stands in a trigger_multiple, which increments the speed of the cart by 10 every second up to 200. When there is nobody in the trigger, the speed drops by 10 every second down to 0.

    I want to use the PLR HUD to show the progress of the carts. This works for showing the position and speed of the carts, but I want to go one step further and use the HUD to show a numerical representation of the cart's speed. wacky_races accomplishes this by using game_text entities whenever the cart reaches a certain speed, but I don't like this approach.

    I would like the capture number to change whenever the cart reaches a certain speed. Would I be able to change this number without a trigger_capture_area? If I do need a trigger_capture_area, can I use entities other than players to increment the counter? That way, I can stick the actual cap zones out of the map and use fake entities to increment/decrement the counter as the cart's speed changes.
     
  2. 14bit

    aa 14bit L14: Bit Member

    Messages:
    286
    Positive Ratings:
    885
    As far as I'm aware, the capture numbers are hard-coded to be the number of players inside the actual capture trigger, plus one for each scout and pain train-wielding soldier and demoman. There is no known way to override these numbers from inside a map without modding the game or creating a server plugin.

    The easiest thing is to just use game_text entities like you mentioned.

    The better looking option would probably be to use env_screenoverlays with custom textures, like what Snowplow uses for it's train damge HUD. You'd have to create a bunch of unique env_screenoverlays for every possible combination of values and do a ton of fancy logic, since TF2 can only display one at a time.

    The most difficult option is that it might be possible is to heavily modify the PD HUD with a custom .res file, and use the score bars from that to represent speed/player numbers. However, this would require a ridiculous amount of work to override everything else the PD entities do, and I'm not even sure if you can remove points after giving them to a team. There's very not much info about PD and overriding it floating around, so you'd need to do a lot of experimentation to see if it's possible, but it's the only useful HUD that we can directly modify and send some inputs to (in the form of scoring points).