sm.terrainData
The data manager helps storing script data, both locally and between server and client in multiplayer games.
Functions:
sm.terrainData.exists()
Check if terrain data exists for this world.
Returns:
Type | Description |
---|---|
boolean | True if data exists. False otherwise. |
sm.terrainData.legacy_getData()
Deprecated:
Legacy function for reading creative terrain. Do not use.
Returns:
Type | Description |
---|---|
string | The serialized bitser data. |
sm.terrainData.legacy_loadTerrainData(id)
Deprecated:
Legacy function for reading creative custom terrain. Do not use.
Parameters:
Type | Name | Description |
---|---|---|
integer | id | The id. |
Returns:
Type | Description |
---|---|
any | The data. Any lua object. |
sm.terrainData.legacy_saveTerrainData(id, data)
Deprecated:
Legacy function for storing creative custom terrain. Do not use.
Parameters:
Type | Name | Description |
---|---|---|
integer | id | The id. |
any | data | The data. Any lua object. |
sm.terrainData.legacy_setData(data)
Deprecated:
Legacy function for storing creative terrain. Do not use.
Parameters:
Type | Name | Description |
---|---|---|
string | data | The serialized bitser data. |
sm.terrainData.load()
Load terrain data for this world if available.
Returns:
Type | Description |
---|---|
any | The data. Any lua object. |
sm.terrainData.save(data)
Save and share terrain data over network from server to client.
The data is accessible from the same world.
Parameters:
Type | Name | Description |
---|---|---|
any | data | The data. Any lua object. |