Tremulous Forum

Mods => Modding Center => Topic started by: lizards160 on January 31, 2009, 01:47:01 am

Title: Alternate Fireing for weapons
Post by: lizards160 on January 31, 2009, 01:47:01 am
How do you add an alternate fire to a wep.
for example the blaster

I went to /src/game/tremulous.h
Code: [Select]
#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
Code: [Select]
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
Title: Re: Alternate Fireing for weapons
Post by: Foe of Eternity on February 14, 2009, 09:28:57 pm
did you make sure in bg_misc.c that hasAltMode is set to true?