[nexuiz-commits] r7973 - in branches/nexuiz-2.0: . data data/qcsrc/server data/scripts misc/netradiant-NexuizPack/nexuiz.game/data

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Sep 28 06:58:18 EDT 2009


Author: div0
Date: 2009-09-28 06:58:18 -0400 (Mon, 28 Sep 2009)
New Revision: 7973

Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/balance.cfg
   branches/nexuiz-2.0/data/balance25.cfg
   branches/nexuiz-2.0/data/balanceHavoc.cfg
   branches/nexuiz-2.0/data/balanceSamual.cfg
   branches/nexuiz-2.0/data/effectinfo.txt
   branches/nexuiz-2.0/data/qcsrc/server/constants.qh
   branches/nexuiz-2.0/data/qcsrc/server/sv_main.qc
   branches/nexuiz-2.0/data/qcsrc/server/w_hagar.qc
   branches/nexuiz-2.0/data/scripts/entities.def
   branches/nexuiz-2.0/misc/netradiant-NexuizPack/nexuiz.game/data/entities.def
Log:
r7968 | div0 | 2009-09-28 12:35:37 +0200 (Mon, 28 Sep 2009) | 2 lines
make hagar less of a fps drain
r7970 | div0 | 2009-09-28 12:52:49 +0200 (Mon, 28 Sep 2009) | 3 lines
hagar: support randomized lifetime on secondary (unused)
feature: cvar filters on map entities
r7971 | div0 | 2009-09-28 12:52:56 +0200 (Mon, 28 Sep 2009) | 2 lines
entities.def
r7972 | div0 | 2009-09-28 12:56:14 +0200 (Mon, 28 Sep 2009) | 2 lines
add missing commands to cvarfilter


Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2009-09-28 10:56:14 UTC (rev 7972)
+++ branches/nexuiz-2.0/.patchsets	2009-09-28 10:58:18 UTC (rev 7973)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-7945,7948-7948,7951-7967
+revisions_applied = 1-7945,7948-7948,7951-7972

Modified: branches/nexuiz-2.0/data/balance.cfg
===================================================================
--- branches/nexuiz-2.0/data/balance.cfg	2009-09-28 10:56:14 UTC (rev 7972)
+++ branches/nexuiz-2.0/data/balance.cfg	2009-09-28 10:58:18 UTC (rev 7973)
@@ -3,7 +3,7 @@
 //
 // And... don't forget to edit the other balance*.cfg too.
 
-set cvar_check_balance 3ec2d034ac400bba7e93eef2c720669a
+set cvar_check_balance 9b590c8f7c3065d917ac8e2e5e842a88
 
 // {{{ weapon replacement
 // NOTE: this only replaces weapons on the map
@@ -392,7 +392,8 @@
 set g_balance_hagar_secondary_radius 90
 set g_balance_hagar_secondary_spread 0.1
 set g_balance_hagar_secondary_speed 2000
-set g_balance_hagar_secondary_lifetime 30
+set g_balance_hagar_secondary_lifetime_min 30
+set g_balance_hagar_secondary_lifetime_rand 0
 set g_balance_hagar_secondary_refire 0.15
 set g_balance_hagar_secondary_ammo 1
 //   }}}

Modified: branches/nexuiz-2.0/data/balance25.cfg
===================================================================
--- branches/nexuiz-2.0/data/balance25.cfg	2009-09-28 10:56:14 UTC (rev 7972)
+++ branches/nexuiz-2.0/data/balance25.cfg	2009-09-28 10:58:18 UTC (rev 7973)
@@ -3,7 +3,7 @@
 //
 // And... don't forget to edit the other balance*.cfg too.
 
-set cvar_check_balance 3ec2d034ac400bba7e93eef2c720669a
+set cvar_check_balance 9b590c8f7c3065d917ac8e2e5e842a88
 
 // {{{ weapon replacement
 // NOTE: this only replaces weapons on the map
@@ -392,7 +392,8 @@
 set g_balance_hagar_secondary_radius 65
 set g_balance_hagar_secondary_spread 0.015
 set g_balance_hagar_secondary_speed 1400
-set g_balance_hagar_secondary_lifetime 30
+set g_balance_hagar_secondary_lifetime_min 30
+set g_balance_hagar_secondary_lifetime_rand 0
 set g_balance_hagar_secondary_refire 0.15
 set g_balance_hagar_secondary_ammo 1
 //   }}}

