Available since Version 1.27.
Sets a custom save data value for a mod.
Syntax
SetCustomSaveDataValue( value_name, value )Arguments
- value_name (string): The name of the value.
- value (boolean | integer | number | string | nil): The value.
- Setting a value to
nilwill delete it from the save file. - Other types, such as tables, will throw an error.
- Setting a value to
Return Values
No return values.
Examples
SetCustomSaveDataValue("Potato", "Salad")Notes
- This function will throw an error if it is called before the game's save manager is available (such as in CustomFiles.lua).
- It is not possible to set a value for another mod.