sm.terrainGeneration
Allows reading and writing in game storage from terrain generation scripts.
Functions
getTempData
sm.terrainGeneration.getTempData( key )
Loads temporary data stored by terrain generation.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
any | Key used to lookup the saved data. |
Returns:
| Type | Description |
|---|---|
| any | The saved data. |
loadGameStorage
sm.terrainGeneration.loadGameStorage( key )
Loads data stored by terrain generation.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
any | Key used to lookup the saved data. |
Returns:
| Type | Description |
|---|---|
| any | The saved data. |
saveAndSyncGameStorage
sm.terrainGeneration.saveAndSyncGameStorage( key, data )
Saves data produced from terrain generation and synchronizes to clients. Saved data can be retrived in later game sessions and by the game lua environment.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
any | Key used to lookup the saved data. |
data |
any | Data to save. |
saveGameStorage
sm.terrainGeneration.saveGameStorage( key, data )
Saves data produced from terrain generation. Saved data can be retrived in later game sessions and by the game lua environment.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
any | Key used to lookup the saved data. |
data |
any | Data to save. |
setAndSyncGameStorageNoSave
sm.terrainGeneration.setAndSyncGameStorageNoSave( key, data )
Sets data produced from terrain generation and synchronizes to clients. This data is only valid during the game session.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
any | Key used to lookup the saved data. |
data |
any | Data to save. |
setGameStorageNoSave
sm.terrainGeneration.setGameStorageNoSave( key, data )
Sets data produced from terrain generation. This data is only valid during the game session. Does not synchronize to clients
Parameters:
| Name | Type | Description |
|---|---|---|
key |
any | Key used to lookup the saved data. |
data |
any | Data to save. |
setTempData
sm.terrainGeneration.setTempData( key, data )
Sets temporary data produced from terrain generation.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
any | Key used to lookup the saved data. |
data |
any | Data to save. |