Skip to content

sv_pure 1 and You

Sloofy edited this page Feb 6, 2022 · 12 revisions

Despite what this mod may tell you, you can have all your hard work appear in Valve servers! Hooray! Bad news: It can only be done using a custom HUD. Boo. This is because HUDs have a process to allow their own custom textures replace some vanilla assets. You may recognize it from how certain HUDs have custom objective icons (ex. carts, capture points, etc). By employing the same method, we can have the class portraits use our own textures!

Because you most likely have your own HUD that has its own preloading rules, steer carefully.

Get the materials in place

Firstly, let's talk importing our textures into the HUD we want. Normally, we would need to drop in Valve Material Files (.vmts), and mess with those. Inside those .vmts, we also need to change the directory of the requested textures. It's a tedious process for every single class. Fortunately, you can download the contents of this repo and use it as a base so you don't need to do that work.

  1. Begin by navigating to tf/custom/. Make a folder with whatever the HUD's name is going to be. This could be something as simple as [YOURMOD]-hud-ver. But seriously, this can be anything.
  2. Using the repo as a base, drop in the materials folder and resource folder into your newly created HUD.
  3. Inside those .vmts files I mentioned earlier, the directory specifies every texture belonging to tf/custom/[YOURHUD]/materials/vgui/replay/thumbnails/. So, locate that directory and drop all of our .vtfs files into this folder.

To understand to great lengths what everything does, resource/ui/hudplayerclass.res is telling the game, "Okay, the image we are requesting for PlayerStatusClassImage belongs to /materials/hud/. We need this image because the player is in-game and we need to render the class they're playing as in the bottom-left." In that directory that hudplayerclass.res is calling, the .vmts in /materials/hud/ are saying, "Got it! Our textures are in materials/vgui/replay/thumbnails/, however. Look there, instead!" This particular path is how many other HUD authors store their own custom textures as a form of "sv_pure bank", I like to call it. Now, our textures have been called, and we can load into an sv_pure 1 server without many issues.

You may also begin to notice that you can probably do this to other HUDs as well. And that you can! You just need to port materials/ over to your desired custom HUD. Simple as! More on importing assets to another HUD in another chapter.

Caveats

I lied. There are issues, but not many. The problem you will face is an issue that occurs after you connect to the server. On your first connection to the server, you will be able to render your class portraits without any issues! This texture is persistent, and will be maintained until the game is closed. Key word is "persistent", as after you connect to a new server (or rejoin, or whatever), then the game will no longer produce new textures from your HUD. Instead, it will use the vanilla ones. Why? No clue. But if you decide to join a sv_pure 0 server or render every texture some other way (Disguising as Spy, for example), then all's dandy.