Replace some TFPlayerClassData_t values using plugins.
This includes the default values, per class, for:
max speed
max health
max armor (unused in TF2)
max ammo (per type; primary, secondary, metal, idk what 4-6 do)
builables (TFObjectType, 4 for none)
Why is this interesting?
The default approach is to manipulate value on the client after spawning using EntProps or attributes. This can mess with attributes on items, making certain manipulations rather inconvenient.
If you want to rebalance the game, you can now do so using the base values, keeping maximum compatibility with any items or other plugins that apply attributes to the player without things breaking.
If you want to set the maximum speed above 520 you will need another plugin that removes that specific hardcoded limit: TF2 Move Speed Unlocker or tf_maxspeed_patch
Installing
Drop plugin and gamedata file on your server. By default the plugin does nothing.
Module
(No extra plugin thread as I think that might get confusing)
TF2 PlayerClassConfig
You can use TF2ClassDataConfig to change the Player Class Data Values using a config.
Put the config at cfg/sourcemod/playerclassdata.cfg
You can reload the config by reloading the plugin or using sm_playerclassdata_reloadconfig. The command by default has ADMFLAG_CONFIG.
Yes, the first ammo type is 0. That's just where software likes to start counting.
You can just remove class sections or entries that you want to keep on default values.
Default/Example Config
PHP Code:
"PlayerClassDataConfig"
{
//"#default" {
// you can use a defaul section to apply values to all classes before class specific overrides
//}
// if you create a section with a name not matching a class name, you can will it with template values
// and copy the values into a class section using the entry like this:
// scout {
// "copy" "example"
// }
Update to 23w03a
* Added the buildables list to the exposed data
* Library interface now uses a stringmap instead of an enum struct. should be more future proof
* Updated GameData for Linux
PlayerClassData is an object storing base-values for a player class. This plugins changes the memory values directly, allowing for base-value changes. It has no relation of information about the actual player, or their team. If you'd want different values on a non-class basis, you'd have to hook every game function that somehow accesses this part of memory (i wont do that) or go with attributes. Similarly, the weapon reload speed is weapon information, not player class information, so it is unrelated to the memory worked on by this plugin.
With all that said, this plugin is just an additional entry to your rebalance toolkit. Use other plugins for more granular changes.