From 9510b7d72466e11c4a59caa7c5e74e0d89f92e3d Mon Sep 17 00:00:00 2001 From: div0 Date: Fri, 29 May 2009 20:52:23 +0000 Subject: [PATCH] bgmscript: < means angular movement git-svn-id: svn://svn.icculus.org/nexuiz/trunk@6790 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/client/wall.qc | 26 ++++++++++++++++++++++---- data/scripts/entities.def | 2 +- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/data/qcsrc/client/wall.qc b/data/qcsrc/client/wall.qc index b3eaf76c8..3aa140c6e 100644 --- a/data/qcsrc/client/wall.qc +++ b/data/qcsrc/client/wall.qc @@ -1,13 +1,20 @@ .float lip; +.float bgmscriptangular; void Ent_Wall_Draw() { float f; vector save; + var .vector fld; InterpolateOrigin_Do(); - save = self.origin; + if(self.bgmscriptangular) + fld = angles; + else + fld = origin; + + save = self.fld; f = BGMScript(self); if(f >= 0) { @@ -15,7 +22,7 @@ void Ent_Wall_Draw() self.alpha = 1 + self.lip * f; else // > 0: alpha goes from 1-|lip| to 1 when toggled (toggling adds lip) self.alpha = 1 - self.lip * (1 - f); - self.origin = self.origin + self.movedir * f; + self.fld = self.fld + self.movedir * f; } else self.alpha = 1; @@ -23,7 +30,7 @@ void Ent_Wall_Draw() if(self.alpha >= ALPHA_MIN_VISIBLE) R_AddEntity(self); - self.origin = save; + self.fld = save; } void Ent_Wall_Remove() @@ -84,9 +91,20 @@ void Ent_Wall() } else self.mins = self.maxs = '0 0 0'; + if(self.bgmscript) strunzone(self.bgmscript); - self.bgmscript = strzone(ReadString()); + self.bgmscript = ReadString(); + if(substring(self.bgmscript, 0, 1) == "<") + { + self.bgmscript = strzone(substring(self.bgmscript, 1, -1)); + self.bgmscriptangular = 1; + } + else + { + self.bgmscript = strzone(self.bgmscript); + self.bgmscriptangular = 0; + } if(self.bgmscript != "") { self.bgmscriptattack = ReadByte() / 64.0; diff --git a/data/scripts/entities.def b/data/scripts/entities.def index 92cf92436..9242fefec 100644 --- a/data/scripts/entities.def +++ b/data/scripts/entities.def @@ -748,7 +748,7 @@ scale: scale factor of the model (range: 0.0625 to 15.9375) colormap: 1024 + 16 * pantscolor + shirtcolor angles: initial looking direction targetname: when invoking it by a button etc., it changes the color to the initiator of the action (e.g. the one pressing a button). In Onslaught, this can be used to color control points for team who owns them. In other game types, this can be used as a fun feature. Works only with _shirt and _pants textures. -bgmscript: emitter class from the BGM script +bgmscript: emitter class from the BGM script (if prefixed with <, movedir is treated as an angle value) bgmscriptattack: attack time of the effect strength (0 to 3.9) bgmscriptdecay: decay time of the effect strength (0 to 3.9) bgmscriptsustain: sustain level of the effect strength (0.1 to 1, set to -1 to disable sustain) -- 2.39.2