Skip to content
Permalink
Browse files

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
  • Loading branch information...
ac-stef committed Apr 28, 2015
1 parent 706b990 commit 358335c12553bc7e07090baf3b4636f0e78d2316
Showing with 12 additions and 0 deletions.
  1. +12 −0 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 [

0 comments on commit 358335c

Please sign in to comment.
You can’t perform that action at this time.