ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
650 stars 76 forks source link

[TF2] [Feature Request] Add visibilityBitfield to tf_glow #6360

Open Lizard-Of-Oz opened 2 months ago

Lizard-Of-Oz commented 2 months ago

Currently, tf_glow outlines its target entity for all players with no filtering options. It'd be very useful for vscript creations to highlight an entity only to specific players (one, a few, or one entire team). The show_annotation event has a good approach that could potentially be ported over - a visibility bitfield, where each bit corresponds to a player. While there's technically a way to achieve this with workarounds already, it requires to give each player an inactive teleporter entity and a tf_glow for that teleporter, and then write and run extra code to make sure those entities don't get loose.

worMatty commented 1 month ago

If a bitfield is used it should be large enough to support as many players as a server can handle, which I believe is currently 100. The training annotation event maps each client index to each bit position, but the integer is only 32 bits long, so client 32 doesn't have a position and doesn't see the annotation.