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

[TF2] RocketBounce


Post New Thread Reply   
 
Thread Tools Display Modes
Author
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Plugin ID:
2261
Plugin Version:
1.0
Plugin Category:
General Purpose
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    15 
    Plugin Description:
    It makes rockets reflect off walls, 'nuff said.
    Old 03-05-2011 , 14:03   [TF2] RocketBounce
    Reply With Quote #1

    It makes rockets reflect off walls, 'nuff said.

    Someone requested this months ago. I originally had it written in C++, but with the release of SDKHooks2 this can now be done in pawn.

    Use the sm_rb_max cvar to set how many times a rocket will bounce before detonating, the default it 2.

    Hopefully the math stuff helps people out with more useful things
    Attached Files
    File Type: sp Get Plugin or Get Source (rocketBounce.sp - 4574 views - 3.1 KB)
    __________________

    Last edited by asherkin; 09-02-2015 at 14:49.
    asherkin is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 03-05-2011 , 16:06   Re: [TF2] RawketBawnce
    Reply With Quote #2

    You check for if the Touch entity is a client, not world. It bounces off clients. Woo. I changed it to world.

    Will post my version once I add a teeensy little thing.
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.
    FlaminSarge is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: 90's
    Old 03-05-2011 , 16:18   Re: [TF2] RawketBawnce
    Reply With Quote #3

    oh shi-!
    brilliant
    Leonardo is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 03-05-2011 , 18:10   Re: [TF2] RawketBawnce
    Reply With Quote #4

    It conflicts with some other plugin that uses SDKHooks, but I'm not sure which. Whatever plugin it is, it messes with the direction they bounce.
    To test, I unloaded SDKHooks (and therefore all SDKHooks-using plugins), reloaded SDKHooks, then loaded only rocketbounce, it worked fine. refreshed all plugins, it got all buggy again.

    It's not homingrocket, because I unloaded that and it still did the off-angle bounces and straight-on-shot exploding. It *might* be holyarrows, but I'm not sure.

    Will continue testing later.

    If you want the version that bounces off the walls, go into the source, look for "other < 1 || other > MaxClients", change that to "other != 0".
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.
    FlaminSarge is offline
    asherkin
    SourceMod Developer
    Join Date: Aug 2009
    Location: OnGameFrame()
    Old 03-05-2011 , 22:20   Re: [TF2] RawketBawnce
    Reply With Quote #5

    Quote:
    Originally Posted by FlaminSarge View Post
    It conflicts with some other plugin that uses SDKHooks, but I'm not sure which. Whatever plugin it is, it messes with the direction they bounce.
    To test, I unloaded SDKHooks (and therefore all SDKHooks-using plugins), reloaded SDKHooks, then loaded only rocketbounce, it worked fine. refreshed all plugins, it got all buggy again.

    It's not homingrocket, because I unloaded that and it still did the off-angle bounces and straight-on-shot exploding. It *might* be holyarrows, but I'm not sure.

    Will continue testing later.
    It's likely to be a plugin that uses the older SDKHooks Touch or StartTouch hooks that were non-blockable, nothing I can do about that.

    Quote:
    Originally Posted by FlaminSarge View Post
    If you want the version that bounces off the walls, go into the source, look for "other < 1 || other > MaxClients", change that to "other != 0".
    No, that check should just be 'not'-ed, otherwise it wont bounce of models like the resupply cabinets.
    Uploaded a fixed version.
    __________________
    asherkin is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 03-06-2011 , 01:09   Re: [TF2] RawketBawnce
    Reply With Quote #6

    Here's the one I wrote up that makes it explode if it bounces near a player.
    Allows for rocket jumping.
    Attached Files
    File Type: sp Get Plugin or Get Source (rocketBounce.sp - 1888 views - 5.4 KB)
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.
    FlaminSarge is offline
    Mecha the Slag
    Veteran Member
    Join Date: Jun 2009
    Location: Denmark
    Old 03-06-2011 , 06:53   Re: [TF2] RawketBawnce
    Reply With Quote #7

    This is all incredibly neat, but I have a question

    why do you wait for the second touch trigger before you bounce the projectile?
    You could just as well have done it in StartTouch yet you wait until the first Touch hook after that. Why is that?
    __________________
    Mecha the Slag is offline
    asherkin
    SourceMod Developer
    Join Date: Aug 2009
    Location: OnGameFrame()
    Old 03-06-2011 , 08:43   Re: [TF2] RawketBawnce
    Reply With Quote #8

    Quote:
    Originally Posted by Mecha the Slag View Post
    why do you wait for the second touch trigger before you bounce the projectile?
    You could just as well have done it in StartTouch yet you wait until the first Touch hook after that. Why is that?
    Not a bloody clue .
    Like I said, I wrote it in C++ way-back-when and I'm sure I had a reason for it then. I just ported my C++ version directly to Pawn.

    EDIT: Oh, I think I remember.
    When StartTouch is called, Touch is guaranteed to fire directly afterwards, even if you block the StartTouch call. If you just hook Touch, you get calls as it passes through triggers and the like.
    This is only based on half-remembered memories though.
    __________________

    Last edited by asherkin; 03-06-2011 at 08:46.
    asherkin is offline
    jameless
    Veteran Member
    Join Date: Jan 2010
    Old 03-07-2011 , 06:51   Re: [TF2] RawketBawnce
    Reply With Quote #9

    Nicely done. I might suggest, (although it wouldn't be your fault if someone lagged their server doing this) that you put in an upper limit on that cvar? Just for the fun of it I set it to 100 and fired away in spawn.




    Tons of fun though. Changing the cvar on the fly works like a charm.
    jameless is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 03-07-2011 , 18:27   Re: [TF2] RawketBawnce
    Reply With Quote #10

    That's clearly the best use of this plugin.
    Wait, no, bouncing arrows.

    Ash: NATIVES?!
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.

    Last edited by FlaminSarge; 03-07-2011 at 18:30.
    FlaminSarge 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 05:46.


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