Modified: branches/nexuiz-2.0/data/balanceHavoc.cfg
===================================================================
--- branches/nexuiz-2.0/data/balanceHavoc.cfg	2009-09-28 10:56:14 UTC (rev 7972)
+++ branches/nexuiz-2.0/data/balanceHavoc.cfg	2009-09-28 10:58:18 UTC (rev 7973)
@@ -3,7 +3,7 @@
 //
 // And... don't forget to edit the other balance*.cfg too.
 
-set cvar_check_balance 3ec2d034ac400bba7e93eef2c720669a
+set cvar_check_balance 9b590c8f7c3065d917ac8e2e5e842a88
 
 // {{{ weapon replacement
 // NOTE: this only replaces weapons on the map
@@ -392,7 +392,8 @@
 set g_balance_hagar_secondary_radius 90
 set g_balance_hagar_secondary_spread 0.1
 set g_balance_hagar_secondary_speed 2000
-set g_balance_hagar_secondary_lifetime 30
+set g_balance_hagar_secondary_lifetime_min 30
+set g_balance_hagar_secondary_lifetime_rand 0
 set g_balance_hagar_secondary_refire 0.1
 set g_balance_hagar_secondary_ammo 1
 //   }}}

Modified: branches/nexuiz-2.0/data/balanceSamual.cfg
===================================================================
--- branches/nexuiz-2.0/data/balanceSamual.cfg	2009-09-28 10:56:14 UTC (rev 7972)
+++ branches/nexuiz-2.0/data/balanceSamual.cfg	2009-09-28 10:58:18 UTC (rev 7973)
@@ -3,7 +3,7 @@
 //
 // And... don't forget to edit the other balance*.cfg too.
 
-set cvar_check_balance 3ec2d034ac400bba7e93eef2c720669a
+set cvar_check_balance 9b590c8f7c3065d917ac8e2e5e842a88
 
 // {{{ weapon replacement
 // NOTE: this only replaces weapons on the map
@@ -392,7 +392,8 @@
 set g_balance_hagar_secondary_radius 70
 set g_balance_hagar_secondary_spread 0.05
 set g_balance_hagar_secondary_speed 2000
-set g_balance_hagar_secondary_lifetime 30
+set g_balance_hagar_secondary_lifetime_min 30
+set g_balance_hagar_secondary_lifetime_rand 0
 set g_balance_hagar_secondary_refire 0.15
 set g_balance_hagar_secondary_ammo 1
 //   }}}

Modified: branches/nexuiz-2.0/data/effectinfo.txt
===================================================================
--- branches/nexuiz-2.0/data/effectinfo.txt	2009-09-28 10:56:14 UTC (rev 7972)
+++ branches/nexuiz-2.0/data/effectinfo.txt	2009-09-28 10:58:18 UTC (rev 7973)
@@ -1802,7 +1802,7 @@
 size 28 38
 alpha 256 256 0
 originjitter 40 40 40
-lightradius 250
+lightradius 120
 lightradiusfade 400
 lightcolor 8 4 1
 // fire effect which make bright dot inside

Modified: branches/nexuiz-2.0/data/qcsrc/server/constants.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2009-09-28 10:56:14 UTC (rev 7972)
+++ branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2009-09-28 10:58:18 UTC (rev 7973)
@@ -1,5 +1,5 @@
 string CVAR_CHECK_DEFAULT = "4bb48bd2d43bd891aa49d542abb24bf8";
-string CVAR_CHECK_BALANCE = "3ec2d034ac400bba7e93eef2c720669a";
+string CVAR_CHECK_BALANCE = "9b590c8f7c3065d917ac8e2e5e842a88";
 
 float	FALSE					= 0;
 float	TRUE					= 1;

Modified: branches/nexuiz-2.0/data/qcsrc/server/sv_main.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/sv_main.qc	2009-09-28 10:56:14 UTC (rev 7972)
+++ branches/nexuiz-2.0/data/qcsrc/server/sv_main.qc	2009-09-28 10:58:18 UTC (rev 7973)
@@ -241,6 +241,7 @@
 .vector anglesjitter;
 .float anglejitter;
 .string gametypefilter;
