]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add the new effects and cvars for spawning
authorSamual Lenks <samual@xonotic.org>
Tue, 14 May 2013 02:05:49 +0000 (22:05 -0400)
committerSamual Lenks <samual@xonotic.org>
Tue, 14 May 2013 02:05:49 +0000 (22:05 -0400)
defaultXonotic.cfg
effectinfo.txt
qcsrc/client/Main.qc
qcsrc/client/autocvars.qh
qcsrc/common/teams.qh

index cd8b472a7e7dc64bb28761ef91fefe4d1845b684..9bbc16b81f1c8a2c7db234db6af808904d4458f9 100644 (file)
@@ -74,6 +74,11 @@ seta cl_unpress_zoom_on_death 1 "automatically unpress zoom when you die (and do
 seta cl_unpress_zoom_on_weapon_switch 1 "automatically unpress zoom when you switch a weapon"
 seta cl_unpress_attack_on_weapon_switch 1 "automatically unpress fire and fire1 attack buttons when you switch a weapon"
 
+seta cl_spawn_event_particles 1 "pointparticles effect whenever a player spawns"
+seta cl_spawn_event_sound 1 "sound effect whenever a player spawns"
+//seta cl_spawn_point_model 0 "place a model at all spawn points" // still needs a model
+seta cl_spawn_point_particles 1 "pointparticles effect at all spawn points"
+
 freelook 1
 sensitivity 6
 v_gamma 1
index d346a30efbe930804ce535b3fe9b24b31e686fb0..c2f702fa5ab243ac7d032a8583bb07e0c8d82570 100644 (file)
@@ -7778,3 +7778,202 @@ alpha 190 190 180
 sizeincrease -80
 color 0x0000FF 0x000097
 
