World

World and Map Generation

class WorldGenerator: Prototype
staticmethod reg(name: string): WorldGenerator

Register a new WorldGenerator static object

Parameters:

name (string) – The name of the object

staticmethod find(name: string): WorldGenerator

Searching for WorldGenerator in db

Parameters:

name (string) – The name of the object

staticmethod get_class(): Class

Return WorldGenerator class object

staticmethod cast(object: Object): WorldGenerator

Trying to cast Object into WorldGenerator

Parameters:

object (Object) – to cast

class MapgenData: Instance
staticmethod new(parent: Object, name: string): MapgenData

Creates a new MapgenData instance

Parameters:
  • parent (Object) – Object of parent

  • name (string) – The name of the instance

staticmethod new_simple(): MapgenData

Creates a new MapgenData instance

staticmethod get_class(): Class

Return MapgenData class object

staticmethod cast(object: Object): MapgenData

Trying to cast Object into MapgenData

Parameters:

object (Object) – to cast

class MapStructure: Object
offset: Vec2i

undocumented

structure: StaticStructure

undocumented

staticmethod new(): MapStructure

Create new instance of MapStructure

class Region: Instance
pos: Vec2i

undocumented

add_structure(self: Region, structure: MapStructure)

Add structure to this Region

add_source(self: Region, source: SourceData)

Add source to this Region

staticmethod new(parent: Object, name: string): Region

Creates a new Region instance

Parameters:
  • parent (Object) – Object of parent

  • name (string) – The name of the instance

staticmethod new_simple(): Region

Creates a new Region instance

staticmethod get_class(): Class

Return Region class object

staticmethod cast(object: Object): Region

Trying to cast Object into Region

Parameters:

object (Object) – to cast

class RegionLayer: Instance
item: StaticItem

item to mine

staticmethod new(parent: Object, name: string): RegionLayer

Creates a new RegionLayer instance

Parameters:
  • parent (Object) – Object of parent

  • name (string) – The name of the instance

staticmethod new_simple(): RegionLayer

Creates a new RegionLayer instance

staticmethod get_class(): Class

Return RegionLayer class object

staticmethod cast(object: Object): RegionLayer

Trying to cast Object into RegionLayer

Parameters:

object (Object) – to cast

class RegionMap

Global object

reset(self: RegionMap)

Delete all regions

get_region(self: RegionMap, spos: Vec2i): Region

Get Region by its position

Parameters:

spos (Vec2i) – position in RegionMap grid

find_region(self: RegionMap, spos: Vec2i): Region

Looking for existing Region with given sector position

Parameters:

spos (Vec2i) – position in RegionMap grid

find_source(self: RegionMap, wbpos: Vec3i): SourceData

Looking for SourceData near given location in world blocks

Parameters:

wbpos (Vec3i) – position in Dimension grid

has_region(self: RegionMap, pos: Vec2i): boolean

Is region exists

Parameters:

pos (Vec2i) – region position

staticmethod world_block_to_grid(bpos: Vec3i): (RegionMap: Vec2i)

Convert Block World position to RegionMap grid cell that contains this position

Returns:

RegionMap (Vec2i) – grid position

staticmethod new(parent: Object, name: string): RegionMap

Creates a new RegionMap instance

Parameters:
  • parent (Object) – Object of parent

  • name (string) – The name of the instance

staticmethod new_simple(): RegionMap

Creates a new RegionMap instance

staticmethod get_class(): Class

Return RegionMap class object

staticmethod cast(object: Object): RegionMap

Trying to cast Object into RegionMap

Parameters:

object (Object) – to cast

class LayeringGenerator: Prototype
staticmethod reg(name: string): LayeringGenerator

Register a new LayeringGenerator static object

Parameters:

name (string) – The name of the object

staticmethod find(name: string): LayeringGenerator

Searching for LayeringGenerator in db

Parameters:

name (string) – The name of the object

staticmethod get_class(): Class

Return LayeringGenerator class object

staticmethod cast(object: Object): LayeringGenerator

Trying to cast Object into LayeringGenerator

Parameters:

object (Object) – to cast

class SimpleLayeringGenerator: LayeringGenerator
class ChancedLayeringGenerator: SimpleLayeringGenerator
class PropsGenerator: Prototype
staticmethod reg(name: string): PropsGenerator

Register a new PropsGenerator static object

Parameters:

name (string) – The name of the object

staticmethod find(name: string): PropsGenerator

Searching for PropsGenerator in db

Parameters:

name (string) – The name of the object

staticmethod get_class(): Class

Return PropsGenerator class object

staticmethod cast(object: Object): PropsGenerator

Trying to cast Object into PropsGenerator

Parameters:

object (Object) – to cast

class Biome: Prototype
staticmethod reg(name: string): Biome

Register a new Biome static object

Parameters:

name (string) – The name of the object

staticmethod find(name: string): Biome

Searching for Biome in db

Parameters:

name (string) – The name of the object

staticmethod get_class(): Class

Return Biome class object

staticmethod cast(object: Object): Biome

Trying to cast Object into Biome

Parameters:

object (Object) – to cast

class BiomeFamily: Biome
class SourceData: Instance
position: Vec2i

source position in block coordinates

item: StaticItem

item to mine

initial_capacity: integer

initial source capacity

extracted_count: integer

count of items already extracted from the source

staticmethod new(parent: Object, name: string): SourceData

Creates a new SourceData instance

Parameters:
  • parent (Object) – Object of parent

  • name (string) – The name of the instance

staticmethod new_simple(): SourceData

Creates a new SourceData instance

staticmethod get_class(): Class

Return SourceData class object

staticmethod cast(object: Object): SourceData

Trying to cast Object into SourceData

Parameters:

object (Object) – to cast

class Dimension
settings: GameSessionData

undocumented

spawn_block(
    self: Dimension,
    bpos: Vec3i,
    quat: Quat,
    staticBlock: StaticBlock
): (The: BlockLogic)

Spawn a block at the given position

Parameters:
  • bpos (Vec3i) – Block position

  • quat (Quat) – Rotation

  • staticBlock (StaticBlock) – Block type to spawn

Returns:

The (BlockLogic) – spawned block logic instance

spawn_block_identity(self: Dimension, bpos: Vec3i, staticBlock: StaticBlock): (The: BlockLogic)

Spawn a block with full identity at the given position

Parameters:
  • bpos (Vec3i) – Block position

  • staticBlock (StaticBlock) – Block type to spawn with identity rotation

Returns:

The (BlockLogic) – spawned block logic instance

set_cell(self: Dimension, bpos: Vec3i, cl: StaticBlock | nil)

Set a block cell at the given position

Parameters:
  • bpos (Vec3i) – Block position

  • cl (StaticBlock | nil) – Block type to set

clear_props(self: Dimension, bpos: Vec3i)

Clear all props at the given position

Parameters:

bpos (Vec3i) – Block position