Soncresity Industries Wiki

Cnfg

A List of File formats supported by SI: Essentials

Cnfg file format

A Cnfg is a configuration file with the extension .cnfg.
The Cnfg file syntax is similar to YAML.

Syntax

Comments

Comments are declared with a #.

Example:

# This is a comment

Keys & Values

Keys and Values are defined with key = value.

Example:

my_key = value

String Values

A String value is enclosed in double quotes.

Example

my_key = "string_value"

Numerical Values

Numerical values don't require any quotes.
Float, Long, etc. values don't require any suffixes (e.g f or l) and will be parsed automatically. (Decimal values still need a decimal point!)

Example

my_number = 3

Lists

Lists can hold Strings or Numerical values. (Not both at the same time!)
A list is always enclosed in squared brackets.

Indents

The indents will always be restored as seen in the example for better readability.

Example

my_list = [
    "my",
    "values"
]

Maps

Maps can hold Strings or Numerical values. (Not both at the same time!)
A map is always enclosed in curly brackets.

Indents

The indents will always be restored as seen in the example for better readability.

Example

my_map = {
    "key1": "value1",
    "key2": "value2"
}

Sets

Sets can hold Strings or Numerical values. (Not both at the same time!) A set is always enclosed in curly brackets.

If you didn't know, a Set is a Collection that doesn't allow duplicate values. So if you try to add the same value multiple times, it will only be stored once.

Indents

The indents will always be restored as seen in the example for better readability.

Example

my_set = {
    "value1",
    "value2"
}

On this page