Adding new Live Config settings
In addition to predefined Origin Live Config settings, you can also define new Live Config settings pertaining to your projects. These settings will come under the project
category. To add a Live Config setting entry, you need to do the following:
Navigate to your Project Live Config schema. This is found in your project directory under
{project-root}/Config/LiveConfig/Schemas/project.schema.json
.Add your new live config setting at the appropriate path. Each live config setting entry in the schema must have the following fields:
type
: The data type of the config value. Eitherstring
,boolean
,number
,integer
orobject
description
: A brief explanation of the config setting. This will be displayed alongside your setting in the online editor.
Then, depending on the value of
type
you must add the following field to your config entry:If
type
isobject
properties
: A JSON object containing a group of Live Config schema entires.
If
type
is notobject
default
: The initial value for the setting for a newly started world. (Note: This default value can be overridden on a per-map basis. See this section for details.)
[Optional] You can also add value restrictions on to your values depending on your live config setting
type
. These restrictions will be checked only when you update live config values in a running cloud deploymentIf
type
isnumber
orinteger
minimum
/exclusiveMinimum
: The minimum allowed value for the config (exclusive
only accepts values strictly greater than the given number).maximum
/exclusiveMaximum
: The maximum allowed value for the config (exclusive
only accepts values strictly less than the given number).multipleOf
: Valid forinteger
type only. Restricts live config setting to allow only integers which is a multiple of the value given.
if
type
isstring
:minLength
: An integer denoting the minimum length of the string.maxLength
: An integer denoting the maximum length of the string.pattern
: A string of regex pattern that the config string must match.
An example of a correctly defined string
type live config setting is the following:
This live config setting can be queried with the project
config type and "MyStringConfig"
attribute name.
An example of a correctly defined group of boolean
and integer
type live config setting is the following:
These live config settings can be queried with the project
config type and "MyConfigGroup.MyIntegerConfig"
or "MyConfigGroup.MyBooleanConfig"
attribute names.
Last updated