Custom grappling hook (trail)?!
Posted: Tue Dec 30, 2008 10:26 am
Hi everyone!
I've just replaced the grappling hook by a sticky, Monkeys-of-Doom style chameleon.
Problem is that it still fires with the lightning-gun trail, which unfortunately doesn't look like a chameleon-tongue at all
What I found in cg_weapons.c is this:
... Where
... seems to tell the game to use the lightning-gun beam and it's shader for the grappling hook. - Question is, if there is a (not too tricky) way to create a custom texture or shader to replace it... 
I've just replaced the grappling hook by a sticky, Monkeys-of-Doom style chameleon.


What I found in cg_weapons.c is this:
Code: Select all
/*
==========================
CG_GrappleTrail
==========================
*/
void CG_GrappleTrail( centity_t *ent, const weaponInfo_t *wi ) {
vec3_t origin;
entityState_t *es;
vec3_t forward, up;
refEntity_t beam;
es = &ent->currentState;
BG_EvaluateTrajectory( &es->pos, cg.time, origin );
ent->trailTime = cg.time;
memset( &beam, 0, sizeof( beam ) );
//FIXME adjust for muzzle position
VectorCopy ( cg_entities[ ent->currentState.otherEntityNum ].lerpOrigin, beam.origin );
beam.origin[2] += 26;
AngleVectors( cg_entities[ ent->currentState.otherEntityNum ].lerpAngles, forward, NULL, up );
VectorMA( beam.origin, -6, up, beam.origin );
VectorCopy( origin, beam.oldorigin );
if (Distance( beam.origin, beam.oldorigin ) < 64 )
return; // Don't draw if close
beam.reType = RT_LIGHTNING;
beam.customShader = cgs.media.lightningShader;
AxisClear( beam.axis );
beam.shaderRGBA[0] = 0xff;
beam.shaderRGBA[1] = 0xff;
beam.shaderRGBA[2] = 0xff;
beam.shaderRGBA[3] = 0xff;
trap_R_AddRefEntityToScene( &beam );
}
Code: Select all
beam.reType = RT_LIGHTNING;
beam.customShader = cgs.media.lightningShader;
