Dimension

Dimension

class

Playable surface holding the block world

Functions

Dimension:spawn_block(bpos, quat, static_block)

Spawn a block at the given position

bpos Vec3i Block position
quat FQuat Rotation
static_block StaticBlock Block type to spawn

returns BlockLogic The spawned block logic instance

Dimension:spawn_block_identity(bpos, static_block)

Spawn a block with identity rotation at the given position

bpos Vec3i Block position
static_block StaticBlock Block type to spawn

returns BlockLogic The spawned block logic instance

Dimension:set_cell(bpos, cl)

Set a block cell at the given position

bpos Vec3i Block position
cl StaticBlock Block type to set

Dimension:get_cell(bpos)

Block standing in the cell at the given position, nil when the cell is empty or its column is not loaded

bpos Vec3i Block position

returns StaticBlock Block type in the cell

Dimension:get_block(bpos)

Runtime block standing in the cell at the given position, nil when the cell is empty or its column is not loaded

bpos Vec3i Block position

returns BlockLogic Block logic in the cell

Dimension:clear_props(bpos)

Clear all props at the given position

bpos Vec3i Block position

Dimension:sample_height(x, y)

Sample the terrain surface the generator builds at XY, in world cell coordinates. Surface rock detail can still raise the built ground a few cells above this

x number X coordinate in world cells
y number Y coordinate in world cells

returns number Surface height in cells, sea level at 0

Dimension:teleport(bpos)

Move the player to a block position, which moves the column streaming anchor with it

bpos Vec3i Block position

Dimension:teleport_pending()

Whether a teleport is still waiting for the target columns to finish compiling

returns boolean True while the player is still in transit

Dimension:columns_loading()

How many columns the streaming area around the player is still generating or reading from disk

returns number Columns waiting on the load worker

Dimension:sectors_compiling()

How many sectors of streamed-in columns have no mesh built for their current contents

returns number Sectors waiting on the mesh compiler

Dimension:streaming_ready()

Whether the world around the player has finished streaming: nothing left to load, nothing left to mesh

returns boolean True when both counts are zero

Dimension:get_produced(item)

How much of an item machines and hand crafts have produced on this surface over the whole save, zero for an item nothing has made yet

item StaticItem Item to count

returns number Units produced all time

Dimension:spawn_ghost(bpos, quat, target)

Place a build ghost standing for a block, the way the build tool places one when the item in hand runs out

bpos Vec3i Block position
quat FQuat Rotation
target StaticBlock Block the ghost stands for

returns BlockLogic The ghost, nil when the cell is not loaded or not free

Dimension:spawn_point()

Block position the player spawns at

returns Vec3i Spawn position in block cells

Inherited from Actor (2)
Inherited from Object (5)