Skip to content

atl/sm/worlds

import "atl/sm/worlds"

Creating and finding worlds (sm.world).

func Create(scriptPath, className string, terrainParams atl.Value, seed *int) sm.World

[server] Creates a world running script class className from scriptPath, e.g. worlds.Create("$CONTENT_DATA/Scripts/World.lua", "World", atl.Value{}, nil).

func Load(w sm.World) bool

[server] Loads a world created earlier (e.g. one kept in storage).

func Current() sm.World

The world the running script is in.

func LegacyCreativeWorld() sm.World

[server] The world of a legacy creative save.

type DirtySphere struct {
Center sm.Vec3
Radius float64
}

A region where something changed.

func DirtySpheres(position *sm.Vec3, radius *float64) []DirtySphere

Spheres where something changed in the world (optionally only near position).