|
Adding trails to
bullets: 
Created By: Hunter-Killer of Quick Phrag
Productions
Yet another simple tutorial from
Hunter-Killer. In this edition we will add a Matrix like trail
effect to shotgun and machinegun bullets. Open cg_weapons.c in
cgame and go to line 1535. It should look like
this:
//FIXME: should probably move this cruft into
CG_BubbleTrail if ( sourceContentType == destContentType )
{ if ( sourceContentType & CONTENTS_WATER )
{ CG_BubbleTrail( start, tr.endpos, 32 ); } } else if
( sourceContentType & CONTENTS_WATER ) { trace_t
trace;
trap_CM_BoxTrace( &trace, end, start, NULL,
NULL, 0, CONTENTS_WATER ); CG_BubbleTrail( start,
trace.endpos, 32 ); } else if ( destContentType &
CONTENTS_WATER ) { trace_t trace;
trap_CM_BoxTrace(
&trace, start, end, NULL, NULL, 0, CONTENTS_WATER
); CG_BubbleTrail( tr.endpos, trace.endpos, 32
); }
All we need to do is comment out
the if's and call this regardless of contents. Change it to
look like this:
/*
- // FIXME: should probably
move this cruft into CG_BubbleTrail
if (
sourceContentType == destContentType ) { if (
sourceContentType & CONTENTS_WATER ) {
- */
- CG_BubbleTrail( start,
tr.endpos, 32 );
- /*
- }
} else if (
sourceContentType & CONTENTS_WATER ) { trace_t
trace;
trap_CM_BoxTrace( &trace, end, start,
NULL, NULL, 0, CONTENTS_WATER ); CG_BubbleTrail( start,
trace.endpos, 32 ); } else if ( destContentType &
CONTENTS_WATER ) { trace_t
trace;
trap_CM_BoxTrace( &trace, start, end,
NULL, NULL, 0, CONTENTS_WATER ); CG_BubbleTrail(
tr.endpos, trace.endpos, 32 ); }
- */
There you go. It should look
something like this: (note: I'm strafing to show the full
trail)

Created By: Hunter-Killer of Quick Phrag
Productions |