Raised This Month: $30 Target: $400
 7% 

[tf2] attempting to override default projectile speed of syringes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
possibly_yaboi_mark
Junior Member
Join Date: Jul 2022
Old 10-24-2022 , 20:24   [tf2] attempting to override default projectile speed of syringes
Reply With Quote #1

i am currently attempting to override the default projectile speed of all syringes, and yes, i have tried tf2items, that didn't work.

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <entity>
#pragma newdecls required
#pragma semicolon 1

public void Hook_EntitySpawned(int entity, const char[] ClassName)
{
     if (
StrEqual(ClassName,"tf_projectile_syringe")) {
          
float velocity[3];
          
GetEntPropVector(entityProp_Data"m_vecVelocity"velocity);
          
velocity[0] *= 1.75;
          
velocity[1] *= 1.75;
          
velocity[2] *= 1.75;
          
TeleportEntity(entityNULL_VECTORNULL_VECTORvelocity);
     }


Last edited by possibly_yaboi_mark; 10-24-2022 at 23:56.
possibly_yaboi_mark is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 10-25-2022 , 00:53   Re: [tf2] attempting to override default projectile speed of syringes
Reply With Quote #2

I was unsuccessful in changing the projectile speed of syringes using tf2attributes. I wrote a plugin that applied the 'Projectile speed increased' and 'Projectile speed decreased' to syringes and it didn't work. So, while those attributes seem to work well with rockets and flares it does not work on syringes.

I'm only posting this here to let people know what I tried that didn't work in case somebody had a similar idea.
PC Gamer is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 10-25-2022 , 05:09   Re: [tf2] attempting to override default projectile speed of syringes
Reply With Quote #3

The syringe speed isn't currently synchronized between the client and server as it's rendered on clients using effect dispatching instead of visible entities. While you could intercept the behavior by hooking CTFProjectile_Syringe::Create, clients will never see the syringe with the correct velocity though the server will accurately report hits / misses.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
Reply


Thread Tools
Display Modes

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 23:38.


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