case ENT_CLIENT_GAUNTLET: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_GAUNTLET); break;
case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
case ENT_CLIENT_AUXILIARYXHAIR: Net_AuXair2(bIsNewEntity); break;
+ case ENT_CLIENT_VEHICLE_RACER: Net_VehicleRacer(bIsNewEntity); break;
default:
error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
break;
Net_WeaponComplain();
bHandled = true;
break;
- case TE_CSQC_AUXILIARYXHAIR:
- Net_AuXair();
- bHandled = true;
- break;
case TE_CSQC_VEHICLESETUP:
Net_VehicleSetup();
bHandled = true;
}
-void Net_AuXair()
+void Net_AuXair2(float bIsNew)
{
float axh_id;
entity axh;
axh.colormod_z = ReadByte() / 255;
axh.cnt = time;
}
-void Net_AuXair2(float blah)
+
+
+
+void VehicleRacerDraw()
+{
+ //Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
+ Movetype_Physics_NoMatchServer();
+ self.drawmask = MASK_NORMAL;
+}
+
+void VehicleRacerRemove()
+{
+}
+
+void Net_VehicleRacer(float bIsNew)
{
- Net_AuXair();
+ if(bIsNew)
+ {
+ setmodel(self, "models/vehicles/wakizashi.dpm");
+ self.move_movetype = MOVETYPE_BOUNCE;
+ self.entremove = VehicleRacerRemove;
+ setsize(self, '-60 -60 -20', '60 60 20');
+ self.draw = VehicleRacerDraw;
+ self.scale = 0.5;
+ }
+
+ self.cnt = ReadByte();
+
+ self.origin_x = ReadCoord();
+ self.origin_y = ReadCoord();
+ self.origin_z = ReadCoord();
+
+ self.velocity_x = ReadCoord();
+ self.velocity_y = ReadCoord();
+ self.velocity_z = ReadCoord();
+
+ self.angles_x = ReadAngle();
+ self.angles_y = ReadAngle();
+ self.angles_z = ReadAngle();
+
+ self.move_origin = self.origin;
+ self.move_velocity = self.velocity;
+ self.move_angles = self.angles;
+
+ setorigin(self, self.origin);
}
+
+
+
void Net_VehicleSetup()
{
const float TE_CSQC_WEAPONCOMPLAIN = 113;
const float TE_CSQC_NEX_SCOPE = 116;
const float TE_CSQC_MINELAYER_MAXMINES = 117;
-const float TE_CSQC_AUXILIARYXHAIR = 118;
const float TE_CSQC_VEHICLESETUP = 119;
const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
const float ENT_CLIENT_TURRET = 40;
const float ENT_CLIENT_AUXILIARYXHAIR = 50;
+const float ENT_CLIENT_VEHICLE_RACER = 60;
const float SPRITERULE_DEFAULT = 0;
const float SPRITERULE_TEAMPLAY = 1;
float autocvar_g_vehicle_racer_speed_strafe;
float autocvar_g_vehicle_racer_springlength;
float autocvar_g_vehicle_racer_upforcedamper;
+float autocvar_g_vehicle_racer_friction;
float autocvar_g_vehicle_racer_hovertype;
float autocvar_g_vehicle_racer_hoverpower;
racer.angles_x *= -1;
#endif
- df = racer.velocity * -0.5;
+ df = racer.velocity * -autocvar_g_vehicle_racer_friction;
if(player.movement_x != 0)
{
void racer_enter()
{
- self.movetype = MOVETYPE_BOUNCE; //MISSILE;
+ self.movetype = MOVETYPE_BOUNCE;
self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_racer_health);
self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_racer_shield);
}
void raptor_fire_cannon(entity gun, string tagname)
{
entity bolt;
- vector b_org;
+ vector b_org;
b_org = gettaginfo(gun, gettagindex(gun, tagname));
bolt = vehicles_projectile("raptor_cannon_impact", "weapons/laserimpact.wav", "raptor_cannon_muzzleflash", "weapons/lasergun_fire.wav",
b_org, normalize(v_forward + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed,
self.solid = SOLID_BBOX;
self.owner.vehicle_health = (self.vehicle_health / autocvar_g_vehicle_raptor_health);
self.owner.vehicle_shield = (self.vehicle_shield / autocvar_g_vehicle_raptor_shield);
-
self.velocity_z = 1; // Nudge upwards to takeoff sequense can work.
+ self.tur_head.exteriormodeltoclient = self.owner;
#ifdef RAPTOR_RETARDCAMERA
setorigin(self.vehicle_viewport, self.origin);
void raptor_exit(float eject)
{
-
+ self.tur_head.exteriormodeltoclient = world;
+
if(self.deadflag == DEAD_NO)
{
self.think = raptor_land;
self.bomb2 = spawn();
self.gun1 = spawn();
self.gun2 = spawn();
-
+
#ifdef RAPTOR_RETARDCAMERA
setattachment(self.vehicle_viewport, world, "");
#endif
- setmodel(self.bomb1,"models/vehicles/clusterbomb.md3");
- setmodel(self.bomb2,"models/vehicles/clusterbomb.md3");
+ setmodel(self.bomb1,"models/vehicles/clusterbomb_folded.md3");
+ setmodel(self.bomb2,"models/vehicles/clusterbomb_folded.md3");
setmodel(self.gun1, "models/vehicles/raptor_gun.dpm");
setmodel(self.gun2, "models/vehicles/raptor_gun.dpm");
+ setmodel(self.tur_head, "models/vehicles/raptor_body.dpm");
setattachment(self.bomb1, self,"bombmount_left");
setattachment(self.bomb2, self,"bombmount_right");
+ setattachment(self.tur_head, self,"root");
// FIXME Guns mounts to angled bones
precache_model ("models/vehicles/spinner.dpm");
precache_model ("models/vehicles/raptor_cockpit.dpm");
precache_model ("models/vehicles/clusterbomb.md3");
+ precache_model ("models/vehicles/clusterbomb_folded.md3");
+ precache_model ("models/vehicles/raptor_body.dpm");
self.think = raptor_dinit;
self.nextthink = time + 1;
}
+//#define VEHICLES_CSQC
+#ifdef VEHICLES_CSQC
+#define VSF_ORG 2
+#define VSF_VEL 4
+#define VSF_ANG 8
+#define VSF_COLORMAP 16
+#define VSF_STAT1 32
+
+float SendVehicle(entity to, float sf)
+{
+ WriteByte(MSG_ENTITY, ENT_CLIENT_VEHICLE_RACER);
+
+ WriteByte(MSG_ENTITY, self.cnt);
+
+ WriteCoord(MSG_ENTITY, self.origin_x);
+ WriteCoord(MSG_ENTITY, self.origin_y);
+ WriteCoord(MSG_ENTITY, self.origin_z);
+
+ WriteCoord(MSG_ENTITY, self.velocity_x);
+ WriteCoord(MSG_ENTITY, self.velocity_y);
+ WriteCoord(MSG_ENTITY, self.velocity_z);
+
+ WriteAngle(MSG_ENTITY, self.angles_x);
+ WriteAngle(MSG_ENTITY, self.angles_y);
+ WriteAngle(MSG_ENTITY, self.angles_z);
+
+ return TRUE;
+}
+
+void NetLinkVehicle()
+{
+ self.SendFlags = 0xFFFFFF;
+ Net_LinkEntity(self, FALSE, 0, SendVehicle);
+}
+#endif
+
float vehicle_initialize(string net_name,
string bodymodel,
string topmodel,
#ifdef VEHICLES_ENABLED
//#include "collision.qc"
#include "vehicles.qc"
+
#include "racer.qc"
#include "spiderbot.qc"
#include "raptor.qc"
set g_vehicle_racer_speed_forward 1000
set g_vehicle_racer_speed_strafe 750
set g_vehicle_racer_speed_afterburn 2000
-set g_vehicle_racer_afterburn_cost 75 // energy consumed per second
+set g_vehicle_racer_friction 0.7
+set g_vehicle_racer_afterburn_cost 60 // energy consumed per second
set g_vehicle_racer_hovertype 0 // 0 = hover, != 0 = maglev
set g_vehicle_racer_hoverpower 3600 // NOTE!! x 4 (4 engines)