AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [TF2] Replicate sniper's tracer rounds (https://forums.alliedmods.net/showthread.php?t=342102)

Chdata 03-08-2023 14:54

[TF2] Replicate sniper's tracer rounds
 
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?

Bacardi 03-08-2023 15:21

Re: [TF2] Replicate sniper's tracer rounds
 
1 Attachment(s)
...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.

PC Gamer 03-09-2023 01:03

Re: [TF2] Replicate sniper's tracer rounds
 
Try adding attribute 305, "sniper fires tracer" instead of "sniper fires tracer HIDDEN".

Seems to work for me.

Chdata 03-09-2023 08:34

Re: [TF2] Replicate sniper's tracer rounds
 
Quote:

Originally Posted by Bacardi (Post 2800895)
...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.

Chdata 03-09-2023 08:44

Re: [TF2] Replicate sniper's tracer rounds
 
Quote:

Originally Posted by PC Gamer (Post 2800916)
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 :D

https://i.imgur.com/FWMbSAX.png

PC Gamer 03-11-2023 13:32

Re: [TF2] Replicate sniper's tracer rounds
 
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.


All times are GMT -4. The time now is 14:07.

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