ok you see, i've been trying to make a new weapon called the Gauss Rifle and i'm getting some error .
g_weapon.c
/*
======================================================================
GAUSS RIFLE
======================================================================
*/
void gaussFire( gentity_t *ent )
{
gentity_t *m;
m = fire_gauss( ent, muzzle, forward );
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
}
g_missile.c
/*
=================
fire_gauss
=================
*/
gentity_t *fire_gauss( gentity_t *self, vec3_t start, vec3_t dir )
{
gentity_t *bolt;
VectorNormalize (dir);
bolt = G_Spawn();
bolt->classname = "gauss";
bolt->nextthink = level.time + 10000;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_GAUSS_RIFLE;
bolt->s.generic1 = self->s.generic1; //weaponMode
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = GRIFLE_DMG;
bolt->splashDamage = 0;
bolt->splashRadius = 0;
bolt->methodOfDeath = MOD_PRIFLE;
bolt->splashMethodOfDeath = MOD_PRIFLE;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
bolt->s.pos.trType = TR_LINEAR;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
VectorScale( dir, GRIFLE_SPEED, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy( start, bolt->r.currentOrigin );
return bolt;
}
bg_misc.c
{
WP_GAUSS_RIFLE, //int weaponNum;
GRIFLE_PRICE, //int price;
( 1 << S3 ), //int stages
SLOT_WEAPON, //int slots;
"grifle", //char *weaponName;
"Gauss Rifle", //char *weaponHumanName;
GRIFLE_CLIPS, //int maxAmmo;
GRIFLE_MAXCLIPS, //int maxClips;
qfalse, //int infiniteAmmo;
qtrue, //int usesEnergy;
GRIFLE_REPEAT, //int repeatRate1;
0, //int repeatRate2;
0, //int repeatRate3;
GRIFLE_RELOAD, //int reloadTime;
GRIFLE_K_SCALE, //float knockbackScale;
qfalse, //qboolean hasAltMode;
qfalse, //qboolean hasThirdMode;
qfalse, //qboolean canZoom;
90.0f, //float zoomFov;
qtrue, //qboolean purchasable;
qtrue, //qboolean longRanged;
0, //int buildDelay;
WUT_HUMANS //WUTeam_t team;
},
tremulous.h
#define GRIFLE_PRICE 550
#define GRIFLE_CLIPS 5
#define GRIFLE_MAXCLIPS 5
#define GRIFLE_REPEAT 3500
#define GRIFLE_K_SCALE 1.0f
#define GRIFLE_RELOAD 2000
#define GRIFLE_DMG HDM(170)
#define GRIFLE_SPEED 2000
but it gave me an error saying WP_GAUSS_RIFLE is undeclared.
and abit out of this topic:
how do i make a new projectile model?