GamePlanet
Planet:
-
News
- Contests
- Staff

Quake 3 Arena:
- Home
- Tutorials
- Maps
- Files
- Reviews
- Mods
- Models


Games:
- Jedi Knight
- Quake 3 Arena
- Unreal Tournament

Hosted Sites:
- Rebel Alliance Editors
- Get Hosted

Quake 3 Arena/Adding trails to bullets:
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