Skip to content

[TF2] Implement ConVars for global Sniper Rifle trails - #2020

Open
dilbertron2 wants to merge 2 commits into
ValveSoftware:masterfrom
dilbertron2:sniper-bullet-trail-cvar2
Open

[TF2] Implement ConVars for global Sniper Rifle trails#2020
dilbertron2 wants to merge 2 commits into
ValveSoftware:masterfrom
dilbertron2:sniper-bullet-trail-cvar2

Conversation

@dilbertron2

@dilbertron2 dilbertron2 commented Aug 25, 2026

Copy link
Copy Markdown

Description

This PR adds two ConVars:

tf_sniper_rifle_trails If set, sniper rifles will leave a bullet trail after firing (1 = Machina trail, 2 = Classic trail).
tf_sniper_rifle_trails_forced If set, the value of tf_sniper_rifle_trails will override the trail of rifles like the Classic and Machina.

The code that handles when to utilize sniper trails has been rewritten for ease of use.

The below videos showcase various states possible with the aforementioned ConVars.

Videos

tf_sniper_rifle_trails 1
tf_sniper_rifle_trails_forced 0

2026-08-25.13-05-28.mp4

tf_sniper_rifle_trails 2
tf_sniper_rifle_trails_forced 0

2026-08-25.13-05-56.mp4

tf_sniper_rifle_trails 1
tf_sniper_rifle_trails_forced 1

2026-08-25.13-06-22.mp4

Create enum SniperTrailType_t and SniperTrailType_t GetSniperTrailType( CTFSniperRifle *pRifle ) to control trail behaviour
Add ConVars tf_sniper_rifle_trails and tf_sniper_rifle_trails_forced
@dilbertron2 dilbertron2 changed the title [TF2] Implement ConVars for global Sniper trails upon firing rifles [TF2] Implement ConVars for global Sniper Rifle trails Aug 25, 2026
Comment thread src/game/shared/tf/tf_player_shared.cpp Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants