Scripting
advanced scriptingVoxel Pyramid · Scripting
Like Combat Zone, Voxel Pyramid exposes its generator and plan so you can build gameplay on the generated tomb.
Accessing the generator
var gen = env.world.GetGenerator<PyramidMazeGenerator>();Regenerating
gen.Regenerate(newSeed); // reloads the world with a new monument and mazeReading the plan
gen.CurrentPlan returns the PyramidMazePlan, which carries the monument geometry as data:
| Member | What it gives you |
|---|---|
| frustum | Centre, base half-width, height, base and apex world Y, sampled ground datum, tier count and wall thickness. |
| entrance | Door centre, entry floor, south-face Z, opening size and how far the hall reaches inward. |
| basePosition | World voxel position of the base centre. |
Placing the pyramid in your own world
Set Base Position (in the inspector or on the plan) to drop the pyramid anywhere in an existing world. Because a detail generator only writes the chunks it intersects, you can add the Pyramid Maze Generator to a world that already has other generators (for example beyond a river in a city) and their footprints will not conflict.
Remember the world height rule: keep the terrain minimum height at or below the pyramid base, or the buried walls will leak to the sky. See How Generation Works.
Was this page helpful?
Suggest an improvement
Help us improve this documentation page.