main.qh
vehicles/vehicles.qh
+../server/vehicles/vehicles_def.qh
sortlist.qc
miscfunctions.qc
tuba.qc
target_music.qc
+
vehicles/vehicles.qc
+../server/vehicles/network.qc
+
Main.qc
View.qc
interpolate.qc
axh.cnt = time;
}
-
-
-void VehicleRacerDraw()
-{
- Movetype_Physics_NoMatchServer();
- self.drawmask = MASK_NORMAL;
-}
-
-void VehicleRacerRemove()
-{
-}
-
-void Net_VehicleRacer(float bIsNew)
-{
- 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 CTF_STATE_COMMANDER = 3;
const float HUD_NORMAL = 0;
-const float HUD_SPIDERBOT = 10;
-const float HUD_WAKIZASHI = 11;
-const float HUD_RAPTOR = 12;
-const float HUD_BUMBLEBEE = 13;
+const float HUD_VEHICLE_FIRST = 10;
+const float HUD_SPIDERBOT = 10;
+const float HUD_WAKIZASHI = 11;
+const float HUD_RAPTOR = 12;
+const float HUD_BUMBLEBEE = 13;
+const float HUD_VEHICLE_LAST = 13;
const vector eX = '1 0 0';
const vector eY = '0 1 0';
float DEATH_QUIET = 10021;
float DEATH_HEADSHOT = 10022;
-
-#define DEATH_VHFIRST 10030
-#define DEATH_VHCRUSH 10030
-#define DEATH_SBMINIGUN 10031
-#define DEATH_SBROCKET 10032
-#define DEATH_SBBLOWUP 10033
-#define DEATH_WAKIGUN 10034
-#define DEATH_WAKIROCKET 10035
-#define DEATH_WAKIBLOWUP 10036
-#define DEATH_RAPTOR_CANNON 10037
-#define DEATH_RAPTOR_BOMB 10038
-#define DEATH_RAPTOR_BOMB_SPLIT 10039
-#define DEATH_RAPTOR_DEATH 10040
-#define DEATH_VHLAST 10040
+float DEATH_VHFIRST = 10030;
+float DEATH_VHCRUSH = 10030;
+float DEATH_SBMINIGUN = 10031;
+float DEATH_SBROCKET = 10032;
+float DEATH_SBBLOWUP = 10033;
+float DEATH_WAKIGUN = 10034;
+float DEATH_WAKIROCKET = 10035;
+float DEATH_WAKIBLOWUP = 10036;
+float DEATH_RAPTOR_CANNON = 10037;
+float DEATH_RAPTOR_BOMB = 10038;
+float DEATH_RAPTOR_BOMB_SPLIT = 10039;
+float DEATH_RAPTOR_DEATH = 10040;
+float DEATH_VHLAST = 10040;
#define DEATH_ISVEHICLE(t) ((t) >= DEATH_VHFIRST && (t) <= DEATH_VHLAST)
float DEATH_GENERIC = 10050;
float autocvar_g_vehicle_bumblebee_cannon_spread;
float autocvar_g_vehicle_bumblebee_cannon_force;
+float autocvar_g_vehicle_bumblebee_cannon_turnspeed;
+float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down;
+float autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up;
+float autocvar_g_vehicle_bumblebee_cannon_turnlimit_in;
+float autocvar_g_vehicle_bumblebee_cannon_turnlimit_out;
+
float autocvar_g_vehicle_bumblebee_respawntime;
float autocvar_g_vehicle_bumblebee_blowup_radius;
float autocvar_g_vehicle_bumblebee_blowup_edgedamage;
float autocvar_g_vehicle_bumblebee_blowup_forceintensity;
-
#define BUMB_MIN '-120 -120 -40'
#define BUMB_MAX '120 120 40'
vehic.solid = SOLID_NOT;
crosshair_trace(gunner);
- ftmp2 = autocvar_g_vehicle_raptor_cannon_turnspeed * frametime;
- ftmp = -ftmp2;
-
//vtmp = gettaginfo(vehic, gettagindexvehic, "tag_hardpoint01"));
vtmp = gettaginfo(gun, gettagindex(gun, "muzzle"));
vtmp = vectoangles(normalize(trace_endpos - vtmp)); // Find the direction & angle
vtmp = shortangle_vxy(vtmp - (vehic.angles + gun.angles), vehic.angles + gun.angles); // Find aim offset
// Bind to aimspeed
+ ftmp2 = autocvar_g_vehicle_bumblebee_cannon_turnspeed * frametime; ftmp = -ftmp2;
vtmp_x = bound(ftmp, vtmp_x, ftmp2);
vtmp_y = bound(ftmp, vtmp_y, ftmp2);
// Bind to limts
- gun.angles_x = bound(-autocvar_g_vehicle_raptor_cannon_pitchlimit_down, vtmp_x + gun.angles_x, autocvar_g_vehicle_raptor_cannon_pitchlimit_up);
- gun.angles_y = bound(-autocvar_g_vehicle_raptor_cannon_turnlimit, vtmp_y + gun.angles_y, autocvar_g_vehicle_raptor_cannon_turnlimit);
+ gun.angles_x = bound(-autocvar_g_vehicle_bumblebee_cannon_pitchlimit_down, vtmp_x + gun.angles_x, autocvar_g_vehicle_bumblebee_cannon_pitchlimit_up);
+ gun.angles_y = bound(-autocvar_g_vehicle_bumblebee_cannon_turnlimit_in, vtmp_y + gun.angles_y, autocvar_g_vehicle_bumblebee_cannon_turnlimit_out);
if(gunner.BUTTON_ATCK && gun.cnt <= time)
{
bumb_spawn, autocvar_g_vehicle_bumblebee_respawntime,
bumb_pilot_frame,
bumb_enter, bumb_exit,
- bumb_die, bumb_think))
+ bumb_die, bumb_think,
+ FALSE))
{
remove(self);
return;
--- /dev/null
+#ifdef VEHICLES_CSQC
+// SendFlags
+float VSF_SETUP = 1; /// Send vehicle type etc
+float VSF_ORIGIN = 2; /// Send location
+float VSF_MOVEMENT = 4; /// Send movement update (and angles)
+float VSF_AVEL = 8; /// Send Angular velocity
+float VSF_STATS = 16; /// Send ammo, health etc
+float VSF_EXTRA = 32; /// Send additional data (turret rotations and such). Handeld per vehicle type.
+float VSF_ANIMINFO = 64; /// Animation info
+float VSF_FAR = 128;
+float VSF_FULL_UPDATE = 16777215; /// Send everything
+
+#ifdef SVQC
+#define VSF_FARDISTANCE 2000
+float send_vehile(entity to, float sf)
+{
+ float dist;
+ var void WriteFunc(float, float);
+
+ dist = vlen(self.origin - to.origin);
+ if(dist > VSF_FARDISTANCE && to != self.owner)
+ sf |= VSF_FAR;
+
+ // Always send a movement and origin to owner
+ if(to == self.owner)
+ sf |= VSF_ORIGIN | VSF_MOVEMENT;
+
+ WriteByte(MSG_ENTITY, ENT_CLIENT_VEHICLE);
+
+ // We need to know client-side what was sent
+ WriteByte(MSG_ENTITY, sf);
+
+ if(sf & VSF_SETUP)
+ {
+ WriteByte(MSG_ENTITY, self.hud); //vehicle type = hud
+ WriteByte(MSG_ENTITY, self.team);
+ WriteShort(MSG_ENTITY, self.colormap);
+ }
+
+ if(sf & VSF_ORIGIN)
+ {
+ WriteFunc = ((sf & VSF_FAR) ? WriteShort : WriteCoord);
+ WriteFunc(MSG_ENTITY, self.origin_x);
+ WriteFunc(MSG_ENTITY, self.origin_y);
+ WriteFunc(MSG_ENTITY, self.origin_z);
+ }
+
+ if(sf & VSF_MOVEMENT)
+ {
+ WriteFunc = ((sf & VSF_FAR) ? WriteShort : WriteCoord);
+ WriteCoord(MSG_ENTITY, self.velocity_x);
+ WriteCoord(MSG_ENTITY, self.velocity_y);
+ WriteCoord(MSG_ENTITY, self.velocity_z);
+
+ WriteFunc = ((sf & VSF_FAR) ? WriteShort : WriteAngle);
+ WriteAngle(MSG_ENTITY, self.angles_x);
+ WriteAngle(MSG_ENTITY, self.angles_y);
+ WriteAngle(MSG_ENTITY, self.angles_z);
+ }
+
+ if(sf & VSF_AVEL)
+ {
+ WriteFunc = ((sf & VSF_FAR) ? WriteShort : WriteCoord);
+ WriteCoord(MSG_ENTITY, self.avelocity_x);
+ WriteCoord(MSG_ENTITY, self.avelocity_y);
+ WriteCoord(MSG_ENTITY, self.avelocity_z);
+ }
+
+ if(sf & VSF_STATS)
+ {
+ if(to == self.owner)
+ {
+ WriteByte(MSG_ENTITY, 1);
+ WriteByte(MSG_ENTITY, self.vehicle_shield);
+ WriteByte(MSG_ENTITY, self.vehicle_energy);
+
+ WriteByte(MSG_ENTITY, self.vehicle_ammo1);
+ WriteByte(MSG_ENTITY, self.vehicle_reload1);
+
+ WriteByte(MSG_ENTITY, self.vehicle_ammo2);
+ WriteByte(MSG_ENTITY, self.vehicle_reload2);
+
+ }
+ else
+ WriteByte(MSG_ENTITY, 0);
+
+ WriteByte(MSG_ENTITY, self.vehicle_health);
+ }
+
+ if(sf & VSF_EXTRA)
+ self.vehile_send_exta(to, sf);
+
+ return TRUE;
+}
+
+void net_link_vehile()
+{
+ self.SendFlags = 0xFFFFFF;
+ Net_LinkEntity(self, FALSE, 0, send_vehile);
+}
+#endif // SVQC
+
+#ifdef CSQC
+void Net_ReadVehicle(float bIsNew)
+{
+ float sf;
+ var float ReadFunc();
+
+ 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;*/
+ }
+
+ sf = ReadByte();
+ if(sf & VSF_SETUP)
+ {
+ self.vehicle_hud = ReadByte();
+ self.team = ReadByte();
+ self.colormap = ReadShort();
+
+ switch(self.vehicle_hud)
+ {
+ case HUD_WAKIZASHI:
+ break;
+ case HUD_SPIDERBOT:
+ break;
+ case HUD_RAPTOR:
+ break;
+ case HUD_BUMBLEBEE:
+ break;
+ default:
+ break;
+ }
+ }
+
+ if(sf & VSF_ORIGIN)
+ {
+ ReadFunc = ((sf & VSF_FAR) ? ReadShort : ReadCoord);
+ self.origin_x = ReadCoord();
+ self.origin_y = ReadCoord();
+ self.origin_z = ReadCoord();
+ self.move_origin = self.origin;
+ }
+
+ if(sf & VSF_MOVEMENT)
+ {
+ ReadFunc = ((sf & VSF_FAR) ? ReadShort : ReadCoord);
+ self.velocity_x = ReadFunc();
+ self.velocity_y = ReadFunc();
+ self.velocity_z = ReadFunc();
+
+ ReadFunc = ((sf & VSF_FAR) ? ReadShort : ReadAngle);
+ self.angles_x = ReadFunc();
+ self.angles_y = ReadFunc();
+ self.angles_z = ReadFunc();
+
+ self.move_velocity = self.velocity;
+ self.move_angles = self.angles;
+ }
+
+ if(sf & VSF_AVEL)
+ {
+ ReadFunc = ((sf & VSF_FAR) ? ReadShort : ReadCoord);
+ self.avelocity_x = ReadFunc();
+ self.avelocity_y = ReadFunc();
+ self.avelocity_z = ReadFunc();
+ }
+
+ if(sf & VSF_EXTRA)
+ self.vehile_read_exta(sf);
+
+}
+
+#endif // CSQC
+
+#endif // VEHICLES_CSQC
float autocvar_g_vehicle_racer_rocket_locked_maxangle;
float autocvar_g_vehicle_racer_respawntime;
-float autocvar_g_vehicle_racer_collision_multiplier;
float autocvar_g_vehicle_racer_blowup_radius;
float autocvar_g_vehicle_racer_blowup_coredamage;
racer_spawn, autocvar_g_vehicle_racer_respawntime,
racer_frame,
racer_enter, racer_exit,
- racer_die, racer_think))
+ racer_die, racer_think,
+ FALSE))
{
remove(self);
return;
raptor_spawn, autocvar_g_vehicle_raptor_respawntime,
raptor_frame,
raptor_enter, raptor_exit,
- raptor_die, raptor_think))
+ raptor_die, raptor_think,
+ FALSE))
{
remove(self);
return;
float autocvar_g_vehicle_spiderbot_minigun_ammo_regen;
float autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause;
-
float autocvar_g_vehicle_spiderbot_rocket_damage;
-float autocvar_g_vehicle_spiderbot_rocket_edgedamage;
float autocvar_g_vehicle_spiderbot_rocket_force;
-float autocvar_g_vehicle_spiderbot_rocket_health;
-float autocvar_g_vehicle_spiderbot_rocket_lifetime;
-float autocvar_g_vehicle_spiderbot_rocket_noise;
float autocvar_g_vehicle_spiderbot_rocket_radius;
+float autocvar_g_vehicle_spiderbot_rocket_speed;
float autocvar_g_vehicle_spiderbot_rocket_refire;
float autocvar_g_vehicle_spiderbot_rocket_reload;
-float autocvar_g_vehicle_spiderbot_rocket_speed;
+float autocvar_g_vehicle_spiderbot_rocket_health;
+float autocvar_g_vehicle_spiderbot_rocket_noise;
float autocvar_g_vehicle_spiderbot_rocket_turnrate;
-
+float autocvar_g_vehicle_spiderbot_rocket_lifetime;
void spiderbot_exit(float eject);
void spiderbot_enter();
spider.tur_head.angles_y = bound(autocvar_g_vehicle_spiderbot_head_turnlimit * -1, spider.tur_head.angles_y + ad_y, autocvar_g_vehicle_spiderbot_head_turnlimit);
// Pitch head
+#if 0 // Enable to pich by cross-trace (more precise in chase, but less predictable)
ad = vectoangles(normalize(trace_endpos - gettaginfo(spider.tur_head,gettagindex(spider.tur_head,"tag_hud")))) - (spider.tur_head.angles + spider.angles);
if(ad_x > 180) ad_x -= 360;
if(ad_x < -180) ad_x += 360;
-
+#endif
ftmp = autocvar_g_vehicle_spiderbot_head_pitchspeed * sys_frametime;
ad_x = bound(ftmp * -1, ad_x, ftmp);
spider.tur_head.angles_x = bound(autocvar_g_vehicle_spiderbot_head_pitchlimit_down, spider.tur_head.angles_x + ad_x, autocvar_g_vehicle_spiderbot_head_pitchlimit_up);
ftmp = bound(-ftmp, spider.tur_head.angles_y, ftmp);
#endif
- makevectors(spider.angles + '-1 0 0' * spider.angles_x);
+ makevectors(spider.angles + '-2 0 0' * spider.angles_x);
- /*
+/*
vector ofs;
ofs = self.origin + v_up * 128;
te_lightning1(world, ofs, ofs + v_up * 32);
te_lightning1(world, ofs, ofs + v_right * 128);
te_lightning1(world, ofs, ofs + v_forward * 256);
- */
+*/
movelib_groundalign4point(autocvar_g_vehicle_spiderbot_springlength, autocvar_g_vehicle_spiderbot_springup, autocvar_g_vehicle_spiderbot_springblend);
vehicles_regen(cnt, vehicle_ammo1, autocvar_g_vehicle_spiderbot_minigun_ammo_max,
autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause,
autocvar_g_vehicle_spiderbot_minigun_ammo_regen, frametime);
-
- dprint("1: ammo1:", ftos(spider.vehicle_ammo1), "\n");
spiderbot_rocket_do();
player.vehicle_ammo2 = spider.tur_head.frame;
if(spider.gun2.cnt <= time)
- player.vehicle_reload2 = 1;
+ player.vehicle_reload2 = 100;
else
- player.vehicle_reload2 = 1 - ((spider.gun2.cnt - time) / spider.attack_finished_single);
+ player.vehicle_reload2 = 100 - ((spider.gun2.cnt - time) / spider.attack_finished_single) * 100;
setorigin(player, spider.origin + '0 0 1' * SPIDERBOT_MAX_z);
player.velocity = spider.velocity;
spiderbot_spawn, autocvar_g_vehicle_spiderbot_respawntime,
spiderbot_frame,
spiderbot_enter, spiderbot_exit,
- spiderbot_die, spiderbot_think))
+ spiderbot_die, spiderbot_think,
+ FALSE))
{
remove(self);
return;
return v_forward * force_fromtag_power;
}
-// Experimental hovermode wich uses attraction/repulstion from surface unsted of gravity/repulsion
+// Experimental hovermode wich uses attraction/repulstion from surface insted of gravity/repulsion
// Can possibly be use to move abt any surface (inclusing walls/celings)
vector vehicles_force_fromtag_maglev(string tag_name, float spring_length, float max_power)
{
self.bot_attack = TRUE;
self.flags = FL_NOTARGET;
self.avelocity = '0 0 0';
-
+ self.velocity = '0 0 0';
+
// Reset locking
self.lock_strength = 0;
self.lock_target = world;
self.owner.vehicle_reload1 = self.vehicle_reload1;
self.owner.vehicle_reload2 = self.vehicle_reload2;
- // Cnnt do this, hides attached objects too.
+ // Cant do this, hides attached objects too.
//self.exteriormodeltoclient = self.owner;
//self.tur_head.exteriormodeltoclient = self.owner;
WriteByte (MSG_ONE, SVC_SETVIEWPORT);
WriteEntity( MSG_ONE, self.owner);
- WriteByte (MSG_ONE, SVC_SETVIEWANGLES); // 10 = SVC_SETVIEWANGLES
- WriteAngle(MSG_ONE, 0); // tilt
+ WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
+ WriteAngle(MSG_ONE, 0); // pich
WriteAngle(MSG_ONE, self.angles_y); // yaw
WriteAngle(MSG_ONE, 0); // roll
else
_colormap = 1024;
- _glowmod = '0 0 0';
- _colormod = '0 0 0';
+ _glowmod = '0 0 0';
+ _colormod = '0 0 0';
// Find all ents attacked to main model and setup effects, colormod etc.
e = findchainentity(tag_entity, self);
self.vehicle_hudmodel.colormap = self.colormap = _colormap;
self.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
- self.alpha = 1;
- self.avelocity = '0 0 0';
- self.velocity = '0 0 0';
- self.effects = _effects;
+ self.alpha = 1;
+ self.avelocity = '0 0 0';
+ self.velocity = '0 0 0';
+ self.effects = _effects;
}
float vehicle_initialize(string net_name,
string hudtag,
string viewtag,
float vhud,
- vector min_s,
- vector max_s,
- float nodrop,
+ vector min_s,
+ vector max_s,
+ float nodrop,
void() spawnproc,
float _respawntime,
float() physproc,
void() enterproc,
void(float extflag) exitfunc,
void() dieproc,
- void() thinkproc )
+ void() thinkproc,
+ float use_csqc)
{
addstat(STAT_HUD, AS_INT, hud);
addstat(STAT_VEHICLESTAT_HEALTH, AS_INT, vehicle_health);
tracebox(self.origin + '0 0 100', min_s, max_s, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
setorigin(self, trace_endpos);
}
-
- //self.vehicle_hudmodel.effects = EF_NODEPTHTEST;
+
self.pos1 = self.origin;
self.pos2 = self.angles;
-
+#ifdef VEHICLES_CSQC
+ if(use_csqc)
+ net_link_vehile();
+#endif
return TRUE;
}
self.vehicle_die = self.vehicle_exit;
self.vehicle_spawn = self.vehicle_exit;
self.AuxiliaryXhair = self.AuxiliaryXhair;
-}
-
-#ifdef VEHICLES_CSQC
-// SendFlags
-float VSF_SETUP = 2; /// Send vehicle type etc
-float VSF_ORIGIN = 4; /// Send location
-float VSF_MOVEMENT = 8; /// Send movement update (and angle/avelocity)
-float VSF_STATS = 16; /// Send ammo, health etc
-float VSF_EXTRA = 32; /// Send additional data (turret rotations and such). Handeld per vehicle type.
-float VSF_ANIMINFO = 64; /// Animation info
-float VSF_FULL_UPDATE = 16777215 /// Send everything
-
-#ifdef SVQC
-float send_vehile(entity to, float sf)
-{
- float dist;
-
- // Always send a compleate update to owner, minus VSF_SETUP
- if(to == self.owner && self.owner != world && sf != VSF_FULL_UPDATE)
- sf |= (VSF_FULL_UPDATE &~= VSF_SETUP);
-
- dist = vlen(self.origin - to.origin);
- // TODO: Distance based message filtering
-
- WriteByte(MSG_ENTITY, ENT_CLIENT_VEHICLE);
-
- // We need to know client-side what was sent
- WriteByte(MSG_ENTITY, sf);
-
- if(sf & VSF_SETUP)
- {
- WriteByte(MSG_ENTITY, self.hud); //vehicle type = hud
- WriteByte(MSG_ENTITY, self.team);
- WriteShort(MSG_ENTITY, self.colormap);
- }
-
- if(sf & VSF_ORIGIN)
- {
- WriteCoord(MSG_ENTITY, self.origin_x);
- WriteCoord(MSG_ENTITY, self.origin_y);
- WriteCoord(MSG_ENTITY, self.origin_z);
- }
-
- if(sf & VSF_MOVEMENT)
- {
- 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);
-
- WriteCoord(MSG_ENTITY, self.avelocity_x);
- WriteCoord(MSG_ENTITY, self.avelocity_y);
- WriteCoord(MSG_ENTITY, self.avelocity_z);
- }
-
- /*
- if(sf & VSF_STATS)
- {
- WriteByte(MSG_ENTITY, self.vehicle_health);
- WriteByte(MSG_ENTITY, self.vehicle_shield);
- WriteByte(MSG_ENTITY, self.vehicle_energy);
-
- WriteByte(MSG_ENTITY, self.vehicle_ammo1);
- WriteByte(MSG_ENTITY, self.vehicle_reload1);
-
- WriteByte(MSG_ENTITY, self.vehicle_ammo2);
- WriteByte(MSG_ENTITY, self.vehicle_reload2);
- }
- */
-
- if(sf & VSF_EXTRA)
- {
- self.vehile_send_exta(to);
- }
-
- return TRUE;
-}
-
-void net_link_vehile()
-{
- self.SendFlags = 0xFFFFFF;
- Net_LinkEntity(self, FALSE, 0, send_vehile);
-}
-#endif // SVQC
-
-#ifdef CSQC
-void Net_ReadVehicle(float bIsNew)
-{
- float sf;
-
- 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;
- }
-
- sf = ReadByte();
- if(sf & VSF_SETUP)
- {
- self.hud = ReadByte();
- self.team = ReadByte();
- self.colormap = ReadShort();
- }
-
- if(sf & if(sf & VSF_ORIGIN))
- {
- self.origin_x = ReadCoord();
- self.origin_y = ReadCoord();
- self.origin_z = ReadCoord();
- self.move_origin = self.origin;
- }
-
- if(sf & VSF_MOVEMENT)
- {
- 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_velocity = self.velocity;
- self.move_angles = self.angles;
- }
-
-}
-#endif // CSQC
-
-#endif // VEHICLES_CSQC
+}
\ No newline at end of file
#ifdef VEHICLES_ENABLED
//#include "collision.qc"
+#include "network.qc"
#include "vehicles.qc"
#include "racer.qc"
#include "spiderbot.qc"
#include "raptor.qc"
-#include "bumblebee.qc"
+//#include "bumblebee.qc"
#endif
#ifdef VEHICLES_ENABLED
//#define VEHICLES_VIEWROTATE_CROSSHAIR
-#message "with tZork vehicles (experimental)"
+//#message "with tZork vehicles (experimental)"
.float vehicle_flags;
float VHF_ISVEHICLE = 2; /// Indicates vehicle
float VHF_MOVE_HOVER = 256; /// Vehicle hover close to gound
float VHF_MOVE_FLY = 512; /// Vehicle is airborn
-.float hud;
-
.entity gun1;
.entity gun2;
.entity vehicle_hudmodel;
#ifdef SVQC
+.float hud;
.float dmg_time;
.float vehicle_respawntime;
.void() vehicle_spawn;
var .void() vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
#ifdef VEHICLES_CSQC
-var .void(entity to) vehile_send_exta; /// Vehicles custom send code (for extra bits, stats and whatnot)
+var .void(entity to, float sflags) vehile_send_exta; /// Vehicles custom send code (for extra bits, stats and whatnot)
void net_link_vehile(); /// Initiates csqc networking for vehicle
#endif //VEHICLES_CSQC
#endif //SVQC
+#ifdef CSQC
+#ifdef VEHICLES_CSQC
+.float vehicle_hud;
+void vehicle_spiderbot_assemble() {};
+void vehicle_racer_assemble() {};
+void vehicle_raptor_assemble() {};
+void vehicle_bumblebee_assemble() {};
+void Net_ReadVehicle(float bIsNew);
+var .void (float sf)vehile_read_exta;
+#endif //VEHICLES_CSQC
+#endif //CSQC
+
#ifdef VEHICLES_USE_ODE
void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
void(entity e, vector force, vector force_pos) physics_addforce = #541; // apply a force from certain origin, length of force vector is power of force
set g_vehicle_bumblebee_cannon_speed 5000
set g_vehicle_bumblebee_cannon_spread 0.0125
set g_vehicle_bumblebee_cannon_force 400
+set g_vehicle_bumblebee_cannon_turnspeed 90
+set g_vehicle_bumblebee_cannon_pitchlimit_down 60
+set g_vehicle_bumblebee_cannon_pitchlimit_up 60
+set g_vehicle_bumblebee_cannon_turnlimit_in 5
+set g_vehicle_bumblebee_cannon_turnlimit_out 45
set g_vehicle_bumblebee_respawntime 10
set g_vehicle_spiderbot_speed_strafe 300
set g_vehicle_spiderbot_movement_inertia 0.25
-set g_vehicle_spiderbot_minigun_damage 10
+set g_vehicle_spiderbot_minigun_damage 15
set g_vehicle_spiderbot_minigun_spread 0.015
set g_vehicle_spiderbot_minigun_speed 50000
set g_vehicle_spiderbot_minigun_refire 0.05
set g_vehicle_spiderbot_minigun_ammo_cost 1
set g_vehicle_spiderbot_minigun_ammo_max 100
-set g_vehicle_spiderbot_minigun_ammo_regen 5
+set g_vehicle_spiderbot_minigun_ammo_regen 10
set g_vehicle_spiderbot_minigun_ammo_regen_pause 1
set g_vehicle_spiderbot_springlength 150