Raised This Month: $32 Target: $400
 8% 

[TF2] Replicate sniper's tracer rounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 03-08-2023 , 14:54   [TF2] Replicate sniper's tracer rounds
Reply With Quote #1

I've been trying to figure out how to replicate The Classic's tracer rounds... but so far can't.

Here is what I've tried:

1. Adding the attribute "sniper fires tracer HIDDEN"

This does nothing on its own. The Classic's tracers seem to be controlled by set_weapon_mode 3 instead.

2. I tried replicating the "Fire Bullets" tempent for The Classic - referencing a TF2 source code leak and using a TempEntHook to see what The Classic normally sets these values to.

It did nothing.

Also, I cannot for the life of me figure out where TF2 actually handles creating this FX in the source code. I'm only assuming that it does it during fire bullets somehow...

PHP Code:
TE_SetupFireBullets(vPosvAngTF_WEAPON_SNIPERRIFLE_CLASSIC0GetRandomInt(1256), iClient);
TE_SendToAll();

/*
    This does jack shit
*/
stock TE_SetupFireBullets(Float:vPos[3], Float:vAng[3], iWeaponIDiMode 0iSeed 1iPlayerFloat:flSpread 0.0bool:bCrit false)
{
    
TE_Start("Fire Bullets");
    
TE_WriteVector("m_vecOrigin"vPos);
    
TE_WriteFloat("m_vecAngles[0]"vAng[0]);
    
TE_WriteFloat("m_vecAngles[1]"vAng[1]);
    
TE_WriteNum("m_iWeaponID"iWeaponID);
    
TE_WriteNum("m_iMode"iMode);
    
TE_WriteNum("m_iSeed"iSeed);
    
TE_WriteNum("m_iPlayer"iPlayer-1);
    
TE_WriteFloat("m_flSpread"flSpread);
    
TE_WriteNum("m_bCritical"bCrit);

3. I tried using the "tfc_sniper_distortion_trail" particle effect... none of my particle effect stocks or tempent particle stocks or "connect two entity particle stocks" could spawn it... but maybe I'm setting something wrong.

Post a message if you want me to post the stocks I use for those too.

Anyone got any ideas?
__________________

Last edited by Chdata; 03-08-2023 at 14:57.
Chdata is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-08-2023 , 15:21   Re: [TF2] Replicate sniper's tracer rounds
Reply With Quote #2

...there are three particle system effect
Code:
"dxhr_sniper_rail_blue"
"dxhr_sniper_rail_red"
"tfc_sniper_distortion_trail"
then you need set, origin start position..
And "control point" 0 as start position, "control point" 1 as end position.
Code:
m_vSortOrigin = startpos

I have not tested... I just quick peep some source files...

*edit
There is no "tfc_sniper_distortion_trail", maybe it exist in Team Fortress Classic. Actually, there is. Also "tfc_sniper_distortion_trail_noise"
But there is more sniper rail effects, you can look through Hammer editor.
Attached Thumbnails
Click image for larger version

Name:	vlcsnap-2023-03-09-01h17m19s701.jpg
Views:	31
Size:	58.6 KB
ID:	199824  
__________________
Do not Private Message @me

Last edited by Bacardi; 03-09-2023 at 04:14.
Bacardi is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 03-09-2023 , 01:03   Re: [TF2] Replicate sniper's tracer rounds
Reply With Quote #3

Try adding attribute 305, "sniper fires tracer" instead of "sniper fires tracer HIDDEN".

Seems to work for me.
PC Gamer is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 03-09-2023 , 08:34   Re: [TF2] Replicate sniper's tracer rounds
Reply With Quote #4

Quote:
Originally Posted by Bacardi View Post
...there are three particle system effect
Code:
"dxhr_sniper_rail_blue"
"dxhr_sniper_rail_red"
"tfc_sniper_distortion_trail"
then you need set, origin start position..
And "control point" 0 as start position, "control point" 1 as end position.
Code:
m_vSortOrigin = startpos

I have not tested... I just quick peep some source files...

*edit
There is no "tfc_sniper_distortion_trail", maybe it exist in Team Fortress Classic. Actually, there is. Also "tfc_sniper_distortion_trail_noise"
But there is more sniper rail effects, you can look through Hammer editor.
Oh wow, I was looking at the particles in the -tools particle editor and couldn't get them to show up properly at all.

I have never used Hammer Editor before.

And yea... I had no idea what the Start pos on particles is meant to be.

tfc_sniper_distortion_trail_noise is a child particle spawned by tfc_sniper_distortion_trail, so I shouldn't be needing to generate those myself.
__________________

Last edited by Chdata; 03-09-2023 at 08:50.
Chdata is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 03-09-2023 , 08:44   Re: [TF2] Replicate sniper's tracer rounds
Reply With Quote #5

Quote:
Originally Posted by PC Gamer View Post
Try adding attribute 305, "sniper fires tracer" instead of "sniper fires tracer HIDDEN".

Seems to work for me.
This one gives the machina's highly visible tracer instead of the classic's translucent one

EDIT: Wait, now it's working with set_weapon_mode 3. Wowee, how did I never figure that one out 7 years ago.

----

Anyway, something is working

__________________

Last edited by Chdata; 03-09-2023 at 09:00.
Chdata is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 03-11-2023 , 13:32   Re: [TF2] Replicate sniper's tracer rounds
Reply With Quote #6

So... to recap things... To enable the classic's translucent tracer rounds on a Sniper:

1. Apply attribute 305, "sniper fires tracer" to weapon with a value of 1.0
2. Apply attribute 144, "lunchbox adds minicrits" to weapon with a value of 3.0

You are done. Sniper rifle now has translucent tracer rounds.
PC Gamer is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:05.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode