r4209 - in trunk/data: qcsrc/server scripts
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Tue Aug 26 13:31:30 EDT 2008
Author: div0
Date: 2008-08-26 13:31:30 -0400 (Tue, 26 Aug 2008)
New Revision: 4209
Modified:
trunk/data/qcsrc/server/g_triggers.qc
trunk/data/scripts/entities.def
Log:
new entity: misc_follow
Modified: trunk/data/qcsrc/server/g_triggers.qc
===================================================================
--- trunk/data/qcsrc/server/g_triggers.qc 2008-08-26 17:00:29 UTC (rev 4208)
+++ trunk/data/qcsrc/server/g_triggers.qc 2008-08-26 17:31:30 UTC (rev 4209)
@@ -1038,3 +1038,30 @@
self.think = monoflop_think;
self.state = 0;
}
+
+void follow_think()
+{
+ entity source, dest;
+ source = find(world, targetname, self.killtarget);
+ dest = find(world, targetname, self.target);
+
+ if(!source || !dest)
+ {
+ objerror("follow: could not find target/killtarget");
+ return;
+ }
+
+ dest.movetype = MOVETYPE_FOLLOW;
+ dest.aiment = source;
+ dest.punchangle = source.angles;
+ dest.view_ofs = dest.origin - source.origin;
+ dest.v_angle = dest.angles - source.angles;
+
+ remove(self);
+}
+
+void spawnfunc_misc_follow()
+{
+ self.think = follow_think;
+ self.nextthink = time;
+}
Modified: trunk/data/scripts/entities.def
===================================================================
--- trunk/data/scripts/entities.def 2008-08-26 17:00:29 UTC (rev 4208)
+++ trunk/data/scripts/entities.def 2008-08-26 17:31:30 UTC (rev 4209)
@@ -946,3 +946,10 @@
targetname: name that identifies this entity so it can be triggered
wait: time to wait until the "off" event is fired (when it is triggered again in the meantime, the "off" delay is extended and no new "on" event is fired)
*/
+
+/*QUAKED misc_follow (.5 .5 .5) (-8 -8 -8) (8 8 8)
+Makes one entity follow another. Will not work with all entities.
+-------- KEYS --------
+target: points to the entity to move (e.g. something that won't move by itself)
+killtarget: points to the entity that is to be used as the source (e.g. a func_plat)
+*/
More information about the nexuiz-commits
mailing list