AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=109)
-   -   [TF2] Projectiles Fix (https://forums.alliedmods.net/showthread.php?t=221955)

Root_ 07-28-2013 11:09

[TF2] Projectiles Fix
 
I am not playing TF2 anyways, but I always wanted to fix annoying bug with colliding projectiles.

In other words this little dirty plugin fixes a bug when projectiles not flying through team mates.
Spoiler


CONVARS
By default all rocket projectiles is 'fixed', but you can setup which projectiles should not fly through teammates.
  • sm_fix_arrow - Allow arrow to fly through team mates?
  • sm_fix_energy_ball - Allow energy ball to fly through team mates?
  • sm_fix_energy_ring - Allow energy ring to fly through team mates?
  • sm_fix_flare - Allow flare to fly through team mates?
  • sm_fix_rocket - Allow rocket to fly through team mates?
  • sm_fix_sentryrocket - Allow sentry rocket to fly through team mates?

NOTES
  • Unfortunately not all projectiles are available to handle. It's caused by different collision groups for every type of projectile (first is exploding on touch, second is bouncing and third are throwing). If you will found a way to properly set collision group for those - please let me know!
  • Projectiles still not flying through friendly buildings as before - its a gameplay tweak (against spies).
  • It's working very well with deflected projectiles.
  • Plugin is using Updater by GoD-Tony, so you'll need to download it if you want to re-compile plugin.
  • Plugin generates a configuration file (cfg/sourcemod/tf_projectiles_fix.cfg).
  • Plugin is not really tested, so if any bug will occur - lemmeknow. :P

Servers with this plugin

Download plugin
Browse source code

luki1412 07-28-2013 11:42

Re: [TF2] Projectiles Fix (1.0.0)
 
I will test this plugin. Good idea though.

EDIT: it's working, but I get these errors spammed in log ->

PHP Code:

L 07/28/2013 18:04:56: [SMNative "GetEntProp" reportedEntity -(-1is invalid
L 07
/28/2013 18:04:56: [SMDisplaying call stack trace for plugin "tf_projectiles_fix.smx":
L 07/28/2013 18:04:56: [SM]   [0]  Line 294C:\tf_projectiles_fix.sp::OnProjectileCollide() 


Root_ 07-28-2013 15:02

Re: [TF2] Projectiles Fix (1.0.0)
 
erm... what? Can you type this in your native language at least?
Spoiler

K o T 07-28-2013 15:24

Re: [TF2] Projectiles Fix (1.0.0)
 
странно только пролетают мимо боссов а так все работает

Root_ 07-28-2013 16:39

Re: [TF2] Projectiles Fix (1.0.0)
 
Seems like boss dont have not collision group nor contentsmask... only thing I can do is disabling plugin when its spawning. I'll investigate another method tomorrow...

StrikerMan780 07-28-2013 18:06

Re: [TF2] Projectiles Fix (1.0.0)
 
Figured out how to get this to work with Cleavers? I could really use that, big time.

Root_ 07-29-2013 06:14

Re: [TF2] Projectiles Fix (1.0.0)
 
Quote:

Originally Posted by StrikerMan780 (Post 2000935)
Figured out how to get this to work with Cleavers? I could really use that, big time.

Not yet. Not sure if its even possible. It has same collision group as each other scout 'ballz'.
I tried to set ShouldCollide result to 'false' to dont even allow projectile to collide with anything, but it still bouncing with a player from long distance.

Anyways updated to 1.0.1 - fixed projectiles flying through bosses (thanks to K o T for reporting)

StrikerMan780 07-30-2013 15:33

Re: [TF2] Projectiles Fix (1.0.1)
 
You might need to use the VPhysics extension. Worth checking out. I had to use it to alter the trajectory of the cleavers for a weapon mod.

Root_ 07-31-2013 04:26

Re: [TF2] Projectiles Fix (1.0.1)
 
Quote:

Originally Posted by StrikerMan780 (Post 2002368)
You might need to use the VPhysics extension. Worth checking out. I had to use it to alter the trajectory of the cleavers for a weapon mod.

Interesting. I'll definitely take a look at this, but I'd like to dont use any other extension than SDKHooks. Teleporting an entity would also work, but I dont have an idea how to realize that (probably velocity may help me).

StrikerMan780 08-17-2013 23:43

Re: [TF2] Projectiles Fix
 
Found out that this code works:
(Using SDKHook_Touch)
PHP Code:

public Action:CleaverTouch(entityother)
{
    new 
Team GetEntProp(entityProp_Send"m_iTeamNum");
    
    if(
IsValidClient(other))
    {        
        if(
Team == GetClientTeam(other))
        {
            return 
Plugin_Handled;
        }
        else
        {
            return 
Plugin_Continue;
        }
    }

    return 
Plugin_Continue;


IsValidClient is a stock that I had made on my own. I can post it if you'd like. It's just several checks to keep some errors from popping up.


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

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