Skip to content

TinyGo SDK reference

Import atl and atl/sm, plus the atl/sm/... packages you use.

Package Covers
atl AllTheLanguages TinyGo SDK: import atl and atl/sm (and the atl/sm/... packages you use) to get the whole sm API.
atl/sm The core Scrap Mechanic API: game object types (Shape, Body, Interactable, Character, Player, World, ...). The sm.* namespaces that operate on them are the atl/sm/... packages.
atl/sm/achievement Steam achievements and stats (sm.achievement; official content only). playerIDs defaults to everyone.
atl/sm/ai Helpers for AI units (sm.ai).
atl/sm/areatrigger Area triggers (sm.areaTrigger): volumes that report what enters, stays in and leaves them.
atl/sm/audio Sounds (sm.audio).
atl/sm/bodies Bodies (sm.body).
atl/sm/builderguides Builder guides (sm.builderGuide; see sm.BuilderGuide).
atl/sm/camera The game camera (sm.camera). Reading works anywhere; setters require a scripted state.
atl/sm/cell Contents of a cell, by cell coordinates (sm.cell).
atl/sm/challenge Challenge mode (sm.challenge). All [server] except IsMasterMechanicTrial.
atl/sm/characters Characters (sm.character).
atl/sm/clientscriptableobjects Client-only scriptable objects (sm.clientScriptableObject).
atl/sm/compromised [server] Compromised (structurally weakened) shapes (sm.compromised).
atl/sm/construction Building blocks onto a Lift, Shape or Joint (sm.construction).
atl/sm/container Container transactions (sm.container).
atl/sm/creation Importing and exporting blueprints (sm.creation).
atl/sm/cullspheregroups Cull sphere groups (sm.cullSphereGroup; see sm.CullSphereGroup).
atl/sm/debris [client] Visual-only physics debris (sm.debris).
atl/sm/debugdraw sm.debugDraw: draws shapes in the world for debugging (dev mode only).
atl/sm/debugdraw/topdown The top-down (map) view of sm.debugDraw: drawn for one frame, or flashed for seconds.
atl/sm/effect Effects (sm.effect).
atl/sm/event Calls method callback(args) on another object's script (sm.event). Network rules apply: a server call reaches the server side, a client call the client side. For a Go script, callback is a name registered with Method. Each function returns true if the event was sent.
atl/sm/fire [server] Fire (sm.fire).
atl/sm/game Game state and settings (sm.game).
atl/sm/garages Blueprint import areas (sm.garage; see sm.Garage).
atl/sm/gui GUI helpers (sm.gui): chat, alerts, interaction text, the game's built-in GUIs, and HUD, text and fade helpers. GUIs themselves are sm.Gui.
atl/sm/harvestables [server] Harvestables (sm.harvestable).
atl/sm/item sm.item: static information about item and shape uuids.
atl/sm/json JSON (sm.json).
atl/sm/jsongui GUIs built from a table "DOM" (sm.jsonGui; see sm.JsonGui).
atl/sm/lifts [server] Lifts not owned by a player (sm.lift).
atl/sm/localplayer The player on this client (sm.localPlayer).
atl/sm/log Writing to the game log. format uses "{}" placeholders, as atl.Format.
atl/sm/melee Melee attacks (sm.melee).
atl/sm/menucreation [server] The creation shown in the main menu (sm.menuCreation).
atl/sm/message [server] Publish/subscribe between scripts (sm.message).
atl/sm/noise sm.noise: noise functions.
atl/sm/particle Particles (sm.particle).
atl/sm/pathfinder Navigation-mesh pathfinding (sm.pathfinder).
atl/sm/pathnodes Placed path nodes (sm.pathNode).
atl/sm/physics Physics queries and forces (sm.physics).
atl/sm/pipegraph Pipe networks between containers (sm.pipeGraph). requester is the shape asking.
atl/sm/players Players (sm.player).
atl/sm/portals [server] Portals between worlds (sm.portal; see sm.Portal).
atl/sm/projectile Firing projectiles (sm.projectile). Damage is dealt by the game when a projectile hits.
atl/sm/render Render setting overrides (sm.render). Mostly [client]; each Reset* restores the default.
atl/sm/scriptableobjects Scriptable objects (sm.scriptableObject).
atl/sm/shapes Creating and inspecting shapes (sm.shape).
atl/sm/storage Game-wide save data (sm.storage).
atl/sm/terraindata The world's saved terrain data (sm.terrainData).
atl/sm/terraingeneration Data a terrain script keeps between runs and shares with game scripts (sm.terrainGeneration).
atl/sm/terrainharvestable Kinematic hashes (sm.terrainHarvestable).
atl/sm/terraintile Reading tile files (.tile) (sm.terrainTile). tile is a tile uuid from TileUuid(path); cellOffsetX/Y pick the cell in the tile.
atl/sm/tool Tool helpers (sm.tool): lift placement, paint palette, forced tools.
atl/sm/tunnelgenerator Tunnel generation (sm.tunnelGenerator).
atl/sm/units [server] AI units (sm.unit).
atl/sm/util sm.util: interpolation, hashing and UTF-8 helpers.
atl/sm/visualization [client] The placement visualizations the game draws for the local player (sm.visualization).
atl/sm/voxelterraincell Writing the voxel grid of the cell being generated (sm.voxelTerrainCell).
atl/sm/worlds Creating and finding worlds (sm.world).
atl/sys Raw bindings to the loader's GDT imports (the "atl" import module), as in the C SDK's atl.h.
atl/wire atl/wire: the binary encoding of typed network messages and saved state.