+// spawn_point_red -- red team idle spawn point effect
+effect spawn_point_red
+count 37.5
+type static
+color 0xFF0F0F 0xFF0F0F
+size 1.0 2.0
+alpha 64 128 128
+gravity -0.1
+airfriction 0.2
+liquidfriction 0.8
+originjitter 16 16 64
+velocityjitter 32 32 0
+//lightradius 200
+//lighttime 0
+//lightcolor 0.4 0.9 0.9
+
+// spawn_point_blue -- blue team idle spawn point effect
+effect spawn_point_blue
+count 37.5
+type static
+color 0x0F0FFF 0x0F0FFF
+size 1.0 2.0
+alpha 64 128 128
+gravity -0.1
+airfriction 0.2
+liquidfriction 0.8
+originjitter 16 16 64
+velocityjitter 32 32 0
+//lightradius 200
+//lighttime 0
+//lightcolor 0.4 0.9 0.9
+
+// spawn_point_yellow -- yellow team idle spawn point effect
+effect spawn_point_yellow
+count 37.5
+type static
+color 0xFFFF0F 0xFFFF0F
+size 1.0 2.0
+alpha 64 128 128
+gravity -0.1
+airfriction 0.2
+liquidfriction 0.8
+originjitter 16 16 64
+velocityjitter 32 32 0
+//lightradius 200
+//lighttime 0
+//lightcolor 0.4 0.9 0.9
+
+// spawn_point_pink -- pink team idle spawn point effect
+effect spawn_point_pink
+count 37.5
+type static
+color 0xFF0FFF 0xFF0FFF
+size 1.0 2.0
+alpha 64 128 128
+gravity -0.1
+airfriction 0.2
+liquidfriction 0.8
+originjitter 16 16 64
+velocityjitter 32 32 0
+//lightradius 200
+//lighttime 0
+//lightcolor 0.4 0.9 0.9
+
+// spawn_point_neutral -- neutral idle spawn point effect
+effect spawn_point_neutral
+count 37.5
+type static
+color 0xFFFFFF 0xFFFFFF
+size 1.0 2.0
+alpha 64 128 128
+gravity -0.1
+airfriction 0.2
+liquidfriction 0.8
+originjitter 16 16 64
+velocityjitter 32 32 0
+//lightradius 200
+//lighttime 0
+//lightcolor 0.4 0.9 0.9
+
+// spawn_event_red -- red team spawning effect
+effect spawn_event_red
+count 100
+type spark
+tex 64 64
+color 0xFF0F0F 0xFF0F0F
+size 1 1
+alpha 0 256 256
+stretchfactor 0.6
+//gravity 1
+bounce 1
+originjitter 1 1 1
+velocityjitter 500 500 500
+velocitymultiplier 0.1
+airfriction 2
+effect spawn_event_red
+countabsolute 1
+type smoke
+tex 65 65
+size 100 100
+alpha 190 190 180
+sizeincrease -80
+color 0xFF0F0F 0xFF0F0F
+
+// spawn_event_blue -- blue team spawning effect
+effect spawn_event_blue
+count 100
+type spark
+tex 64 64
+color 0x0F0FFF 0x0F0FFF
+size 1 1
+alpha 0 256 256
+stretchfactor 0.6
+//gravity 1
+bounce 1
+originjitter 1 1 1
+velocityjitter 500 500 500
+velocitymultiplier 0.1
+airfriction 2
+effect spawn_event_blue
+countabsolute 1
+type smoke
+tex 65 65
+size 100 100
+alpha 190 190 180
+sizeincrease -80
+color 0x0F0FFF 0x0F0FFF
+
+// spawn_event_yellow -- yellow team spawning effect
+effect spawn_event_yellow
+count 100
+type spark
+tex 64 64
+color 0xFFFF0F 0xFFFF0F
+size 1 1
+alpha 0 256 256
+stretchfactor 0.6
+//gravity 1
+bounce 1
+originjitter 1 1 1
+velocityjitter 500 500 500
+velocitymultiplier 0.1
+airfriction 2
+effect spawn_event_yellow
+countabsolute 1
+type smoke
+tex 65 65
+size 100 100
+alpha 190 190 180
+sizeincrease -80
+color 0xFFFF0F 0xFFFF0F
+
+// spawn_event_pink -- pink team spawning effect
+effect spawn_event_pink
+count 100
+type spark
+tex 64 64
+color 0xFF0FFF 0xFF0FFF
+size 1 1
+alpha 0 256 256
+stretchfactor 0.6
+//gravity 1
+bounce 1
+originjitter 1 1 1
+velocityjitter 500 500 500
+velocitymultiplier 0.1
+airfriction 2
+effect spawn_event_pink
+countabsolute 1
+type smoke
+tex 65 65
+size 100 100
+alpha 190 190 180
+sizeincrease -80
+color 0xFF0FFF 0xFF0FFF
+
+// spawn_event_neutral -- neutral spawning effect
+effect spawn_event_neutral
+count 100
+type spark
+tex 64 64
+color 0xFFFFFF 0xFFFFFF
+size 1 1
+alpha 0 256 256
+stretchfactor 0.6
+//gravity 1
+bounce 1
+originjitter 1 1 1
+velocityjitter 500 500 500
+velocitymultiplier 0.1
+airfriction 2
+effect spawn_event_neutral
+countabsolute 1
+type smoke
+tex 65 65
+size 100 100
+alpha 190 190 180
+sizeincrease -80
+color 0xFFFFFF 0xFFFFFF
index e480d0ef132cda38ee8ec42c2499fae3369cc94b..c4dec4c559cba21188cffb0cfc56bd844141f404 100644 (file)
@@ -698,39 +698,46 @@ void Ent_ReadAccuracy(void)
 
 void Spawn_Draw(void)
 {
-       pointparticles(self.cnt, self.origin, '0 0 2', bound(0, frametime, 0.1));
+       pointparticles(self.cnt, self.origin + '0 0 28', '0 0 2', bound(0, frametime, 0.1));
 }
 
 void Ent_ReadSpawnPoint(float is_new) // entity for spawnpoint
 {
-       float teamnum = ReadByte();
+       float teamnum = (ReadByte() - 1);
        self.origin_x = ReadShort();
        self.origin_y = ReadShort();
        self.origin_z = ReadShort();
 
+       setsize(self, PL_MIN, PL_MAX);
+       droptofloor();
+       
        if(is_new)
        {
-               switch(teamnum)
+               if(autocvar_cl_spawn_point_particles)
                {
-                       default: self.cnt = particleeffectnum("EF_STARDUST"); break;
+                       switch(teamnum)
+                       {
+                               case NUM_TEAM_1: self.cnt = particleeffectnum("spawn_point_red"); break;
+                               case NUM_TEAM_2: self.cnt = particleeffectnum("spawn_point_blue"); break;
+                               case NUM_TEAM_3: self.cnt = particleeffectnum("spawn_point_yellow"); break;
+                               case NUM_TEAM_4: self.cnt = particleeffectnum("spawn_point_pink"); break;
+                               default: self.cnt = particleeffectnum("spawn_point_neutral"); break;
+                       }
+                       self.draw = Spawn_Draw;
                }
-               
-               //self.colormod = '200 0 0'; //colormapPaletteColor(teamnum - 1, FALSE);
-
-               //setsize(self, PL_MIN, PL_MAX);
-
-               //droptofloor();
-
-               //self.mdl = "models/domination/dom_unclaimed.md3";
-               //precache_model(self.mdl);
-               //setmodel(self, self.mdl);
-               self.drawmask = MASK_NORMAL;
-               self.movetype = MOVETYPE_NOCLIP;
-               self.draw = Spawn_Draw;
-               
+               /*if(autocvar_cl_spawn_point_model) // needs a model first
+               {
+                       self.mdl = "models/spawnpoint.md3";
+                       self.colormod = Team_ColorRGB(teamnum);
+                       precache_model(self.mdl);
+                       setmodel(self, self.mdl);
+                       self.drawmask = MASK_NORMAL;
+                       //self.movetype = MOVETYPE_NOCLIP;
+                       //self.draw = Spawn_Draw;
+               }*/
        }
 
-       print(sprintf("Ent_ReadSpawnPoint(is_new = %d); origin = %s, team = %d (%s)\n", is_new, vtos(self.origin), teamnum, "foobar"));
+       print(sprintf("Ent_ReadSpawnPoint(is_new = %d); origin = %s, team = %d, effect = %d\n", is_new, vtos(self.origin), teamnum, self.cnt));
 }
 
 void Ent_ReadSpawnEvent(float is_new)