+.string cvarfilter;
 void SV_OnEntityPreSpawnFunction()
 {
 	if(self.gametypefilter != "")
@@ -249,7 +250,116 @@
 		remove(self);
 		return;
 	}
+	if(self.cvarfilter != "")
+	{
+		float n, i, o, inv;
+		string s, k, v;
+		inv = 0;
 
+		s = self.cvarfilter;
+		if(substring(s, 0, 1) == "+")
+		{
+			s = substring(s, 1, -1);
+		}
+		else if(substring(s, 0, 1) == "-")
+		{
+			inv = 1;
+			s = substring(s, 1, -1);
+		}
+
+		n = tokenize(s);
+		for(i = 0; i < n; ++i)
+		{
+			s = argv(i);
+			// syntax:
+			// var>x
+			// var<x
+			// var>=x
+			// var<=x
+			// var==x
+			// var!=x
+			// var===x
+			// var!==x
+			if((o = strstrofs(s, ">=", 0)) >= 0)
+			{
+				k = substring(s, 0, o);
+				v = substring(s, o+2, -1);
+				if(cvar(k) < stof(v))
+					goto cvar_fail;
+			}
+			else if((o = strstrofs(s, "<=", 0)) >= 0)
+			{
+				k = substring(s, 0, o);
+				v = substring(s, o+2, -1);
+				if(cvar(k) > stof(v))
+					goto cvar_fail;
+			}
+			else if((o = strstrofs(s, ">", 0)) >= 0)
+			{
+				k = substring(s, 0, o);
+				v = substring(s, o+1, -1);
+				if(cvar(k) <= stof(v))
+					goto cvar_fail;
+			}
+			else if((o = strstrofs(s, "<", 0)) >= 0)
+			{
+				k = substring(s, 0, o);
+				v = substring(s, o+1, -1);
+				if(cvar(k) >= stof(v))
+					goto cvar_fail;
+			}
+			else if((o = strstrofs(s, "==", 0)) >= 0)
+			{
+				k = substring(s, 0, o);
+				v = substring(s, o+2, -1);
+				if(cvar(k) != stof(v))
+					goto cvar_fail;
+			}
+			else if((o = strstrofs(s, "!=", 0)) >= 0)
+			{
+				k = substring(s, 0, o);
+				v = substring(s, o+2, -1);
+				if(cvar(k) == stof(v))
+					goto cvar_fail;
+			}
+			else if((o = strstrofs(s, "===", 0)) >= 0)
+			{
+				k = substring(s, 0, o);
+				v = substring(s, o+2, -1);
+				if(cvar_string(k) != v)
+					goto cvar_fail;
+			}
+			else if((o = strstrofs(s, "!==", 0)) >= 0)
+			{
+				k = substring(s, 0, o);
+				v = substring(s, o+2, -1);
+				if(cvar_string(k) == v)
+					goto cvar_fail;
+			}
+			else if(substring(s, 0, 1) == "!")
+			{
+				k = substring(s, 1, -1);
+				if(cvar(k))
+					goto cvar_fail;
+			}
+			else
+			{
+				k = s;
+				if not(cvar(k))
+					goto cvar_fail;
+			}
+		}
+		inv = !inv;
+:cvar_fail
+		// now inv is 1 if we want to keep the item, and 0 if we want to get rid of it
+		if not(inv)
+		{
+			//print("cvarfilter fail\n");
+			remove(self);
+			return;
+		}
+	}
+
 	// support special -1 and -2 angle from radiant
 	if (self.angles == '0 -1 0')
 		self.angles = '-90 0 0';

Modified: branches/nexuiz-2.0/data/qcsrc/server/w_hagar.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/w_hagar.qc	2009-09-28 10:56:14 UTC (rev 7972)
+++ branches/nexuiz-2.0/data/qcsrc/server/w_hagar.qc	2009-09-28 10:58:18 UTC (rev 7973)
@@ -90,7 +90,7 @@
 	missile.cnt = 0;
 	missile.use = W_Hagar_Explode;
 	missile.think = adaptor_think2use;
-	missile.nextthink = time + cvar("g_balance_hagar_secondary_lifetime");
+	missile.nextthink = time + cvar("g_balance_hagar_secondary_lifetime_min") + random() * cvar("g_balance_hagar_secondary_lifetime_rand");
 	PROJECTILE_MAKETRIGGER(missile);
 	missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY;
 	setorigin (missile, w_shotorg);

