Configuration Sections

 

Configuration Sections are used to specify  a set of key-value pairs used to configure mod mechanics

cfg {name} {
    {entries…}
}

Configuration Entries can have multiple forms:

  • {key} = {decimal number}
    • Can be fractional and/or negative
  • {key} = 0x{hex number}
    • Must be a non-negative integer
  • {key} = {string}
    • String should be quoted unless it’s a single, alphanumeric word
  • {key} = {  {number list}  }
    • List is delimited by spaces or new lines
  • A child section (using the same format as above)
  • Drops List

Notes:

  • Keys can have non-alphanumeric characters in them, but must be quoted in that case
  • Colors, where required, can be specified either as a {r g b} list (with value 0 – 1) or a hex number (0xRRGGBB)
  • Boolean values will interpret “Y”, “True”, “Yes”, “On” (case insensitive) as True and anything else as false
  • Sections with the same name defined in different places will be seamlessly merged, with the later overriding previous values on collisions
cfg Foo {
    someNumber = 1
    someFraction = -0.0003
    hexNumber = 0xDEADBEAF

    cfg Bar { // This is a subsection
        someString = "Lorem Ipsum"
        anotherString = fooBar // quotes are not required for single words
       "complicated:key.name" = "needs quotes"
    }

    myColor = 0xFF0000 // Specifies red
    anotherColor = { 1 0 0 } // Red as well
    
    fact = True
    fiction = False
}
 Posted by at 7:59 am