With the advent of weapon script editing to modify projectile explosions and sounds, I've theorized that it was possible to change the crosshairs of weapons. Sure enough, it's an easy step up from HUD-based VTF crosshairs, and it expands the customization options of VTF crosshairs dramatically since the scripts reference a splicing utility that lets you crop multiple crosshairs from one VTF file.
NOTE: This will only work in sv_pure 2 if you place your .vmt and .vtf files in folders that aren't cross-referenced with the default folders for validation, such as materials/vgui/replay/thumbnails.
The optimal format I've found for VTF's is:
Format: RGBA8888
Size: 32x32 and up
Necessary checked VTF flags for color preservation:
No Mipmap
No Level Of Detail
No Minimum Mipmap
Eight Bit Alpha (Format Specific)
Optional checked VTF flags:
SRGB (try it if the color quality is low for some reason)
Point Sample (thanks to JarateKing for the explanation -- "makes resizing pixelated rather than blurry")
The rest of the flags should remain unchecked.
Step 1. Place your .vmt and .vtf in materials/vgui/replay/thumbnails. Make sure your vmt references your vtf.
Step 2. In your weapon script (for example, tf_weapon_scattergun.txt), point your desired crosshair file like so:
"crosshair"
{
"file" "vgui/replay/thumbnails/DESIRED_VMT_NAME_HERE"
"x" "0"
"y" "0"
"width" "MAX_WIDTH_OF_VTF_FILE"
"height" "MAX_HEIGHT_OF_VTF_FILE"
}
If you aren't cropping a specific portion of your crosshair, just specify your "x" and "y" as 0, and your "width" and "height" as the sizes of the vtf (the width and height of your vtf should be scaled by powers of 2).
If you want to jam-pack a bunch of crosshairs in one vtf file, then it's relatively easy to figure out. Just look at the sprites/crosshairs file in the "tf2_textures_dir" vpk and work back from there.
For instance, everyone knows about the sniper/spy crosshair being off-centered. If you lower the "y" value of the sniper rifle script file's crosshair to -1, you can fix this. In fact, you can modify the position, width, and height to be spliced from the default crosshairs without needing to worry about sv_pure.
Example: If you like the default crosshair for the scattergun but don't like the default crosshair for the pistol, just copy over the "x", "y", "width", and "height" values from the scattergun script to the pistol script while referencing the sprites/crosshairs file.
The "x" and "y" specify the location on the vtf file to begin cropping from. The "width" and "height" specify the boundaries from that location.
Step 3. Load the game, set your crosshair type to "none", and enjoy your custom VTF crosshair. You can resize & recolor it in game without preloading or editing resource files & calling hud_reloadscheme.
The biggest benefit overall from doing this over using a typical HUD vtf crosshair (or, god forbid, a text-based crosshair) is that it is resolution independent. If the VTF is centered (or if you crop the VTF in such a manner that it will be centered), then your crosshair will be centered in-game, period.
I've linked my custom folder below.
Feel free to use the crosshairs in the flamehud-master\materials\vgui\replay\thumbnails folder (FULL CREDIT TO WATSON FOR ALL THE PRETTY CROSSHAIRS), and feel free to modify my weapon scripts in the scripts folder to your liking. Note that I've removed tracers on most of the hitscan weapons by pointing their particle materials to null and changed a bunch of hud elements for increased visibility, so if you don't like that, then just use it as a basis to modify your own script files.
Not all of my VTF files have the proper flags set. Go ahead and tweak those if you want to use anything but GreenDotBlackOutlineGreenCircle (the best crosshair in the universe...)
I don't have the scripts for every single weapon in the game (I only use stock anyway), and the only one I've modified to include a custom crosshair is the scattergun script. Again, please reference the "no explosion effect" threads to figure out how to extract more scripts.
https://www.dropbox.com/s/bbaig6g9d654z80/custom.zip?dl=0
also plz dont let truetf2 know about this they are bigots and baned me so they deserve 2 die..
p.s. i'm not going to draw or clean up your favorite crosshair from a random picture or frag video (just trace an image of it; it's just fucking pixel art lol). however, feel free to post your vtf's here to either share or get help with (but please put in a modicum of effort before you do so).
update:
joshuawnjust a quick tip when it comes to VMT customization (e.g. swapping VTF's, experimenting with material proxies to create animated crosshairs &/or multi-frame VTF crosshairs): you don't need to restart the game to swap crosshairs. although modifications to the weapon script itself won't take effect until you restart, you can modify the VMT file as long as you're in a server with sv_cheats 1 enabled (ideally local) and then call mat_reloadallmaterials in console. alternately, you can use mat_showtextures, find the line relevant to your crosshair [hereby referred to as CROSSHAIR_PATH], and then type in mat_reloadmaterial CROSSHAIR_PATH