[nexuiz-commits] r6496 - in trunk: data/qcsrc/client data/scripts misc/netradiant-NexuizPack/nexuiz.game/data

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Apr 16 01:41:22 EDT 2009


Author: div0
Date: 2009-04-16 01:41:22 -0400 (Thu, 16 Apr 2009)
New Revision: 6496

Modified:
   trunk/data/qcsrc/client/particles.qc
   trunk/data/scripts/entities.def
   trunk/misc/netradiant-NexuizPack/nexuiz.game/data/entities.def
Log:
tiny particle emitter script change: bgmscript now supports not just states 0 or 1, but velocity from 0 to 1, to give different strength of effects...


Modified: trunk/data/qcsrc/client/particles.qc
===================================================================
--- trunk/data/qcsrc/client/particles.qc	2009-04-15 23:21:50 UTC (rev 6495)
+++ trunk/data/qcsrc/client/particles.qc	2009-04-16 05:41:22 UTC (rev 6496)
@@ -77,6 +77,7 @@
 .float scriptline;
 .float scriptline0;
 .float scriptstate;
+.float scriptvelocity;
 .float scripttime;
 void PointparticlesScript_InitEntity(entity e)
 {
@@ -133,7 +134,8 @@
 	else if(t >= stof(argv(1)))
 	{
 		// time code reached!
-		e.scriptstate = stof(argv(2)) * 2; // 0 = off, 2 = on
+		e.scriptvelocity = stof(argv(2));
+		e.scriptstate = (e.scriptvelocity > 0) ? 2 : 0;
 		e.scripttime = stof(argv(1));
 		e.scriptline += 1;
 	}
@@ -143,7 +145,7 @@
 		if(e.bgmscriptdecay >= 1)
 			return (e.scriptstate == 2);
 		else
-			return pow(0.5, (t - e.scripttime) * (e.bgmscriptdecay / (1 - e.bgmscriptdecay)));
+			return pow(0.5, (t - e.scripttime) * (e.bgmscriptdecay / (1 - e.bgmscriptdecay))) * e.scriptvelocity;
 	}
 	else
 		return 0;

Modified: trunk/data/scripts/entities.def
===================================================================
--- trunk/data/scripts/entities.def	2009-04-15 23:21:50 UTC (rev 6495)
+++ trunk/data/scripts/entities.def	2009-04-16 05:41:22 UTC (rev 6496)
@@ -1154,7 +1154,7 @@
 -------- NOTES --------
 Use trigger_monoflop if you want the particles to turn off for a while, then turn back on.
 A BGM script is a .bgs file named like the map, in the maps directory. Its format is lines of the form
-  <emitter class> <time since start of background music> <0 if the emitters are to be switched off, 1 if they are to be switched on>
+  <emitter class> <time since start of background music> <0 if the emitters are to be switched off, >0 and <=1 if they are to be switched on>
 e.g.
   smokers 4.7 1
   smokers 4.9 0

Modified: trunk/misc/netradiant-NexuizPack/nexuiz.game/data/entities.def
===================================================================
--- trunk/misc/netradiant-NexuizPack/nexuiz.game/data/entities.def	2009-04-15 23:21:50 UTC (rev 6495)
+++ trunk/misc/netradiant-NexuizPack/nexuiz.game/data/entities.def	2009-04-16 05:41:22 UTC (rev 6496)
@@ -1147,10 +1147,18 @@
 atten: distance attenuation of the sound (a value from 0.1 to 3.9), default is 0.5; set to -1 for no attenuation (global sound)
 volume: volume of the sound
 targetname: name to target this (then its state is toggled)
+bgmscript: emitter class from the BGM script
+bgmscriptdecay: how fast the effect strength decays while it is active (0 = not at all, 1 = immediately, values in between are supported)
 -------- SPAWNFLAGS --------
 START_ON: when targeted, the particle emitter will start switched on
 -------- NOTES --------
-Use trigger_monoflop if you want the particles to turn off for a while, then turn back on
+Use trigger_monoflop if you want the particles to turn off for a while, then turn back on.
+A BGM script is a .bgs file named like the map, in the maps directory. Its format is lines of the form
+  <emitter class> <time since start of background music> <0 if the emitters are to be switched off, >0 and <=1 if they are to be switched on>
+e.g.
+  smokers 4.7 1
+  smokers 4.9 0
+The lines MUST be sorted by emitter class as primary key, and by the time since start of the BGM as secondary key.
 */
 
 /*QUAKED trigger_flipflop (.5 .5 .5) (-8 -8 -8) (8 8 8) START_ON



More information about the nexuiz-commits mailing list