From 3733b7e9ba32c1ec81aec495ce203e82cd250485 Mon Sep 17 00:00:00 2001 From: ac-stef Date: Tue, 28 Apr 2015 11:30:34 +0200 Subject: [PATCH] script "mapmodelzoff" to allow negative z-offsets for mapmodels A mapmodel entity is placed at a z-coordinate that is based on the floor height of map geometry and a z-offset. The z-offset is a sum of the entity attribute 3 and the third mapmodel slot parameter. The entity z-offset can range from 0 to 255 while the mapmodel slot parameter can be any integer including negative numbers. So, to place a mapmodel below floor height, the mapmodel slot parameter has to be negative. This script decreases the mapmodel slot parameter by one and increases the z-offset of every mapmodel which uses that slot also by one. This means, that all mapmodel are exact in the same place afterwards - but the entity z-offset now has room to lower the mapmodel by one more cube. The script requires one parameter: the mapmodel slot number. If you need more z-offset available, run the script several times. DOCREF mapmodelzoff --- config/scripts.cfg | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config/scripts.cfg b/config/scripts.cfg index 5c99f702..b18b0461 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -36,6 +36,18 @@ const convertclips [ ] ] +// increase legroom for mapmodels by decreasing the z-offset of a map config mapmodel slot +// and simultaneously increasing the z-offset of all affected map model entities +// (this is to counteract the fact, that the z-offset of an entity can only hold positive numbers - using the ability of the slot config to use negative numbers)) +// this will not change anything visible in the map - but allow a mapmodel to be lowered further than before +// the only argument is the slot number - for more leg room, repeat the script +const mapmodelzoff [ + if (strlen (editmapmodelslot $arg1)) [ // invalid slot returns empty string + looplist (editmapmodelslot $arg1) [rad h zoff snap path] [editmapmodelslot $arg1 "" "" (- $zoff 1) ; echo $path in slot # $arg1 : new z-offset (- $zoff 1)] + looplist (mapmodelslotusage $arg1) ii [editentity $ii "" "" "" "" "" (+ 1 (at (editentity $ii) 6)) ; echo adjusted entity # $ii] + ] +] + // "gibsgore" command: // This command controls gib Speed/Number/TTL all in one variable. const gibsgore [