From dfba61b53be0816cedb1e23cee0ac31e31e877e1 Mon Sep 17 00:00:00 2001 From: div0 Date: Tue, 26 Aug 2008 11:05:47 +0000 Subject: [PATCH] "wait" property git-svn-id: svn://svn.icculus.org/nexuiz/trunk@4189 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/g_triggers.qc | 16 ++++++++++++++++ data/scripts/entities.def | 2 ++ 2 files changed, 18 insertions(+) diff --git a/data/qcsrc/server/g_triggers.qc b/data/qcsrc/server/g_triggers.qc index 60f78157c..f3158d6a8 100644 --- a/data/qcsrc/server/g_triggers.qc +++ b/data/qcsrc/server/g_triggers.qc @@ -513,6 +513,20 @@ float pointparticles_SendEntity(entity to) } float pointparticles_use() +{ + if(self.wait && time < self.nextthink) + { + self.nextthink = time + self.wait; // extend the time + return; + } + + if(self.wait) + self.nextthink = time + self.wait; // toggle back after a delay + self.state = !self.state; + self.Version += 1; +} + +float pointparticles_think() { self.state = !self.state; self.Version += 1; @@ -540,6 +554,7 @@ void spawnfunc_func_pointparticles() self.state = 1; else self.state = 0; + self.think = pointparticles_think; } else self.state = 1; @@ -564,6 +579,7 @@ void spawnfunc_func_sparks() self.velocity = '0 0 -1'; self.mdl = "func_sparks"; self.impulse = 0.1 / self.wait; + self.wait = 0; spawnfunc_func_pointparticles(); } diff --git a/data/scripts/entities.def b/data/scripts/entities.def index 96e40ad97..7d3058439 100644 --- a/data/scripts/entities.def +++ b/data/scripts/entities.def @@ -918,6 +918,8 @@ count: particle count multiplier (per spawned particle) movedir: when set, trace direction (particles will then be emitted from the surface the trace hits); the length of the vector is used as strength of taking the normal of the trace into account glow_color: particle palette color noise: sound to play when the particle is emitted +targetname: name to target this +wait: when set and targeted, it will enable when triggered, and disable after a delay; otherwise, it will disable when triggered again -------- SPAWNFLAGS -------- START_ON: when targeted, the particle emitter will start switched on */ -- 2.39.2