AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] RocketBounce (https://forums.alliedmods.net/showthread.php?t=152173)

asherkin 03-05-2011 14:03

[TF2] RocketBounce
 
1 Attachment(s)
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 :P

FlaminSarge 03-05-2011 16:06

Re: [TF2] RawketBawnce
 
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.

Leonardo 03-05-2011 16:18

Re: [TF2] RawketBawnce
 
oh shi-!
brilliant
:3

FlaminSarge 03-05-2011 18:10

Re: [TF2] RawketBawnce
 
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".

asherkin 03-05-2011 22:20

Re: [TF2] RawketBawnce
 
Quote:

Originally Posted by FlaminSarge (Post 1428406)
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 (Post 1428406)
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.

FlaminSarge 03-06-2011 01:09

Re: [TF2] RawketBawnce
 
1 Attachment(s)
Here's the one I wrote up that makes it explode if it bounces near a player.
Allows for rocket jumping.

Mecha the Slag 03-06-2011 06:53

Re: [TF2] RawketBawnce
 
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?

asherkin 03-06-2011 08:43

Re: [TF2] RawketBawnce
 
Quote:

Originally Posted by Mecha the Slag (Post 1428671)
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 :P.
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.

jameless 03-07-2011 06:51

Re: [TF2] RawketBawnce
 
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.

http://i.imgur.com/aFKoxl.jpg
http://i.imgur.com/j9We0l.jpg

Tons of fun though. Changing the cvar on the fly works like a charm.

FlaminSarge 03-07-2011 18:27

Re: [TF2] RawketBawnce
 
That's clearly the best use of this plugin.
Wait, no, bouncing arrows.

Ash: NATIVES?!


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

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