Railjump in quake3

Locked
40nm
Posts: 2
Joined: Mon Mar 21, 2011 9:39 pm

Railjump in quake3

Post by 40nm »

Hi
Could someone tell me the code and where it should go for railjump ?


Thank you
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: Railjump in quake3

Post by Eraser »

I guess you could add a call to G_RadiusDamage to the weapon_railgun_fire function in g_weapon.c

edit:
if you add this to the end of the aforementioned function, you can do rail jumps:

G_RadiusDamage( trace.endpos, ent, 100, 120, traceEnt, MOD_ROCKET_SPLASH );

But do note that this simply adds a splash damage effect to the end of the rail trail, so that may not entirely be what you're looking for. I've also let it refer to MOD_ROCKET_SPLASH as method of death so the console will register it as a splash damage hit with the Rocket Launcher. Might be a good idea to add a MOD_RAIL_SPLASH or something like that.

Probably the best thing to do is copy the G_RadiusDamage function and change that so only the client that fired the railgun is affected by the splash. You could probably change that and a copy of the G_Damage function to prevent yourself from getting hurt but still get the knockback you desire.

One final thing, I've put the values 100 and 120 hardcoded into the G_RadiusDamage call. These are the values normally associated with the splash damage and splash radius of a rocket.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Railjump in quake3

Post by ^misantropia^ »

This has been asked a few times before. If you search the forum, you'll find several threads with answers.
40nm
Posts: 2
Joined: Mon Mar 21, 2011 9:39 pm

Re: Railjump in quake3

Post by 40nm »

Thank you Eraser/^misantropia^

Im new to this so its hard for me at the mo

Thanks again for your help
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Railjump in quake3

Post by ^misantropia^ »

Don't be shy if you run into issues, that's what this forum is for.
Locked