[nexuiz-commits] r6983 - in trunk/data: . qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Jun 11 13:02:25 EDT 2009


Author: div0
Date: 2009-06-11 13:02:24 -0400 (Thu, 11 Jun 2009)
New Revision: 6983

Modified:
   trunk/data/qcsrc/server/bots_scripting.qc
   trunk/data/qcsrc/server/constants.qh
   trunk/data/qcsrc/server/g_triggers.qc
   trunk/data/qcsrc/server/t_items.qc
   trunk/data/qcsrc/server/w_seeker.qc
   trunk/data/weapons.cfg
   trunk/data/weaponsHavoc.cfg
Log:
- fix aimtotarget in bot scripting
- seeker lifetime is now a cvar
- complain if a trigger_items requests an invalid item
- bot scripting: support hook and chat buttons


Modified: trunk/data/qcsrc/server/bots_scripting.qc
===================================================================
--- trunk/data/qcsrc/server/bots_scripting.qc	2009-06-11 16:37:20 UTC (rev 6982)
+++ trunk/data/qcsrc/server/bots_scripting.qc	2009-06-11 17:02:24 UTC (rev 6983)
@@ -268,7 +268,7 @@
 		}
 		return;
 	}
-	print("ERROR: No such command\n");
+	print("ERROR: No such command '", cmdstring, "'\n");
 }
 
 void bot_cmdhelp(string scmd)
@@ -489,6 +489,8 @@
 
 	if(client_hasweapon(self, id, TRUE, FALSE))
 		self.switchweapon = id;
+	else
+		return CMD_STATUS_ERROR;
 
 	return CMD_STATUS_FINISHED;
 }
@@ -701,6 +703,7 @@
 	if(tokens==1)
 	{
 		self.v_angle = vectoangles(v - (self.origin + self.view_ofs));
+		self.v_angle_x = -self.v_angle_x;
 		return CMD_STATUS_FINISHED;
 	}
 
@@ -711,6 +714,7 @@
 
 	self.bot_cmd_aim_begin = self.v_angle;
 	self.bot_cmd_aim_end = vectoangles(v - (self.origin + self.view_ofs));
+	self.bot_cmd_aim_end_x = -self.bot_cmd_aim_end_x;
 
 	self.bot_cmd_aim_begintime = time;
 	self.bot_cmd_aim_endtime = time + step;
@@ -731,6 +735,7 @@
 #define BOT_CMD_KEY_USE		128
 #define BOT_CMD_KEY_HOOK	256
 #define BOT_CMD_KEY_CROUCH	512
+#define BOT_CMD_KEY_CHAT	1024
 
 float bot_presskeys()
 {
@@ -764,6 +769,12 @@
 	if(self.bot_cmd_keys & BOT_CMD_KEY_USE)
 		self.BUTTON_USE = TRUE;
 
+	if(self.bot_cmd_keys & BOT_CMD_KEY_HOOK)
+		self.BUTTON_HOOK = TRUE;
+
+	if(self.bot_cmd_keys & BOT_CMD_KEY_CHAT)
+		self.BUTTON_CHAT = TRUE;
+
 	return TRUE;
 }
 
@@ -843,6 +854,18 @@
 			else
 				self.bot_cmd_keys &~= BOT_CMD_KEY_USE;
 			break;
+		case "hook":
+			if(enabled)
+				self.bot_cmd_keys |= BOT_CMD_KEY_HOOK;
+			else
+				self.bot_cmd_keys &~= BOT_CMD_KEY_HOOK;
+			break;
+		case "chat":
+			if(enabled)
+				self.bot_cmd_keys |= BOT_CMD_KEY_CHAT;
+			else
+				self.bot_cmd_keys &~= BOT_CMD_KEY_CHAT;
+			break;
 		default:
 			break;
 	}

Modified: trunk/data/qcsrc/server/constants.qh
===================================================================
--- trunk/data/qcsrc/server/constants.qh	2009-06-11 16:37:20 UTC (rev 6982)
+++ trunk/data/qcsrc/server/constants.qh	2009-06-11 17:02:24 UTC (rev 6983)
@@ -1,5 +1,5 @@
 string CVAR_CHECK_DEFAULT = "265422ea51f974b6529d2414fb9e9d75";
-string CVAR_CHECK_WEAPONS = "e85f111d2e89ae3a36fb432de7d2266a";
+string CVAR_CHECK_WEAPONS = "b0200324f7019e035dc04342c43d9628";
 
 float	FALSE					= 0;
 float	TRUE					= 1;

Modified: trunk/data/qcsrc/server/g_triggers.qc
===================================================================
--- trunk/data/qcsrc/server/g_triggers.qc	2009-06-11 16:37:20 UTC (rev 6982)
+++ trunk/data/qcsrc/server/g_triggers.qc	2009-06-11 17:02:24 UTC (rev 6983)
@@ -162,8 +162,11 @@
 
 	if (self.wait > 0)
 	{
-		self.think = multi_wait;
-		self.nextthink = time + self.wait;
+		if(self.wait > 0.01)
+		{
+			self.think = multi_wait;
+			self.nextthink = time + self.wait;
+		}
 	}
 	else
 	{	// we can't just remove (self) here, because this is a touch function
@@ -265,8 +268,6 @@
 		self.noise = "misc/trigger1.wav";
 	}
 
-	if (!self.wait)
-		self.wait = 0.2;
 	self.use = multi_use;
 
 	EXACTTRIGGER_INIT;

