C2G: Difference between revisions

565 bytes added ,  9 June 2020
Add section about basic syntax (RPN)
No edit summary
(Add section about basic syntax (RPN))
Line 62: Line 62:
== Advanced scripting ==
== Advanced scripting ==
In addition to the features described above, C2G files can support some additional keywords that provide extra features. '''Note that any information beyond this point may be incomplete or inaccurate.'''
In addition to the features described above, C2G files can support some additional keywords that provide extra features. '''Note that any information beyond this point may be incomplete or inaccurate.'''
=== Syntax ===
The syntax of the .c2m file appears to be a mix of [Reverse Polish Notation](https://en.wikipedia.org/wiki/Reverse_Polish_notation) expressions and simple statements.  For example, to set the global "flags" variable to (reg1 + 42) * 3, you would write:
  reg1 42 + 3 * flags =
Other statements, such as "map" or "music" take a parameter after the keyword:
  map "somemap.c2m"
In addition, variables can be formatted into strings in script sections by placing the variable after a string with a printf-style format specifier:
  "flags = %ld" flags


=== Score ===
=== Score ===
trusted-editors
10

edits