Modified: branches/nexuiz-2.0/data/scripts/entities.def
===================================================================
--- branches/nexuiz-2.0/data/scripts/entities.def	2009-09-28 10:56:14 UTC (rev 7972)
+++ branches/nexuiz-2.0/data/scripts/entities.def	2009-09-28 10:58:18 UTC (rev 7973)
@@ -684,6 +684,7 @@
 anglesjitter: a vector in the order "pitch yaw roll" describing a random angles change on this entity on initial spawn. The value 180 180 180 makes the angles entirely random and uniformly distributed (among euler angles). This corresponds to the "angles" field. Works on any non-q3map2-only entity.
 anglejitter: a float describing a random yaw angle change on this entity on initial spawn. The value 180 makes the yaw angle entirely random (maybe good for items). This corresponds to the "angle" field. Works on any non-q3map2-only entity.
 gametypefilter: either a + sign and a comma separated list of game types or the aliases "teams" and "noteams" to ONLY show the entity in the listed game types, or a - sign and a comma separated list of game types or the aliases "teams" and "noteams" to NOT show the entity in the listed game types. The syntax is the same as in sbar_columns_set strings. Works on any non-q3map2-only entity.
+cvarfilter: either a + sign and a space separated list of conditions, or a - sign and the same for an inverted filter. The conditions are ALWAYS combined with AND! Possible conditions are: "cvar==value", "cvar!=value", "cvar<value", "cvar>value", "cvar<=value", "cvar>=value", "cvar===string", "cvar!==string", "cvar", "!cvar". Ridiculous example filter: "-g_balance_health_start<150 g_balance_armor_start==0" spawns an item only if start health is at least 150 or start armor is not 0. Other ideas: "+g_campaign" and "-g_campaign" for enabling/disabling items when the map is played as part of the campaign.
 -------- SPAWNFLAGS --------
 ALIGN_ORIGN: align the origin to the surface below the model
 ALIGN_BOTTOM: align the bottom of the model to the surface below it

Modified: branches/nexuiz-2.0/misc/netradiant-NexuizPack/nexuiz.game/data/entities.def
===================================================================
--- branches/nexuiz-2.0/misc/netradiant-NexuizPack/nexuiz.game/data/entities.def	2009-09-28 10:56:14 UTC (rev 7972)
+++ branches/nexuiz-2.0/misc/netradiant-NexuizPack/nexuiz.game/data/entities.def	2009-09-28 10:58:18 UTC (rev 7973)
@@ -684,6 +684,7 @@
 anglesjitter: a vector in the order "pitch yaw roll" describing a random angles change on this entity on initial spawn. The value 180 180 180 makes the angles entirely random and uniformly distributed (among euler angles). This corresponds to the "angles" field. Works on any non-q3map2-only entity.
 anglejitter: a float describing a random yaw angle change on this entity on initial spawn. The value 180 makes the yaw angle entirely random (maybe good for items). This corresponds to the "angle" field. Works on any non-q3map2-only entity.
 gametypefilter: either a + sign and a comma separated list of game types or the aliases "teams" and "noteams" to ONLY show the entity in the listed game types, or a - sign and a comma separated list of game types or the aliases "teams" and "noteams" to NOT show the entity in the listed game types. The syntax is the same as in sbar_columns_set strings. Works on any non-q3map2-only entity.
+cvarfilter: either a + sign and a space separated list of conditions, or a - sign and the same for an inverted filter. The conditions are ALWAYS combined with AND! Possible conditions are: "cvar==value", "cvar!=value", "cvar<value", "cvar>value", "cvar<=value", "cvar>=value", "cvar===string", "cvar!==string", "cvar", "!cvar". Ridiculous example filter: "-g_balance_health_start<150 g_balance_armor_start==0" spawns an item only if start health is at least 150 or start armor is not 0. Other ideas: "+g_campaign" and "-g_campaign" for enabling/disabling items when the map is played as part of the campaign.
 -------- SPAWNFLAGS --------
 ALIGN_ORIGN: align the origin to the surface below the model
 ALIGN_BOTTOM: align the bottom of the model to the surface below it



More information about the nexuiz-commits mailing list