sm.cell
The cell api exposes and expands on parts of the world loading process.
These methods are commonly called from cell loading callbacks in World type scripts.
Functions
getHarvestables
sm.cell.getHarvestables( x, y, size )
Server-Only
Returns a table of harvestables of a given size for a cell coordinate.
Sizes are:
0: Tiny - plants and crops.
1: Small - small trees and rocks.
2: Medium - medium trees, visible at a long distance.
3: Large - large trees, visible at a very long distance.
Arguments:x
[ int ]: The X coordinate.y
[ int ]: The Y coordinate.size
[ int ]: The harvestable size (defaults to all).
- [ table ]: The table of harvestables.
getInteractablesByAnyUuid
sm.cell.getInteractablesByAnyUuid( x, y, uuids )
Server-Only
Returns a table of interactables that match any of the given uuids for a cell coordinate.
Can only be used in a server_onCellLoaded
callback.
x
[ int ]: The X coordinate.y
[ int ]: The Y coordinate.uuids
[ table ]: The table of uuids to match interactables against.
- [ table ]: The table interactables with matching uuid.
getInteractablesByTag
sm.cell.getInteractablesByTag( x, y, tag )
Server-Only
Returns a table of interactables that contain the given tag for a cell coordinate.
Can only be used in a server_onCellLoaded
callback.
x
[ int ]: The X coordinate.y
[ int ]: The Y coordinate.tag
[ string ]: The tag to match with.
- [ table ]: The table interactables with matching tag.
getInteractablesByTags
sm.cell.getInteractablesByTags( x, y, tags )
Server-Only
Returns a table of interactables that contain all of the given tags for a cell coordinate.
Can only be used in a server_onCellLoaded
callback.
x
[ int ]: The X coordinate.y
[ int ]: The Y coordinate.tags
[ table ]: The table of tags to match with.
- [ table ]: The table of interactables with matching tag.
getInteractablesByUuid
sm.cell.getInteractablesByUuid( x, y, uuid )
Server-Only
Returns a table of interactables that have the given uuid for a cell coordinate.
Can only be used in a server_onCellLoaded
callback.
x
[ int ]: The X coordinate.y
[ int ]: The Y coordinate.uuid
[ Uuid ]: The uuid of the interactable(s).
- [ table ]: The table of interactables with matching uuid.
getNodesByTag
sm.cell.getNodesByTag( x, y, tag )
Server-Only
Returns a table of nodes that contain the given tag for a cell coordinate.
Arguments:x
[ int ]: The X coordinate.y
[ int ]: The Y coordinate.tag
[ string ]: The tag to match with.
- [ table ]: The table containing node data for each node (see structure below).
{
{
position = vec3,
rotation = quat,
scale = vec3,
tags = { string, ... },
params = { ... }
}
}
getNodesByTags
sm.cell.getNodesByTags( x, y, tags )
Server-Only
Returns a table of nodes that contain all of the given tags for a cell coordinate.
Arguments:x
[ int ]: The X coordinate.y
[ int ]: The Y coordinate.tags
[ table ]: The table of tags to match with.
- [ table ]: The table containing node data for each node (see structure below).
{
{
position = vec3,
rotation = quat,
scale = vec3,
tags = { string, ... },
params = { ... }
}
}
getTags
sm.cell.getTags( x, y )
Server-Only
Returns a table of tags for a cell coordinate.
Arguments:x
[ int ]: The X coordinate.y
[ int ]: The Y coordinate.
- [ table ]: The table of tags.