Raised This Month: $12 Target: $400
 3% 

[TF2] Projectiles Fix


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Plugin ID:
3793
Plugin Version:
1.0.1
Plugin Category:
Technical/Development
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    3 
    Plugin Description:
    Fixes projectiles not flying through team mates.
    Unapprover:
    Reason for Unapproving:
    Out-of-bounds string read in OnEntityCreated can cause server crashes
    Old 07-28-2013 , 11:09   [TF2] Projectiles Fix
    Reply With Quote #1

    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.

    Servers with this plugin

    Download plugin
    Browse source code
    __________________


    dodsplugins.com - Plugins and Resources for Day of Defeat
    http://twitch.tv/zadroot

    Last edited by Root_; 01-21-2014 at 11:48. Reason: ready for review
    Root_ is offline
    luki1412
    Veteran Member
    Join Date: Oct 2008
    Location: OnPluginStart()
    Old 07-28-2013 , 11:42   Re: [TF2] Projectiles Fix (1.0.0)
    Reply With Quote #2

    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() 
    __________________

    Last edited by luki1412; 07-28-2013 at 12:05.
    luki1412 is offline
    Root_
    Veteran Member
    Join Date: Jan 2012
    Location: ryssland
    Old 07-28-2013 , 15:02   Re: [TF2] Projectiles Fix (1.0.0)
    Reply With Quote #3

    erm... what? Can you type this in your native language at least?
    Spoiler
    __________________


    dodsplugins.com - Plugins and Resources for Day of Defeat
    http://twitch.tv/zadroot
    Root_ is offline
    K o T
    Senior Member
    Join Date: Jan 2011
    Old 07-28-2013 , 15:24   Re: [TF2] Projectiles Fix (1.0.0)
    Reply With Quote #4

    странно только пролетают мимо боссов а так все работает
    K o T is offline
    Root_
    Veteran Member
    Join Date: Jan 2012
    Location: ryssland
    Old 07-28-2013 , 16:39   Re: [TF2] Projectiles Fix (1.0.0)
    Reply With Quote #5

    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...
    __________________


    dodsplugins.com - Plugins and Resources for Day of Defeat
    http://twitch.tv/zadroot
    Root_ is offline
    StrikerMan780
    AlliedModders Donor
    Join Date: Jul 2009
    Location: Canada
    Old 07-28-2013 , 18:06   Re: [TF2] Projectiles Fix (1.0.0)
    Reply With Quote #6

    Figured out how to get this to work with Cleavers? I could really use that, big time.
    StrikerMan780 is offline
    Root_
    Veteran Member
    Join Date: Jan 2012
    Location: ryssland
    Old 07-29-2013 , 06:14   Re: [TF2] Projectiles Fix (1.0.0)
    Reply With Quote #7

    Quote:
    Originally Posted by StrikerMan780 View Post
    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)
    __________________


    dodsplugins.com - Plugins and Resources for Day of Defeat
    http://twitch.tv/zadroot
    Root_ is offline
    StrikerMan780
    AlliedModders Donor
    Join Date: Jul 2009
    Location: Canada
    Old 07-30-2013 , 15:33   Re: [TF2] Projectiles Fix (1.0.1)
    Reply With Quote #8

    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.

    Last edited by StrikerMan780; 07-30-2013 at 15:34.
    StrikerMan780 is offline
    Root_
    Veteran Member
    Join Date: Jan 2012
    Location: ryssland
    Old 07-31-2013 , 04:26   Re: [TF2] Projectiles Fix (1.0.1)
    Reply With Quote #9

    Quote:
    Originally Posted by StrikerMan780 View Post
    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).
    __________________


    dodsplugins.com - Plugins and Resources for Day of Defeat
    http://twitch.tv/zadroot
    Root_ is offline
    StrikerMan780
    AlliedModders Donor
    Join Date: Jul 2009
    Location: Canada
    Old 08-17-2013 , 23:43   Re: [TF2] Projectiles Fix
    Reply With Quote #10

    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.

    Last edited by StrikerMan780; 08-17-2013 at 23:47.
    StrikerMan780 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 02:46.


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