Modified: trunk/data/qcsrc/server/t_items.qc
===================================================================
--- trunk/data/qcsrc/server/t_items.qc	2009-06-11 16:37:20 UTC (rev 6982)
+++ trunk/data/qcsrc/server/t_items.qc	2009-06-11 17:02:24 UTC (rev 6983)
@@ -1384,22 +1384,28 @@
 	n = tokenize_console(self.netname);
 	for(i = 0; i < n; ++i)
 	{
-		if(argv(i) == "unlimited_ammo")         self.items |= IT_UNLIMITED_AMMO;
-		if(argv(i) == "unlimited_weapon_ammo")  self.items |= IT_UNLIMITED_WEAPON_AMMO;
-		if(argv(i) == "unlimited_superweapons") self.items |= IT_UNLIMITED_SUPERWEAPONS;
-		if(argv(i) == "strength")               self.items |= IT_STRENGTH;
-		if(argv(i) == "invincible")             self.items |= IT_INVINCIBLE;
-		if(argv(i) == "jetpack")                self.items |= IT_JETPACK;
-		if(argv(i) == "fuel_regen")             self.items |= IT_FUEL_REGEN;
-		for(j = WEP_FIRST; j <= WEP_LAST; ++j)
+		if     (argv(i) == "unlimited_ammo")         self.items |= IT_UNLIMITED_AMMO;
+		else if(argv(i) == "unlimited_weapon_ammo")  self.items |= IT_UNLIMITED_WEAPON_AMMO;
+		else if(argv(i) == "unlimited_superweapons") self.items |= IT_UNLIMITED_SUPERWEAPONS;
+		else if(argv(i) == "strength")               self.items |= IT_STRENGTH;
+		else if(argv(i) == "invincible")             self.items |= IT_INVINCIBLE;
+		else if(argv(i) == "jetpack")                self.items |= IT_JETPACK;
+		else if(argv(i) == "fuel_regen")             self.items |= IT_FUEL_REGEN;
+		else
 		{
-			e = get_weaponinfo(j);
-			if(argv(i) == e.netname)
+			for(j = WEP_FIRST; j <= WEP_LAST; ++j)
 			{
-				self.weapons |= e.weapons;
-				if(self.spawnflags == 0 || self.spawnflags == 2)
-					weapon_action(e.weapon, WR_PRECACHE);
+				e = get_weaponinfo(j);
+				if(argv(i) == e.netname)
+				{
+					self.weapons |= e.weapons;
+					if(self.spawnflags == 0 || self.spawnflags == 2)
+						weapon_action(e.weapon, WR_PRECACHE);
+					break;
+				}
 			}
+			if(j > WEP_LAST)
+				print("target_items: invalid item ", argv(i), "\n");
 		}
 	}
 }

Modified: trunk/data/qcsrc/server/w_seeker.qc
===================================================================
--- trunk/data/qcsrc/server/w_seeker.qc	2009-06-11 16:37:20 UTC (rev 6982)
+++ trunk/data/qcsrc/server/w_seeker.qc	2009-06-11 17:02:24 UTC (rev 6983)
@@ -326,7 +326,7 @@
 	missile.bot_dodgerating = 50;
 	missile.touch           = Seeker_Tag_Touch;
 	missile.think           = Seeker_Tag_Think;
-	missile.nextthink       = time + 15;
+	missile.nextthink       = time + cvar("g_balance_seeker_tag_lifetime");
 	missile.movetype        = MOVETYPE_FLY;
 	missile.solid           = SOLID_BBOX;
 	missile.owner           = self;

Modified: trunk/data/weapons.cfg
===================================================================
--- trunk/data/weapons.cfg	2009-06-11 16:37:20 UTC (rev 6982)
+++ trunk/data/weapons.cfg	2009-06-11 17:02:24 UTC (rev 6983)
@@ -3,7 +3,7 @@
 //
 // And... don't forget to edit weaponsHavoc.cfg too.
 
-set cvar_check_weapons e85f111d2e89ae3a36fb432de7d2266a
+set cvar_check_weapons b0200324f7019e035dc04342c43d9628
 
 // NOTE: this only replaces weapons on the map
 // use g_start_weapon_* to also replace the on-startup weapons!
@@ -345,6 +345,7 @@
 set g_balance_seeker_tag_refire  0.7
 set g_balance_seeker_tag_health  5
 set g_balance_seeker_tag_damageforcescale  4
+set g_balance_seeker_tag_lifetime  15
 
 set g_balance_seeker_missile_delay 0.25
 //set g_balance_seeker_missile_activate_delay 0.1

Modified: trunk/data/weaponsHavoc.cfg
===================================================================
--- trunk/data/weaponsHavoc.cfg	2009-06-11 16:37:20 UTC (rev 6982)
+++ trunk/data/weaponsHavoc.cfg	2009-06-11 17:02:24 UTC (rev 6983)
@@ -1,4 +1,4 @@
-set cvar_check_weapons e85f111d2e89ae3a36fb432de7d2266a
+set cvar_check_weapons b0200324f7019e035dc04342c43d9628
 
 // NOTE: this only replaces weapons on the map
 // use g_start_weapon_* to also replace the on-startup weapons!
@@ -340,6 +340,7 @@
 set g_balance_seeker_tag_refire  0.7
 set g_balance_seeker_tag_health  5
 set g_balance_seeker_tag_damageforcescale  4
+set g_balance_seeker_tag_lifetime  15
 
 set g_balance_seeker_missile_delay 0.25
 //set g_balance_seeker_missile_activate_delay 0.1



More information about the nexuiz-commits mailing list