[nexuiz-commits] r6297 - in trunk/data: qcsrc/server scripts

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Mar 26 04:42:26 EDT 2009


Author: div0
Date: 2009-03-26 04:42:11 -0400 (Thu, 26 Mar 2009)
New Revision: 6297

Modified:
   trunk/data/qcsrc/server/t_jumppads.qc
   trunk/data/qcsrc/server/t_teleporters.qc
   trunk/data/scripts/entities.def
Log:
Add a team check to trigger_teleport and trigger_push, for team-owned teleporters and jumppads (e.g. for onslaught).
Team-owned jumppads can also be used as force fields that only one team can pass (use the INVERT_TEAM spawnflag for that).


Modified: trunk/data/qcsrc/server/t_jumppads.qc
===================================================================
--- trunk/data/qcsrc/server/t_jumppads.qc	2009-03-26 08:32:08 UTC (rev 6296)
+++ trunk/data/qcsrc/server/t_jumppads.qc	2009-03-26 08:42:11 UTC (rev 6297)
@@ -8,6 +8,12 @@
 
 float trigger_push_calculatevelocity_flighttime;
 
+void trigger_push_use()
+{
+	if(teams_matter)
+		self.team = activator.team;
+}
+
 /*
 	trigger_push_calculatevelocity
 
@@ -134,6 +140,10 @@
 	if (other.deadflag && other.iscreature)
 		return;
 
+	if(self.team)
+		if(!(self.spawnflags & 4) == !(self.team == other.team))
+			return;
+
 	EXACTTRIGGER_TOUCH;
 
 	if(self.target)
@@ -259,6 +269,7 @@
 
 	EXACTTRIGGER_INIT;
 
+	self.use = trigger_push_use;
 	self.touch = trigger_push_touch;
 
 	// normal push setup

Modified: trunk/data/qcsrc/server/t_teleporters.qc
===================================================================
--- trunk/data/qcsrc/server/t_teleporters.qc	2009-03-26 08:32:08 UTC (rev 6296)
+++ trunk/data/qcsrc/server/t_teleporters.qc	2009-03-26 08:42:11 UTC (rev 6297)
@@ -1,3 +1,9 @@
+void trigger_teleport_use()
+{
+	if(teams_matter)
+		self.team = activator.team;
+}
+
 void tdeath(entity player, entity teleporter, entity telefragger, vector telefragmin, vector telefragmax)
 {
 	entity head;
@@ -109,6 +115,10 @@
 	if (!other.flags & FL_CLIENT)	// FIXME: Make missiles firable through the teleport too
 		return;
 
+	if(self.team)
+		if(!(self.spawnflags & 4) == !(self.team == other.team))
+			return;
+
 	EXACTTRIGGER_TOUCH;
 
 	makevectors(self.enemy.mangle);
@@ -220,6 +230,8 @@
 
 	EXACTTRIGGER_INIT;
 
+	self.use = trigger_teleport_use;
+
 	// this must be called to spawn the teleport waypoints for bots
 	InitializeEntity(self, teleport_findtarget, INITPRIO_FINDTARGET);
 

Modified: trunk/data/scripts/entities.def
===================================================================
--- trunk/data/scripts/entities.def	2009-03-26 08:32:08 UTC (rev 6296)
+++ trunk/data/scripts/entities.def	2009-03-26 08:42:11 UTC (rev 6297)
@@ -908,7 +908,7 @@
 NOTOUCH: the trigger can only be triggered by other entities, not by touching or firing (you should probably use trigger_relay or trigger_delay instead)
 */
 
-/*QUAKED trigger_push (1 .5 0) ? 
+/*QUAKED trigger_push (1 .5 0) ? - - INVERT_TEAM
 Jump pad. What else?
 Can be used in three ways:
 Nexuiz "target/height" way: put the target_position where the player should land, and tune height to get a nice jump path. A good starting value for height is 100.
@@ -920,6 +920,10 @@
 movedir: when target is not set, direction vector to push to
 speed: speed of jump pad (default: 1000)
 noise: sound to play when jump pad is used; default is misc/jumppad.wav; you can set it to "" to make the pad silent
+team: team that owns this jump pad (5 = red, 14 = blue, etc) (when set, only this team can teleport)
+targetname: when targeted by a func_button, pressing the button will reassign the teleporter to the team of the activator.
+-------- SPAWNFLAGS --------
+INVERT_TEAM: the team that owns the teleporter will NOT jump when touching this
 */
 
 /*QUAKED trigger_relay (.5 .5 .5) (-8 -8 -8) (8 8 8) 
@@ -945,11 +949,15 @@
 swamp_slowdown: amount of slowdown caused by the swamp (default is 0.5)
 */
 
-/*QUAKED trigger_teleport (.5 .5 .5) ? 
+/*QUAKED trigger_teleport (.5 .5 .5) ? - - INVERT_TEAM
 Touching this will teleport players to the location of the targeted misc_teleporter_dest entity.
 Note that in Nexuiz, teleporters preserve momentum of the player using them.
 -------- KEYS --------
 target: this must point to a misc_teleporter_dest entity. If it points to more than one, a destination is randomly selected on teleport.
+team: team that owns this teleporter (5 = red, 14 = blue, etc) (when set, only this team can teleport)
+targetname: when targeted by a func_button, pressing the button will reassign the teleporter to the team of the activator.
+-------- SPAWNFLAGS --------
+INVERT_TEAM: the team that owns the teleporter will NOT teleport when touching this
 */
 
 /*QUAKED weapon_crylink (1 0 .5) (-30 -30 0) (30 30 32) FLOATING



More information about the nexuiz-commits mailing list