Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR allows mappers to define custom kill icons by packing a new file called
scripts/map_textures.txt
that's structured identical to the game'sscripts/mod_textures.txt
where the stock kill icons are defined.This PR also reloads kill icons on LevelInit.
Custom materials/textures are fully supported (unless different maps happened to store non-identical textures under the same name, which is a broader issue with asset caching anyway).
There's several ways for mappers to make use of this feature:
killicon
totrigger_hurt
,func_croc
andpoint_hurt
. When not empty, its value will be used as the kill icon name.classname
keyvalue for the kill icon name. Using VScript, you can use OnTakeDamage hook to assign a dummy entity as the inflictor:classname
of an existing entity with a map outputMyEntityName | AddOutput | classname my_custom_kill_icon
or with a VScript callmyEntity.KeyValueFromString("classname", "my_custom_kill_icon")
. However, the side-effects of this change are unclear and I recommend the other 2 methods.Considerations
killicon
keyvalue.sv_pure
to the best of my ability, the sv_pure system works in mysterious ways.maps/%bspname%_map_textures.txt
, but keeping the file name in sync with the bsp name is very annoying to deal with during map development, and there is no need for this naming convention here, as the file appears to get reloaded between maps correctly.scripts/mod_textures.txt
that will override the stock file until the map change. In fact, it's already possible in Live TF2, but it requires the user to usehud_reloadscheme
command for changes to take effect.I see this as non-issue, as if a bad actor wants to mess with players with a poisoned map, there's many other opportunities to do so.
If you disagree, this can be fixed with the following change to hud.cpp that will force the game to load
hud_textures
andmod_textures
from the game's files.