Static Functions
Namespaces that group related functions and constants.
This section contains 59 namespaces.
| Page | Description |
|---|---|
Global |
Globals |
sm |
The sm namespace contain all API features related to Scrap Mechanic. |
sm.ai |
AI utility functions. |
sm.areaTrigger |
An area trigger is an invisible collider in the world that can trigger events when objects move in or out of it. This allows the script to, for instance, detect when a character enters a door, or count the number of shapes there are in a room. |
sm.audio |
The audio manager is used to play sound effects in the game. |
sm.body |
A body is a collection of shapes that are built together. Bodies can be connected to other bodies using joints such as the bearing. |
sm.builderGuide |
Builder Guide |
sm.camera |
The camera library contains methods related to the localPlayer's camera view. |
sm.cell |
The cell api exposes and expands on parts of the world loading process. |
sm.challenge |
The Challenge api contains functions related to the Challenge game mode. |
sm.character |
A character is the physical body of a living entity in the world. Both players and units may control a character. |
sm.clientScriptableObject |
ScriptableObject creation |
sm.color |
A color is represented using a red, green, blue and alpha component. Colors are prominently used for blocks and parts that are colored by the Paint Tool. |
sm.construction |
The Construction api is used for interacting with the shape construction system. |
sm.container |
Functions and constants provided by sm.container. |
sm.creation |
A Creation represent a collection of Bodies linked together by Joints. |
sm.cullSphereGroup |
A cull sphere group is a collection of spheres that can be efficiently queried for. |
sm.debris |
Debris are visual objects that have no impact on any other object. |
sm.debugDraw |
The Debug Draw api can be used for drawing geometric primitives for debug purposes. |
sm.debugGui |
No description or API members are present in the published source. |
sm.effect |
The effect api handles the creation and playing of audio and visual effects. |
sm.event |
Events for communicating between scripts by running callbacks. |
sm.game |
Used to check the state of the game. |
sm.garage |
The Garage library contains various utility functions for handling the garage. |
sm.gui |
The gui library contains various utility functions for handling user interfaces. |
sm.gui.widget |
Removed! Don't use. |
sm.harvestable |
Harvestable creation |
sm.interactable |
Functions and constants provided by sm.interactable. |
sm.item |
Allows checking for static infortmation about items. |
sm.joint |
A joint is a part that can be built by a player that is used to connect bodies. There are multiple scriptable joint types: |
sm.json |
Parses and writes json files from and to lua values. |
sm.jsonGui |
Functions and constants provided by sm.jsonGui. |
sm.lift |
Functions and constants provided by sm.lift. |
sm.localPlayer |
Local player represents the current character being controlled on the client's computer. This library can only be used on the client. |
sm.log |
Used for logging information from scripts to the game log. |
sm.melee |
Information about melee attacks are located in /Data/Melee/attacks.json. |
sm.menuCreation |
Used to save and load blueprints displayed in the menu. |
sm.message |
Functions and constants provided by sm.message. |
sm.noise |
Contains methods related to random number and noise generation. |
sm.particle |
The particle api allows you to create particle effects at a position. |
sm.pathfinder |
Pathfinder |
sm.pathNode |
Path node creation |
sm.physics |
Contains functions regarding the physics engine. |
sm.pipeGraph |
Pipe utility functions. |
sm.player |
A player is a user playing the game. Every player controls a Character in the world. |
sm.portal |
A portal moves objects inside a box to another box in another place. |
sm.projectile |
Information about projectiles are located in /Data/Projectiles/ProjectileSets/projectiles.json. |
sm.quat |
A quaternion is used to represent rotation as a generalization of complex numbers. |
sm.render |
Render settings |
sm.scriptableObject |
ScriptableObject creation |
sm.shape |
A shape is any block, part or basic material that can be built by a player. Shapes are always connected to a Body, which is a collection of shapes. |
sm.storage |
Storage is used for saving and loading any Lua data into the world's database. This allows for data to be retrieved after closing and reloading the world. |
sm.tool |
A tool is a scripted tool a player holds in their hand. The tool object is focused on handling animations for first and third person view. |
sm.unit |
Unit creation and management |
sm.util |
Offers various math-related functions. |
sm.uuid |
A universally unique identifier (UUID) is a 128-bit number that can guarantee uniqueness across space and time. |
sm.vec3 |
A vector is used to represent position and direction in 3D space, using X, Y and Z coordinates. |
sm.visualization |
Visualization is used for visualizing game objects. |
sm.world |
The world api handles the creation and destruction of worlds. |