Alternate path for Payload breaking HUD?

ThatGreenSpyGuy

L1: Registered
Oct 6, 2019
35
4
Recently getting back into mapping and messing with one feature, alternate paths.
Essentially, on regular control point cap, payload cart's direction is overridden with an alternate path node, which diverts to a DIFFERENT checkpoint which later converges with the main path to the next.
I got the functionality to work perfectly, but the HUD (unsurprisingly) does not like this one bit.
When the alternate path is toggled, the HUD shows the cart back at start. It eventually does fix itself but only when approaching the next checkpoint.
I know it's a long-shot, but would anyone know of any solution to this? I guess to force the HUD to remain intact, since updating it isn't an option? Just curious.
Screenshot 2024-10-14 030224.png
 

Evatron

L2: Junior Member
Oct 23, 2021
51
1
is this happening consistently? i have had HUD's break randomly when i get experimental like this but it often fixes itself on map reset.
 

ThatGreenSpyGuy

L1: Registered
Oct 6, 2019
35
4
is this happening consistently? i have had HUD's break randomly when i get experimental like this but it often fixes itself on map reset.
Yeah it's happening consistently 100% of the time. It appears normal until the map toggles the Alternate path_track, and then the HUD resets the cart to the beginning and does not move until I approach the next next checkpoint.
 

Blade x64

Logical insanity
aa
Sep 3, 2009
247
637
plhud1.jpg

Starting out, everything's fine.

plhud2.jpg

When we enable the alternate path, the payload icon teleports back to start. Why?

If you push the payload forward a while, you'll see it starts making progress again. If you disable the alternate path, it'll jump forward. So, it's using old lengths to determine relative progress. We did just double the track length without telling the gamemode, after all.

Fortunately, we're able to get the game to recalculate this. This can be done with an Enable or RoundActivate input to the team_train_watcher.

plhud3.jpg

We see the payload has progress now, but the Control Point positions did not update. How could we do that?

If the hud is ever reloaded (resolution change, hud_reloadscheme, rejoining), the positions will update. Not exactly good solutions, so perhaps there's some call we can make. After 8 hours of rummaging, turns out there is! So we use our fancy new vscript call to fire a game event that causes a Control Point update.

plhud4.jpg

Success! Positions are updated. But where'd the second point go?

If you crack open the team_train_watcher, you'll see it has linked PathTracks defined for each of the points. One of which isn't reachable anymore - whoops! So we update that, RoundActivate again, and call our vscript.

plhud5.jpg

Success! For real this time!

Here's the magic sauce. Side effects are possible.

payload_trackswitch_logic.png
 

ThatGreenSpyGuy

L1: Registered
Oct 6, 2019
35
4
This was very interesting! I tried implementing it in a couple of different ways and kind of got it to work. Although, there were a couple of issues;
  • It doesn't work consistently, and always seems to break during a second round
  • the original second checkpoint remains on the map and sometimes stays even into the next round on the HUD

I really do appreciate your reply though, I was pleasantly surprised to see that it even is somewhat doable :D
 

Blade x64

Logical insanity
aa
Sep 3, 2009
247
637
Not seeing that issue. There's only one team_control_point for cp_two. The alternate is merely a dynamic prop set up to mimic the real one. It's a headache to deal with more team_control_points than absolutely necessary.
 

Attachments

  • test_altpath.vmf
    68.8 KB · Views: 3

ThatGreenSpyGuy

L1: Registered
Oct 6, 2019
35
4
I also actually have another issue; I wanted to trigger the Altpath by having BLU cap a regular control point, but I can't get the HUD to switch over from Payload. Enabling/Disabling the watcher or trying to use the same Vscript line to force a HUD update or whatever seems to do absolutely nothing.
 

ThatGreenSpyGuy

L1: Registered
Oct 6, 2019
35
4
It took my quite a while to set everything up since this is my first time ever using Vscript, but holy shit I got it working perfectly! I've implemented this in an older project of mine that needed a function like this and everything is seamless, thank you so so much!