Site hosted by Angelfire.com: Build your free website today!
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 );
            }
     */
              
		

Created By: Hunter-Killer