@@ -749,15 +756,20 @@ void Ent_ReadSpawnEvent(float is_new)
                if(is_new)
                {
                        float teamnum = GetPlayerColor(entnum - 1);
-                       //if(autocvar_cl_spawn_event_sound)
+
+                       if(autocvar_cl_spawn_event_sound)
                        {
                                sound(self, CH_TRIGGER, "misc/spawn.wav", VOL_BASE, ATTN_NORM);
                        }
-                       //if(autocvar_cl_spawn_event_particles)
+                       if(autocvar_cl_spawn_event_particles)
                        {
                                switch(teamnum)
                                {
-                                       default: pointparticles(particleeffectnum("red_cap"), self.origin, '0 0 0', 1); break;
+                                       case NUM_TEAM_1: pointparticles(particleeffectnum("spawn_event_red"), self.origin, '0 0 0', 1); break;
+                                       case NUM_TEAM_2: pointparticles(particleeffectnum("spawn_event_blue"), self.origin, '0 0 0', 1); break;
+                                       case NUM_TEAM_3: pointparticles(particleeffectnum("spawn_event_yellow"), self.origin, '0 0 0', 1); break;
+                                       case NUM_TEAM_4: pointparticles(particleeffectnum("spawn_event_pink"), self.origin, '0 0 0', 1); break;
+                                       default: pointparticles(particleeffectnum("spawn_event_neutral"), self.origin, '0 0 0', 1); break;
                                }
                        }
                }
@@ -776,7 +788,7 @@ void Ent_ReadSpawnEvent(float is_new)
                }
        }
        
-       print(sprintf("Ent_ReadSpawnEvent(is_new = %d); origin = %s, entnum = %d (%s), localentnum = %d\n", is_new, vtos(self.origin), entnum, player_localentnum, "foobar"));
+       print(sprintf("Ent_ReadSpawnEvent(is_new = %d); origin = %s, entnum = %d, localentnum = %d\n", is_new, vtos(self.origin), entnum, player_localentnum));
 }
 
 // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
index f8343221ded4d13dd72358c6670ccc4c162de5d6..16714460b581112b40e7458066b1a22c169b176b 100644 (file)
@@ -63,6 +63,10 @@ var float autocvar_cl_reticle = 1;
 float autocvar_cl_reticle_item_nex;
 float autocvar_cl_reticle_item_normal;
 float autocvar_cl_reticle_stretch;
+float autocvar_cl_spawn_event_particles;
+var float autocvar_cl_spawn_event_sound = 1;
+// float autocvar_cl_spawn_point_model;
+float autocvar_cl_spawn_point_particles;
 var float autocvar_cl_spawnzoom = 1;
 var float autocvar_cl_spawnzoom_speed = 1;
 var float autocvar_cl_spawnzoom_factor = 2;
index db3a39bcd5a0b4b43215eeb8fe859fa18a49979a..cde71c7b3cfdcf8a428d1221170d66d99dda5d77 100644 (file)
@@ -63,10 +63,10 @@ vector Team_ColorRGB(float teamid)
 {
        switch(teamid)
        {
-               case NUM_TEAM_1: return '1 0.0625 0.0625';
-               case NUM_TEAM_2: return '0.0625 0.0625 1';
-               case NUM_TEAM_3: return '1 1 0.0625';
-               case NUM_TEAM_4: return '1 0.0625 1';
+               case NUM_TEAM_1: return '1 0.0625 0.0625'; // 0xFF0F0F
+               case NUM_TEAM_2: return '0.0625 0.0625 1'; // 0x0F0FFF
+               case NUM_TEAM_3: return '1 1 0.0625'; // 0xFFFF0F
+               case NUM_TEAM_4: return '1 0.0625 1'; // 0xFF0FFF
        }
 
     return '0 0 0';