Navigation

 Linear Grenades Feature Type: Coding Tutorials     Added: 05/01  
  Author: Corven 

You can make the Grenade Launcher fire the grenades over long distances and in straight lines so the grenades aren't effected by gravity.

How to make grenades fly straight

Code to be Deleted or Commented out
Code to be Added or Changed

g_weapon.c

The following lines in the weapon_grenadelauncher_fire function adds alittle height when you fire off a grenade, so comment them out by adding a // infront of them, that will make them fire just straight forward where you point to.

// extra vertical velocity
// forward[2] += 0.2;
// VectorNormalize( forward );

g_missile.c

Let's make the grenades fly straight and not effected by gravity and fall to the floor, so in the fire_grenade find the line:-
bolt->s.pos.trType = TR_GRAVITY;

and change it to
bolt->s.pos.trType = TR_LINEAR;

Comments »



  Page 1

  Comments ( 0 )


  Features Index

  Home

Copyright © 2001 MGON International AB - Privacy statement