Skip to main content

Config

A global API used to save and load avatar data between game sessions

warning

This page is a WIP. It contains all the information in Figura's documentation but we're working on adding more helpful descriptions.


setName()

Aliases: name()

Sets the name of the destination file, data will be saved and loaded from that file

Defaults to the avatar name

setName(name)

Parameters:

NameTypeDescriptionDefault
nameString--

Returns:

TypeDescription
ConfigAPIReturns self for chaining

Example:

config:setName("Something")

getName()

Returns the name of the destination file

getName()

Returns:

TypeDescription
String-

Example:

config:getName()

load()

Loads a saved variable under the specific key

If no key is given, it will return a table with all saved variables

load()

Returns:

TypeDescription
Table-

Example:

config:load("apple")

save()

Save to disk a variable under the specific key

If the value is nil, the variable is removed from the file

save(key, value)

Parameters:

NameTypeDescriptionDefault
keyString--
valueAnyType--

Returns:

TypeDescription
ConfigAPIReturns self for chaining

Example:

config:save("apple", false)