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:
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.
Parameters:
Type | Name | Description |
---|---|---|
integer | x | The X-coordinate. |
integer | y | The Y-coordinate. |
integer | size | Size of harvestable (defaults to any size). |
Returns:
Type | Description |
---|---|
table | A table {harvestable, ...} of harvestables. |
sm.cell.getInteractablesByAnyUuid(x, y, uuids)
Server only
Returns a table of interactables which matches any of the given uuids for a cell coordinate.
Note:
Can only be used in a server_onCellLoaded callback.
Parameters:
Type | Name | Description |
---|---|---|
integer | x | The X-coordinate. |
integer | y | The Y-coordinate. |
table | uuids | A table {Uuid, ...} of uuids to match interactables against. |
Returns:
Type | Description |
---|---|
table | A table {interactable} of found interactables with matching uuid. |
sm.cell.getInteractablesByTag(x, y, tags)
Server only
Returns a table of interactables which contain the given tag for a cell coordinate.
Note:
Can only be used in a server_onCellLoaded callback.
Parameters:
Type | Name | Description |
---|---|---|
integer | x | The X-coordinate. |
integer | y | The Y-coordinate. |
table | tags | A table {string, ...} of tags to match with. |
Returns:
Type | Description |
---|---|
table | A table {interactable, ...} of found interactables with matching tag. |
sm.cell.getInteractablesByTags(x, y, tags)
Server only
Returns a table of interactables which contain all of the given tags for a cell coordinate.
Note:
Can only be used in a server_onCellLoaded callback
Parameters:
Type | Name | Description |
---|---|---|
integer | x | The X-coordinate |
integer | y | The Y-coordinate |
table | tags | A table {string, ...} of tags to match with. |
Returns:
Type | Description |
---|---|
table | A table {interactable, ...} of found interactables with matching tags |
sm.cell.getInteractablesByUuid(x, y, uuid)
Server only
Returns a table of interactables of a given uuid for a cell coordinate.
Note:
Can only be used in a server_onCellLoaded callback.
Parameters:
Type | Name | Description |
---|---|---|
integer | x | The X-coordinate. |
integer | y | The Y-coordinate. |
Uuid | uuid | The uuid of the interactable(s) |
Returns:
Type | Description |
---|---|
table | A table {interactable, ...} of found interactables with matching uuid. |
sm.cell.getNodesByTag(x, y, tag)
Returns a table of nodes which contains the given tag for a cell coordinate.
Parameters:
Type | Name | Description |
---|---|---|
integer | x | X-coordinate. |
integer | y | Y-coordinate. |
string | tag | Tag to match with. |
Returns:
Type | Description |
---|---|
table | Table containing { position = Vec3, rotation = Quat, scale = Vec3, tags = {string, ...}, params = table } for each node. |
sm.cell.getNodesByTags(x, y, tags)
Returns a table of nodes which contain all of the given tags for a cell coordinate.
Parameters:
Type | Name | Description |
---|---|---|
integer | x | X-coordinate. |
integer | y | Y-coordinate. |
table | tags | A table {string, ...} of tags to match with. |
Returns:
Type | Description |
---|---|
table | Table containing { position = Vec3, rotation = Quat, scale = Vec3, tags = {string, ...}, params = table } for each node. |
sm.cell.getTags(x, y)
Returns a table of tags for a cell coordinate.
Parameters:
Type | Name | Description |
---|---|---|
integer | x | X-coordinate |
integer | y | Y-coordinate |
Returns:
Type | Description |
---|---|
table | Table {string, ...} of tags. |