]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix rocket reload displaybug on spider. Disable crosshair-trace-pich for spider....
authorJakob MG <jakob_mg@hotmail.com>
Thu, 14 Apr 2011 00:49:56 +0000 (02:49 +0200)
committerJakob MG <jakob_mg@hotmail.com>
Thu, 14 Apr 2011 00:49:56 +0000 (02:49 +0200)
13 files changed:
qcsrc/client/progs.src
qcsrc/client/vehicles/vehicles.qc
qcsrc/common/constants.qh
qcsrc/server/vehicles/bumblebee.qc
qcsrc/server/vehicles/network.qc [new file with mode: 0644]
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vehicles/vehicles.qc
qcsrc/server/vehicles/vehicles.qh
qcsrc/server/vehicles/vehicles_def.qh
vehicle_bumblebee.cfg
vehicle_spiderbot.cfg

index 41e2dd6300b3eeea1686a99ae02b114bb1a79d2b..2e8992134e859e207ea9b472022369ca71756f46 100644 (file)
@@ -32,6 +32,7 @@ noise.qh
 
 main.qh
 vehicles/vehicles.qh
+../server/vehicles/vehicles_def.qh
 
 sortlist.qc
 miscfunctions.qc
@@ -58,7 +59,10 @@ modeleffects.qc
 tuba.qc
 target_music.qc
 
+
 vehicles/vehicles.qc
+../server/vehicles/network.qc
+
 Main.qc
 View.qc
 interpolate.qc
index 76c65111c7ea477a0aae08f77ee281b79f33a330..9b13086253cdcbeb28ceaf06319d925e7fd1ff07 100644 (file)
@@ -96,53 +96,6 @@ void Net_AuXair2(float bIsNew)
     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()
 {
 
index 6c4db183668d44dc42f107b2193af78189e95501..cbcec2cd31e4d862c1c4cca6f5d34fece0642a0f 100644 (file)
@@ -332,10 +332,12 @@ const float CTF_STATE_DEFEND = 2;
 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';
@@ -528,20 +530,19 @@ float DEATH_TURRET = 10020;
 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;
index 93c867e9337d472ff745d37750db603f23430826..91f47dbefa62411560742b0b345be99dceb1b52e 100644 (file)
@@ -28,6 +28,12 @@ float autocvar_g_vehicle_bumblebee_cannon_speed;
 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;
@@ -35,7 +41,6 @@ float autocvar_g_vehicle_bumblebee_blowup_coredamage;
 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'
 
@@ -56,20 +61,18 @@ float bumb_gunner_frame()
     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)
     {
@@ -281,7 +284,8 @@ void bumb_dinit()
              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;
diff --git a/qcsrc/server/vehicles/network.qc b/qcsrc/server/vehicles/network.qc
new file mode 100644 (file)
index 0000000..33bbfea
--- /dev/null
@@ -0,0 +1,181 @@
+#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
index 00bca4bce402d54acd8472f24e2fbda43048c30f..1799c26a922fc6d95ac202b05ed807436059609b 100644 (file)
@@ -60,7 +60,6 @@ float autocvar_g_vehicle_racer_rocket_locked_time;
 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;
@@ -616,7 +615,8 @@ void racer_dinit()
              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;
index d9e8f2433d21e1ca3f62081b9d6232394e09921a..ac9428561ff1c436a3ad2fa8839cc8506d8309d4 100644 (file)
@@ -629,7 +629,8 @@ void raptor_dinit()
              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;
index f2fb4c06f92508559b765a8484c401ba1dfd9157..9d920201ca681427fa70fd0e4418d1235eda92cb 100644 (file)
@@ -39,19 +39,16 @@ float autocvar_g_vehicle_spiderbot_minigun_ammo_max;
 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();
@@ -233,10 +230,11 @@ float spiderbot_frame()
     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);
@@ -246,15 +244,15 @@ float spiderbot_frame()
     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);
 
@@ -349,8 +347,6 @@ float spiderbot_frame()
         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();
 
@@ -364,9 +360,9 @@ float spiderbot_frame()
     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;
@@ -594,7 +590,8 @@ void vewhicle_spiderbot_dinit()
              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;
index 0a7fa84589e95e562e7e152de5e0a8e253180cd6..e98e1276131a6d291b3bd620d4d5172d905ed131 100644 (file)
@@ -176,7 +176,7 @@ vector vehicles_force_fromtag_hover(string tag_name, float spring_length, float
     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)
 {
@@ -308,7 +308,8 @@ void vehicles_spawn()
     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;
@@ -427,7 +428,7 @@ void vehicles_enter()
     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;
 
@@ -477,8 +478,8 @@ void vehicles_exit(float eject)
         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
 
@@ -666,8 +667,8 @@ void vehicles_reset_colors()
     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);
@@ -688,10 +689,10 @@ void vehicles_reset_colors()
     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,
@@ -702,16 +703,17 @@ 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);
@@ -794,11 +796,13 @@ float vehicle_initialize(string  net_name,
         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;
 }
 
@@ -810,140 +814,4 @@ void bugmenot()
     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
index 59641407f060b428e4b16ae9933a6edb7e62174f..a664273674b19670292f6ed89c4b1756ec6b7a49 100644 (file)
@@ -1,9 +1,10 @@
 #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
index 8c68fa04a143c2d22806ba404cb7e80b7411e9dd..31e3aefa9ef6399a4c3331db1f52258ee23f2e41 100644 (file)
@@ -4,7 +4,7 @@
 #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
@@ -17,8 +17,6 @@ float VHF_MOVE_GROUND   = 128;  /// Vehicle moves on gound
 float VHF_MOVE_HOVER    = 256;  /// Vehicle hover close to gound 
 float VHF_MOVE_FLY      = 512;  /// Vehicle is airborn
 
-.float hud;
-
 .entity gun1;
 .entity gun2;
 
@@ -37,6 +35,7 @@ float VHF_MOVE_FLY      = 512;  /// Vehicle is airborn
 .entity vehicle_hudmodel;
 
 #ifdef SVQC
+.float hud;
 .float dmg_time;
 .float  vehicle_respawntime;
 .void() vehicle_spawn;
@@ -55,11 +54,23 @@ var .void() vehicle_die;    /// Vehicles custom function to be executed when veh
 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
index d2bf3541fd50d4fb9e27f2a91c1ec24a596f5f41..0d4feb3da01b8bed5a8fbba484f2783162805128 100644 (file)
@@ -26,6 +26,11 @@ set g_vehicle_bumblebee_cannon_refire            1.5
 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
 
index 787ea99c05c018de1e11e704a1bd87a793e890e5..a7f4d59bfded5582c65f9c2d7b74ab9542f25944 100644 (file)
@@ -25,13 +25,13 @@ set g_vehicle_spiderbot_speed_walk         400
 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