VF_LSTRING,// string on disk, pointer in memory, TAG_LEVEL
VF_VECTOR,
VF_BOOL,
VF_VEHTYPE,
VF_ANIM
}vehFieldType_t;
typedefstruct
{
char*name;
intofs;
vehFieldType_ttype;
}vehField_t;
vehField_tvehFields[VEH_PARM_MAX]=
{
{"name",VFOFS(name),VF_LSTRING},//unique name of the vehicle
//general data
{"type",VFOFS(type),VF_VEHTYPE},//what kind of vehicle
{"numHands",VFOFS(numHands),VF_INT},//if 2 hands, no weapons, if 1 hand, can use 1-handed weapons, if 0 hands, can use 2-handed weapons
{"lookPitch",VFOFS(lookPitch),VF_FLOAT},//How far you can look up and down off the forward of the vehicle
{"lookYaw",VFOFS(lookYaw),VF_FLOAT},//How far you can look left and right off the forward of the vehicle
{"length",VFOFS(length),VF_FLOAT},//how long it is - used for body length traces when turning/moving?
{"width",VFOFS(width),VF_FLOAT},//how wide it is - used for body length traces when turning/moving?
{"height",VFOFS(height),VF_FLOAT},//how tall it is - used for body length traces when turning/moving?
{"centerOfGravity",VFOFS(centerOfGravity),VF_VECTOR},//offset from origin: {forward, right, up} as a modifier on that dimension (-1.0f is all the way back, 1.0f is all the way forward)
{"speedMin",VFOFS(speedMin),VF_FLOAT},//if < 0, can go in reverse
{"speedIdle",VFOFS(speedIdle),VF_FLOAT},//what speed it drifts to when no accel/decel input is given
{"accelIdle",VFOFS(accelIdle),VF_FLOAT},//if speedIdle > 0, how quickly it goes up to that speed
{"acceleration",VFOFS(acceleration),VF_FLOAT},//when pressing on accelerator
{"decelIdle",VFOFS(decelIdle),VF_FLOAT},//when giving no input, how quickly it drops to speedIdle
{"strafePerc",VFOFS(strafePerc),VF_FLOAT},//multiplier on current speed for strafing. If 1.0f, you can strafe at the same speed as you're going forward, 0.5 is half, 0 is no strafing
//handling stats
{"bankingSpeed",VFOFS(bankingSpeed),VF_FLOAT},//how quickly it pitches and rolls (not under player control)
{"pitchLimit",VFOFS(pitchLimit),VF_FLOAT},//how far it can roll forward or backward
{"rollLimit",VFOFS(rollLimit),VF_FLOAT},//how far it can roll to either side
{"braking",VFOFS(braking),VF_FLOAT},//when pressing on decelerator
{"turningSpeed",VFOFS(turningSpeed),VF_FLOAT},//how quickly you can turn
{"turnWhenStopped",VFOFS(turnWhenStopped),VF_BOOL},//whether or not you can turn when not moving
{"traction",VFOFS(traction),VF_FLOAT},//how much your command input affects velocity
{"friction",VFOFS(friction),VF_FLOAT},//how much velocity is cut on its own
{"maxSlope",VFOFS(maxSlope),VF_FLOAT},//the max slope that it can go up with control
//durability stats
{"mass",VFOFS(mass),VF_INT},//for momentum and impact force (player mass is 10)
{"armor",VFOFS(armor),VF_INT},//total points of damage it can take
{"toughness",VFOFS(toughness),VF_FLOAT},//modifies incoming damage, 1.0 is normal, 0.5 is half, etc. Simulates being made of tougher materials/construction
{"malfunctionArmorLevel",VFOFS(malfunctionArmorLevel),VF_INT},//when armor drops to or below this point, start malfunctioning
//visuals & sounds
{"model",VFOFS(model),VF_LSTRING},//what model to use - if make it an NPC's primary model, don't need this?
{"skin",VFOFS(skin),VF_LSTRING},//what skin to use - if make it an NPC's primary model, don't need this?
{"riderAnim",VFOFS(riderAnim),VF_ANIM},//what animation the rider uses
{"explosionRadius",VFOFS(explosionRadius),VF_FLOAT},//range of explosion
{"explosionDamage",VFOFS(explosionDamage),VF_INT},//damage of explosion
//new stuff
{"maxPassengers",VFOFS(maxPassengers),VF_INT},// The max number of passengers this vehicle may have (Default = 0).
{"hideRider",VFOFS(hideRider),VF_BOOL},// rider (and passengers?) should not be drawn
{"killRiderOnDeath",VFOFS(killRiderOnDeath),VF_BOOL},//if rider is on vehicle when it dies, they should die
{"flammable",VFOFS(flammable),VF_BOOL},//whether or not the vehicle should catch on fire before it explodes
{"explosionDelay",VFOFS(explosionDelay),VF_INT},//how long the vehicle should be on fire/dying before it explodes
//camera stuff
{"cameraOverride",VFOFS(cameraOverride),VF_BOOL},//override the third person camera with the below values - normal is 0 (off)
{"cameraRange",VFOFS(cameraRange),VF_FLOAT},//how far back the camera should be - normal is 80
{"cameraVertOffset",VFOFS(cameraVertOffset),VF_FLOAT},//how high over the vehicle origin the camera should be - normal is 16
{"cameraHorzOffset",VFOFS(cameraHorzOffset),VF_FLOAT},//how far to left/right (negative/positive) of of the vehicle origin the camera should be - normal is 0
{"cameraPitchOffset",VFOFS(cameraPitchOffset),VF_FLOAT},//a modifier on the camera's pitch (up/down angle) to the vehicle - normal is 0
{"cameraFOV",VFOFS(cameraFOV),VF_FLOAT},//third person camera FOV, default is 80
{"cameraAlpha",VFOFS(cameraAlpha),VF_BOOL},//fade out the vehicle if it's in the way of the crosshair
};
stringID_table_tVehicleTable[VH_NUM_VEHICLES+1]=
{
ENUM2STRING(VH_WALKER),//something you ride inside of, it walks like you, like an AT-ST
ENUM2STRING(VH_FIGHTER),//something you fly inside of, like an X-Wing or TIE fighter
ENUM2STRING(VH_SPEEDER),//something you ride on that hovers, like a speeder or swoop
ENUM2STRING(VH_ANIMAL),//animal you ride on top of that walks, like a tauntaun
ENUM2STRING(VH_FLIER),//animal you ride on top of that flies, like a giant mynoc?
"",-1
};
voidG_VehicleSetDefaults(vehicleInfo_t*vehicle)
{
vehicle->name="default";//unique name of the vehicle
/*
//general data
vehicle->type=VH_SPEEDER;//what kind of vehicle
//FIXME: no saber or weapons if numHands = 2, should switch to speeder weapon, no attack anim on player
vehicle->numHands=2;//if 2 hands, no weapons, if 1 hand, can use 1-handed weapons, if 0 hands, can use 2-handed weapons
vehicle->lookPitch=35;//How far you can look up and down off the forward of the vehicle
vehicle->lookYaw=5;//How far you can look left and right off the forward of the vehicle
vehicle->length=0;//how long it is - used for body length traces when turning/moving?
vehicle->width=0;//how wide it is - used for body length traces when turning/moving?
vehicle->height=0;//how tall it is - used for body length traces when turning/moving?
VectorClear(vehicle->centerOfGravity);//offset from origin: {forward, right, up} as a modifier on that dimension (-1.0f is all the way back, 1.0f is all the way forward)
//speed stats - note: these are DESIRED speed, not actual current speed/velocity
vehicle->speedIdle=0;//what speed it drifts to when no accel/decel input is given
vehicle->accelIdle=0;//if speedIdle > 0, how quickly it goes up to that speed
vehicle->acceleration=VEH_DEFAULT_ACCEL;//when pressing on accelerator (1/2 this when going in reverse)
vehicle->decelIdle=VEH_DEFAULT_DECEL;//when giving no input, how quickly it desired speed drops to speedIdle
vehicle->strafePerc=VEH_DEFAULT_STRAFE_PERC;//multiplier on current speed for strafing. If 1.0f, you can strafe at the same speed as you're going forward, 0.5 is half, 0 is no strafing
//handling stats
vehicle->bankingSpeed=VEH_DEFAULT_BANKING_SPEED;//how quickly it pitches and rolls (not under player control)
vehicle->rollLimit=VEH_DEFAULT_ROLL_LIMIT;//how far it can roll to either side
vehicle->pitchLimit=VEH_DEFAULT_PITCH_LIMIT;//how far it can pitch forward or backward
vehicle->braking=VEH_DEFAULT_BRAKING;//when pressing on decelerator (backwards)
vehicle->turningSpeed=VEH_DEFAULT_TURNING_SPEED;//how quickly you can turn
vehicle->turnWhenStopped=qfalse;//whether or not you can turn when not moving
vehicle->traction=VEH_DEFAULT_TRACTION;//how much your command input affects velocity
vehicle->friction=VEH_DEFAULT_FRICTION;//how much velocity is cut on its own
vehicle->maxSlope=VEH_DEFAULT_MAX_SLOPE;//the max slope that it can go up with control
//durability stats
vehicle->mass=VEH_DEFAULT_MASS;//for momentum and impact force (player mass is 10)
vehicle->armor=VEH_DEFAULT_MAX_ARMOR;//total points of damage it can take
vehicle->toughness=VEH_DEFAULT_TOUGHNESS;//modifies incoming damage, 1.0 is normal, 0.5 is half, etc. Simulates being made of tougher materials/construction
vehicle->malfunctionArmorLevel=0;//when armor drops to or below this point, start malfunctioning
//visuals & sounds
vehicle->model="swoop";//what model to use - if make it an NPC's primary model, don't need this?
vehicle->modelIndex=0;//set internally, not until this vehicle is spawned into the level
vehicle->skin=NULL;//what skin to use - if make it an NPC's primary model, don't need this?
vehicle->riderAnim=BOTH_GUNSIT1;//what animation the rider uses
vehicle->gunswivelBone=NULL;//gun swivel bones
vehicle->lFinBone=NULL;//left fin bone
vehicle->rFinBone=NULL;//right fin bone
vehicle->lExhaustTag=NULL;//left exhaust tag
vehicle->rExhaustTag=NULL;//right exhaust tag
vehicle->soundOn=NULL;//sound to play when get on it
vehicle->soundLoop=NULL;//sound to loop while riding it
vehicle->soundOff=NULL;//sound to play when get off
vehicle->exhaustFX=NULL;//exhaust effect, played from "*exhaust" bolt(s)
vehicle->trailFX=NULL;//trail effect, played from "*trail" bolt(s)
vehicle->impactFX=NULL;//explosion effect, for when it blows up (should have the sound built into explosion effect)
vehicle->explodeFX=NULL;//explosion effect, for when it blows up (should have the sound built into explosion effect)
vehicle->wakeFX=NULL;//effect itmakes when going across water
//other misc stats
vehicle->gravity=VEH_DEFAULT_GRAVITY;//normal is 800
vehicle->hoverHeight=0;//if 0, it's a ground vehicle
vehicle->hoverStrength=0;//how hard it pushes off ground when less than hover height... causes "bounce", like shocks
vehicle->waterProof=qtrue;//can drive underwater if it has to
vehicle->bouyancy=1.0f;//when in water, how high it floats (1 is neutral bouyancy)
vehicle->fuelMax=1000;//how much fuel it can hold (capacity)
vehicle->fuelRate=1;//how quickly is uses up fuel
vehicle->visibility=VEH_DEFAULT_VISIBILITY;//radius for sight alerts
vehicle->loudness=VEH_DEFAULT_LOUDNESS;//radius for sound alerts
vehicle->explosionRadius=VEH_DEFAULT_EXP_RAD;
vehicle->explosionDamage=VEH_DEFAULT_EXP_DMG;
//new stuff
vehicle->maxPassengers=0;
vehicle->hideRider=qfalse;// rider (and passengers?) should not be drawn
vehicle->killRiderOnDeath=qfalse;//if rider is on vehicle when it dies, they should die
vehicle->flammable=qfalse;//whether or not the vehicle should catch on fire before it explodes
vehicle->explosionDelay=0;//how long the vehicle should be on fire/dying before it explodes
//camera stuff
vehicle->cameraOverride=qfalse;//whether or not to use all of the following 3rd person camera override values
vehicle->cameraRange=0.0f;//how far back the camera should be - normal is 80
vehicle->cameraVertOffset=0.0f;//how high over the vehicle origin the camera should be - normal is 16
vehicle->cameraHorzOffset=0.0f;//how far to left/right (negative/positive) of of the vehicle origin the camera should be - normal is 0
vehicle->cameraPitchOffset=0.0f;//a modifier on the camera's pitch (up/down angle) to the vehicle - normal is 0
vehicle->cameraFOV=0.0f;//third person camera FOV, default is 80
vehicle->cameraAlpha=qfalse;//fade out the vehicle if it's in the way of the crosshair