This is the beta public release of a spectating tools plugin I've been working on. It adds a number of potentially useful features to the display for anyone watching a game on STV or analysing a demo. There's no real expectation that this would be useful for a cast on stream as it produces a lot of clutter, but if someone wants to use it I certainly have no objections.
You must use this with -insecure launch option as it only works in SourceTV and with demos. Don't forget to remove this when going back to play on a normal server.
The features described in more detail below are:
Health bar appearing over players
Health numbers appearing over players
Player names appearing under players
Minimap/radar of player positions
Player switching commands based on class and team without having to know names
This is an "everything on" video which is not recommended for use but illustrates what's available
http://www.mediafire.com/watch/b935ykt3119lhyx/output.mp4
All commands are detailed in the readme in the relevant zip and below. This should work with any Hud as long as it has a default font defined. Without that it will probably crash, I don't know if it's even possible to make a hud without one so this may not be a problem. I've tested it with a handful and had no problems but your mileage may vary. If you get a crash you can try changing hud.
Health Bar
Some details are described in this image:
http://www.mediafire.com/convkey/3422/vhjyebkm9ya7cxcfg.jpg?size_id=7
Command: spec_player_health 1/0 for on/off
The colour of the health bars can be customised using RGB values. This is done with the same commands as bluee's advspec plugin
Command: health_color [r|b] [0-255] [0-255] [0-255]
This is an example of altered colours
http://www.mediafire.com/convkey/8cca/gu4wr8s9tuhw6vtfg.jpg?size_id=6
Health Numbers
Some details shown here:
http://www.mediafire.com/convkey/b06c/c8twj6vcc3f1c04fg.jpg?size_id=6
Command : spec_player_health_numbers 1/0 (on/off)
The font is the hud default. It doesn't scale as it becomes more distant, a specific type of font is required for this and no one uses them.
Player Names
Some details shown here:
http://www.mediafire.com/convkey/2923/ya8qi9l76egn0czfg.jpg?size_id=6
Command: spec_player_name 1/0 (on/off)
The same font notes as with health numbers above apply here.
Everything works in first person as show here
http://www.mediafire.com/convkey/b941/6f8ze1rhicygy59fg.jpg
Controlling clutter
With everything on it becomes very cluttered and the wallhack effect (everything is visible through walls) can be a problem. Unfortunately there's no easy way I'm aware of to establish line of sight through in-game geometry. To alleviate the problem I've implemented an alternative, a variable strength of fade-out over distance. These screenshots illustrate the effect
http://www.mediafire.com/convkey/d1c0/edo9yfvbfmjkbiefg.jpg
http://www.mediafire.com/convkey/b2c8/yja8199onf3z73tfg.jpg
http://www.mediafire.com/convkey/c83b/lajz74a4a4aj5wqfg.jpg
Command: spec_player_fade_strength <fractional multiple of default fade strength>
Minimap
To use this effectively you must download the texture pack as well
I'm not really entirely happy with this feature but it can be useful so I'm making it available. Problems include static orientation and the player positions aren't perfect on every map.
This shows the default map when initially invoked
http://www.mediafire.com/convkey/978c/m3xmx2yv7i5ij47fg.jpg
The map can be repositioned, resized and class icons can be used for the players as show here
http://www.mediafire.com/convkey/8824/a6oohoesr6i2re8fg.jpg?size_id=6
Commands:
spec_player_radar 1/0 to (on/off)
spec_player_radar_vertical_pos <pixel value> 0 is the top of the window
spec_player_radar_horizontal_pos <pixel value> 0 is the leftmost position
spec_player_radar_size <fractional multiple of default map size> use values like 1.5, 2, etc to multiply the minimap size from the default size
spec_player_radar_icons 1/0 (on/off)
spec_player_radar_icon_size <width in pixels> use this to control the size of the player icons to work with the map size you select
Ideally I'd have liked to make it possible to rotate the map to match the free cam or spectated player rotation, but there is no reliable way I've found to identify the spectated player without making the game crash. If you know of something idiotically simple I'm missing for client plugins to get this info from STV demos I would like to know.
Player Selections
I've added a command to allow player selection based on team and class without having to know names.
Command: spec_player_cc <team> <class> <skip - optional> where team is 2 for red or 3 for blu.
Class numbers are: 3 = soldier, 5 = medic, 1 = scout, 2 = sniper, 4 = demo, 9 = engie, 7 = pyro, 8 = spy, 6 = heavy (TF2's internal numbers)
Skip 0 = off, 1 = on
The first 2 parameters should be obvious, but the skip parameter needs explanation. In a 6v6 game there are usually two soldiers and two scouts, so to access the second soldier or scout set the skip parameter to 1 to skip over the first of the selected class.
Obviously if a player off-classes then things may become confused, but you'll just have to have your binds setup and your eyes open to know when it happens. This is the disadvantage of using a class based select over name, but it's certainly useful for highlander.
So to spectate the first red soldier
spec_player_cc 2, 3
And to spectate the second red soldier
spec_player_cc 2, 3, 1
Downloads & Installing
The downloads come in two parts, the plugin itself and a texture pack for the minimap. The plugin is here:
http://tf2playerdatagetter.azurewebsites.net/spectools/spectools_b_0206.zip
This should be extracted into the tf\custom folder so you end up with tf\custom\spectools\addons\spec_tools.dll and other files, including the readme
The minimap textures can be downloaded from here:
http://tf2playerdatagetter.azurewebsites.net/spectools/radar_maps_2.zip
I can't get these to work in the custom folder so I think they have to be extracted to the tf\materials folder, so you end up with tf\materials\radar\ and a variety of vtf and vmt files.
Other Notes
As far as I can see most things work on a first person demo except the map detection so you tend to end up with a useless default texture.
If you're playing a map outside the included group (granary, badlands, Gullywash, Metalworks, Viaduct Pro, Snakewater & Badwater) you will probably get Granary.
I've tested on varying resolutions and things have worked OK but I think this is potentially suspect so you may have problems with an unusual resolution
Open Source?
Unfortunately the quality of code is so fucking shameful I'll have to refactor it to an acceptable standard before any source release, which may or may not get done.
Roadmap:
Add more maps (extremely tedious process)
Rotating minimap if I ever figure it out
? - make requests, you never know I might implement them