From 221a6013e542cd0939e2ef0daf1a9cd2f11e523d Mon Sep 17 00:00:00 2001 From: div0 Date: Thu, 16 Apr 2009 05:41:22 +0000 Subject: [PATCH] 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... git-svn-id: svn://svn.icculus.org/nexuiz/trunk@6496 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/client/particles.qc | 6 ++++-- data/scripts/entities.def | 2 +- .../nexuiz.game/data/entities.def | 10 +++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/data/qcsrc/client/particles.qc b/data/qcsrc/client/particles.qc index c6c118bc5..e683e3343 100644 --- a/data/qcsrc/client/particles.qc +++ b/data/qcsrc/client/particles.qc @@ -77,6 +77,7 @@ void PointparticlesScript_Init() .float scriptline; .float scriptline0; .float scriptstate; +.float scriptvelocity; .float scripttime; void PointparticlesScript_InitEntity(entity e) { @@ -133,7 +134,8 @@ float PointparticlesScript(entity e) 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 @@ float PointparticlesScript(entity e) 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; diff --git a/data/scripts/entities.def b/data/scripts/entities.def index a9f47a6e8..620bffd46 100644 --- a/data/scripts/entities.def +++ b/data/scripts/entities.def @@ -1154,7 +1154,7 @@ 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. A BGM script is a .bgs file named like the map, in the maps directory. Its format is lines of the form -