User Tools

Site Tools


modding:info

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
modding:info [2017-03-19 11:02]
skyjake [String values]
modding:info [2017-03-19 11:04] (current)
skyjake [String values]
Line 1: Line 1:
 +====== Info ======
 +
 +An [[Info]] file contains key-value pairs that can be collected into nested groups.
 +
 +===== Syntax =====
 +
 +==== Comments ====
 +
 +  # A single line comment stops here.
 +
 +Longer comments:
 +
 +  #> Multi-line comment begins.
 +  Continues...
 +  And ends here. <#
 +==== Key-value definitions ====
 +
 +Identifiers are case insensitive.
 +
 +  Key: Value
 +  KEY = Value
 +
 +When '':''​ is used, the remainder of the line is used as-is as the value. When the assignment operator ''​=''​ is used, only the following single token is used as the value.
 +==== String values ====
 +
 +Text strings can be broken onto multiple lines as follows. There are no escape sequences. However, two consecutive single-quote characters produce the ''"''​ character.
 +
 +  help =
 +      "Run game's in windowed mode. "
 +      "This is a ''​long''​ string that continues."​
 +      ​
 +<​note>​**Technical details:** It is assumed that embedded markup is used for rich-formatting purposes where applicable/​suitable.</​note>​
 +
 +==== Lists ====
 +
 +The value in a key-value definition may also be a list.
 +
 +  key <value1, value2, value3>
 +
 +Note that no assignment operator or colon character is used in this case.
 +
 +==== Blocks ====
 +
 +Blocks group one or more definitions together. A block may contain zero or more statements and/or nested blocks. Both curly brackets and parentheses can both be used to as delimiters.
 +
 +Syntax example:
 +
 +  blocktype name {
 +      # ... Definition statements ...
 +  }
 +   
 +==== Attributes ====
 +
 +Following the ''​blocktype name''​ pair that begins a group, you may add any number of attributes. An attribute is key-value pair that becomes a member of the group just like the definitions inside the block.
 +
 +The following blocks all mean the same thing:
 +
 +  component jdoom {
 +      library: jDoom.dll
 +  }
 +  component jdoom library jDoom.dll {}
 +  component jdoom {library="​jDoom"​ "​.dll"​} ​ # note: string joining
 +
 +==== Examples ====
 +
 +<​code>​
 +boolean run-in-window requires jdoom (
 +  option: -wnd
 +  default: ​ this is the default?
 +
 +  help = "Run game in windowed mode. "
 +    "This is a ''​long''​ string that continues."​
 +
 +  description:​ Can contain any # chars : even () {}
 +)
 +
 +choice display-color-bits {
 +  options <16, 32>
 +
 +  subblock test ( hey = there )
 +}
 +</​code>​
 +
 +
 +
 +===== See also =====
 +
 +  *  [[Addon format]]
 +  *  [[snowberry:​configuration_file|Snowberry configuration files]]
 +  *  [[http://​github.com/​skyjake/​Doomsday-Engine/​blob/​master/​snowberry/​cfparser.py|Info syntax parser implementation]] (Python)
 +
 +
 +
 +
  
modding/info.txt ยท Last modified: 2017-03-19 11:04 by skyjake