News:

Come Chat with us live! Learn how HERE!

Main Menu

Alternate Fireing for weapons

Started by lizards160, January 31, 2009, 01:47:01 AM

lizards160

How do you add an alternate fire to a wep.
for example the blaster

I went to /src/game/tremulous.h
#define BLASTER_REPEAT              400
#define BLASTER_K_SCALE             1.0f
#define BLASTER_SPREAD              200
#define BLASTER_SPEED               5000
#define BLASTER_DMG                 HDM(9)
#define BLASTER_SECONDARY_REPEAT 200
#define BLASTER_SECONDARY_SPREAD 100
#define BLASTER_SECONDARY_SPEED 5500
#define BLASTER_SECONDARY_DMG HDM(5)


then i went to /scr/game/g_weapons.c
void blasterFire( gentity_t *ent , qboolean secondary )
{
  gentity_t *m;

  if (secondary)
  {
  m = fire_blaster( ent, muzzle, forward );
  }
  else
  {
  m = fire_blaster( ent, muzzle, forward );
  }

//  VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta );  // "real" physics
}


I know that the fires for the blaster will be the same at the moment but what do i do now i believe there is a step i am missing somewhere please help

[edit] oh and i have made the cfg for the data
when i log into my server now i can shoot the altfire and all weapons but i somehow got rid of the collision detection for bullets... help please

Foe of Eternity

did you make sure in bg_misc.c that hasAltMode is set to true?

Quote from: player1 on February 17, 2008, 06:50:45 PM
No. Let n00bs pick overly destructive Human weapons and then use them in their own base and around their own teammates. Maybe then they'll learn that doing that is a stupid idea. Meanwhile, I will be slashing at their damaged Armoury, after I vault their smoking turrets and the scattered bodies of their TK' d teammates. N00bs: they're what's for breakfast.