r4188 - in trunk/data: qcsrc/server scripts
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Tue Aug 26 07:01:06 EDT 2008
Author: div0
Date: 2008-08-26 07:01:01 -0400 (Tue, 26 Aug 2008)
New Revision: 4188
Modified:
trunk/data/qcsrc/server/g_triggers.qc
trunk/data/scripts/entities.def
Log:
func_pointparticles (untested)
Modified: trunk/data/qcsrc/server/g_triggers.qc
===================================================================
--- trunk/data/qcsrc/server/g_triggers.qc 2008-08-26 10:14:38 UTC (rev 4187)
+++ trunk/data/qcsrc/server/g_triggers.qc 2008-08-26 11:01:01 UTC (rev 4188)
@@ -485,7 +485,6 @@
self.effects = EF_STARDUST;
}
-
float pointparticles_SendEntity(entity to)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_POINTPARTICLES);
@@ -500,7 +499,10 @@
WriteCoord(MSG_ENTITY, self.maxs_y - self.mins_y);
WriteCoord(MSG_ENTITY, self.maxs_z - self.mins_z);
WriteShort(MSG_ENTITY, self.cnt);
- WriteCoord(MSG_ENTITY, self.impulse);
+ if(self.state)
+ WriteCoord(MSG_ENTITY, self.impulse);
+ else
+ WriteCoord(MSG_ENTITY, 0); // off
WriteShort(MSG_ENTITY, compressShortVector(self.velocity));
WriteShort(MSG_ENTITY, compressShortVector(self.movedir));
WriteCoord(MSG_ENTITY, self.waterlevel);
@@ -510,6 +512,39 @@
return 1;
}
+float pointparticles_use()
+{
+ self.state = !self.state;
+ self.Version += 1;
+}
+
+void spawnfunc_func_pointparticles()
+{
+ if(self.model != "")
+ setmodel(self, self.model);
+ if(self.noise != "")
+ precache_sound (self.noise);
+
+ self.effects = EF_NODEPTHTEST;
+ self.SendEntity = pointparticles_SendEntity;
+ self.Version = 1;
+ if(!self.modelindex)
+ self.modelindex = 4.2;
+ self.model = "net_entity";
+ if(!self.cnt)
+ self.cnt = particleeffectnum(self.mdl);
+ if(self.targetname != "")
+ {
+ self.use = pointparticles_use;
+ if(self.spawnflags & 1)
+ self.state = 1;
+ else
+ self.state = 0;
+ }
+ else
+ self.state = 1;
+}
+
void spawnfunc_func_sparks()
{
// self.cnt is the amount of sparks that one burst will spawn
@@ -523,23 +558,14 @@
self.wait = 0.25; // nice default value
}
- // sound
- if(self.noise)
- precache_sound (self.noise);
-
- self.effects = EF_NODEPTHTEST;
- self.SendEntity = pointparticles_SendEntity;
- self.Version = 1;
- if(!self.modelindex)
- self.modelindex = 4.2;
- self.model = "net_entity";
-
self.count = self.cnt;
self.mins = '0 0 0';
self.maxs = '0 0 0';
self.velocity = '0 0 -1';
- self.cnt = particleeffectnum("func_sparks");
+ self.mdl = "func_sparks";
self.impulse = 0.1 / self.wait;
+
+ spawnfunc_func_pointparticles();
}
void rain_think()
Modified: trunk/data/scripts/entities.def
===================================================================
--- trunk/data/scripts/entities.def 2008-08-26 10:14:38 UTC (rev 4187)
+++ trunk/data/scripts/entities.def 2008-08-26 11:01:01 UTC (rev 4188)
@@ -907,3 +907,17 @@
race_place: if target points to the trigger_race_checkpoint with cnt 0 (finish line), this sets which place the spawn corresponds to
*/
+/*QUAKED func_pointparticles (.5 .5 .5) ? START_ON
+A brush that emits particles.
+-------- KEYS --------
+mdl: particle effect name from effectinfo.txt
+impulse: when positive, number of particles to emit per second; when negative; number of particles to emit per second and 64^3 block
+velocity: particle direction and speed
+waterlevel: extra velocity jitter amount
+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
+-------- SPAWNFLAGS --------
+START_ON: when targeted, the particle emitter will start switched on
+*/
More information about the nexuiz-commits
mailing list