Restoring the game hud while in minigame state.

hutty

aa
Mar 30, 2014
542
445
In my work on the sector_control gamemode I have run into a dead end.

I found out that the tf_halloween_minigame entity has an input for a .res file. This is different than the .res file input for tf_logic_player_destruction in a couple ways. Most notably, it allows you to change the .res file for the entity on the fly and the new hud elements will appear immediately.

As you can see this has massive potential for jimijam-rigging custom huds, however there are two problems.

First, I am unable to give it a custom made file. The tf_logic_player_destruction has a full path that needs to be defined for the resource file to be found, but tf_halloween_minigame doesn't, it only looks within resources/ui/ and using ../ or putting your own files in tf/resources/ui do not seem to work.

Secondly, while a minigame is active it removes the standard player hud. The heath, ammo, and crosshair all disappear and a bumpercar boost hud pops up (even if the map has no bumpercar related things in it). The normal player hud will return when the minigame is ended, either via the return_from_minigame input, or by killing the minigame entitles. However doing this also removes the minigame hud.

So, the question is, is there any way to have the player hud and the minigame hud on the screen at the same time.

Is it possible to replace the .res file for the bumpercar hud with the .res file for the standard player hud on map load?

If not, is there another way to hotswap .res files.
 

Benoist3012

L3: Member
Dec 25, 2015
148
207
Funny I actually ran into the same problem with player hud off for my halloween map that I'm making, I looked into game's code, and using tf_halloween_minigame (CTFHalloweenMinigame) isn't a good idea, you should instead use the entity tf_base_minigame (CTFMinigame) which is the base class used by Valve to make their bumper cars minigames, I can't tell right now from the code if the hide hud thing is done by the CTFHalloweenMinigame or the CTFMinigame, but if it's done by the CTFHalloweenMinigame then you should use the tf_base_minigame entity, but if it's done by the CTFMinigame code then there's no work around I think, I'll post more once I find more (you actually made me want to dig again into this :D), but for now try tf_base_minigame entity.
 

hutty

aa
Mar 30, 2014
542
445
I'll look into it, nice to see someone else who went down the minigame rabbit-hole.
 

hutty

aa
Mar 30, 2014
542
445
Alright, its still not working.

For anyone who wants to take a shot at it below is a link is vmf with a bare bones example.

https://drive.google.com/file/d/0B16tFq7OKBQzRjZ3aHk2S3BoZmc/view?usp=sharing
https://drive.google.com/file/d/0B16tFq7OKBQzRjZ3aHk2S3BoZmc/view?usp=sharing
There are number decals on the floor by triggers.
1 starts a minigame.
2 and 3 change the hud files.
4 ends the minigame.
5 is a bumpercar boost zone that resets the fov that the minigame breaks (this doesn't involve actual bumpercars).

The vmf is a (heavily) modified version of this prefab.
https://tf2maps.net/threads/prefab-bumper-karts.23540/