UltimateZoneBuilder/Build/UDBScript/Scripts/Examples/ConvertThingHeightToAbsolute.js
spherallic 192ddc9e6c - Expose GetFloorPlane and GetCeilingPlane to UDBScript
- Add two new example scripts, remove one useless example script
2024-02-20 15:25:13 +01:00

17 lines
430 B
JavaScript

/// <reference path="../udbscript.d.ts" />
`#version 5`;
`#name Convert thing height to absolute Z`;
UDB.Map.getSelectedOrHighlightedThings().forEach(thing => {
const sector = thing.getSector();
if (thing.flags['absolutez'] == false && sector != null) {
let plane = sector.getFloorPlane();
let z = plane.getZ([thing.position.x, thing.position.y]);
thing.position.z += z;
thing.flags['absolutez'] = true;
}
});