Skip to main content

Config

Client Server

Save and load values for this client. These values are stored clients local storage and will be available on all montages he visits. This is useful for saving settings, last player position, etc.

To avoid naming conflicts with other montages, use a unique prefix for each game. For example, if your game is called "MyGame", you can use "MyGame/" as a prefix for all your keys.

Save position
Config:SetVec3("MyGame/PlayerPosition", player.transform.pos)
Load saved position
local defaultPos = Vec3(0,0,0)
local pos = Config:GetVec3("MyGame/PlayerPosition", defaultPos)
player.transform.pos = pos

If you want to save a setting only for this montage include the montage id in the setting

--extract id from url
local url = Client:GetMontageURL()
local id, params = string.match(url, "/view%?m=([%w%-%_]*)(.*)")
Config:SetFloat(id.."/MyGame/Highscore", highscore)

Methods

nil SetInt(string key, integer value)

nil SetFloat(string key, number value)

nil SetBool(string key, boolean value)

nil SetString(string key, string value)

nil SetVec2(string key, Vec2 value)

nil SetVec3(string key, Vec3 value)

nil SetVec4(string key, Vec4 value)

nil Del(string key)

boolean Exists(string key)

nil Save()

force saving Config

integer GetInt(string key)

integer GetInt(string key, integer defaultValue)

number GetFloat(string key)

number GetFloat(string key, number defaultValue)

boolean GetBool(string key)

boolean GetBool(string key, boolean defaultValue)

string GetString(string key)

string GetString(string key, string defaultValue)

Vec2 GetVec2(string key)

Vec2 GetVec2(string key, Vec2 defaultValue)

Vec3 GetVec3(string key)

Vec3 GetVec3(string key, Vec3 defaultValue)

Vec4 GetVec4(string key)

Vec4 GetVec4(string key, Vec4 defaultValue)

table GetAllValuesStringified()