Raised This Month: $ Target: $400
 0% 

Replacing RPG Trail.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Drak
Veteran Member
Join Date: Jul 2005
Old 04-30-2007 , 15:34   Replacing RPG Trail.
Reply With Quote #1

Is there anyway to remove/change the trail on a RPG rocket?
(Color,size, etc etc)
__________________
Oh yeah

Last edited by Drak; 04-30-2007 at 22:18.
Drak is offline
Send a message via MSN to Drak
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-30-2007 , 22:33   Re: Replacing RPG Trail.
Reply With Quote #2

One "think" after an RPG spawns, it executes this:

Code:
    // rocket trail     MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY );         WRITE_BYTE( TE_BEAMFOLLOW );         WRITE_SHORT(entindex());    // entity         WRITE_SHORT(m_iTrail ); // model         WRITE_BYTE( 40 ); // life         WRITE_BYTE( 5 );  // width         WRITE_BYTE( 224 );   // r, g, b         WRITE_BYTE( 224 );   // r, g, b         WRITE_BYTE( 255 );   // r, g, b         WRITE_BYTE( 255 )// brightness     MESSAGE_END();  // move PHS/PVS data sending into here (SEND_ALL, SEND_PVS, SEND_PHS)

So just send your own TE_BEAMFOLLOW after that.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 04-30-2007 , 22:52   Re: Replacing RPG Trail.
Reply With Quote #3

But, wouldn't I need to hook the model/entity somehow? To even know the the RPG has been fired?
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 05-01-2007 , 14:59   Re: Replacing RPG Trail.
Reply With Quote #4

You only need to know that the rocket has been fired if you want to change the trail right after it's been fired. So, if that's the case, I'd hook either setmodel or think (and only set the trail on the first think, none after).
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 05-01-2007 , 15:28   Re: Replacing RPG Trail.
Reply With Quote #5

I would assume you're saying that if I send my own trail message on the first think, it will override the original?

Code:
public EntityThink(ent) {     new classname[64]     pev(ent,pev_classname,classname,63)         if(equali(classname,"rpg_rocket")) {         message_begin(MSG_BROADCAST,SVC_TEMPENTITY);         write_byte(TE_BEAMFOLLOW)         write_short(ent)         write_short(m_iTrail)         write_byte(40)         write_byte(10)                 write_byte(random_num(50,255))         write_byte(random_num(50,255))         write_byte(random_num(50,255))                 write_byte(255)         message_end()     } }
I'm hooking it threw it's think, obviously. But how can I catch when it's "first think" is called?
(So I can completely hide the original trail, because mine just combines with it and makes it look all werid)
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 05-02-2007 , 00:17   Re: Replacing RPG Trail.
Reply With Quote #6

I'd use some sort of flag.

Code:
if(equali(classname,"rpg_rocket")) {     if(pev(ent,pev_iuser1)) return FMRES_IGNORED;     set_pev(ent,pev_iuser1,1);     // ... }

pev_iuser1 should be 0 by default. So it passes by the if statement unharmed the first time think is called, sets the value to 1 so that it knows not to do this again next time, and then executes your code.

As for not getting the beams to coincide, you might have to kill the old beam first:

Code:
message_begin(MSG_BROADCAST,SVC_TEMPENTITY); write_byte(TE_KILLBEAM); // Kill all beams attached to entity write_short(ent); message_end();
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 05-02-2007 , 13:04   Re: Replacing RPG Trail.
Reply With Quote #7

Thanks, Avalanche. Worked fine. : D
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
urban_ninja
Senior Member
Join Date: Feb 2009
Old 02-11-2012 , 09:39   Re: Replacing RPG Trail.
Reply With Quote #8

I've tried this method with with team fortress classic's pipe bombs but new trail only took effect on alt fire if return PLUGIN_HANDLE is added to the bottom of the code as well as breaking pipe det which is supposed to be the alt fire. This method does nothing at all on pipe launch regardless of value returned.
__________________
urban_ninja is offline
Reply



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 06:43.


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