C2G: Difference between revisions

171 bytes removed ,  15 January
→‎Reference: remove duplicate entry from table
No edit summary
(→‎Reference: remove duplicate entry from table)
 
(3 intermediate revisions by 3 users not shown)
Line 3: Line 3:
While individual levels are stored in [[C2M]] files, C2G files arrange these levels in [[levelset]]s. C2G files can also be used to specify music tracks, text between levels, and several forms of advanced scripting.
While individual levels are stored in [[C2M]] files, C2G files arrange these levels in [[levelset]]s. C2G files can also be used to specify music tracks, text between levels, and several forms of advanced scripting.


The official set does not use any advanced C2G features, nor did [[Chuck Sommerville]] provide any documentation; there are several features that have not yet been discovered by the community.
The official set does not use any advanced C2G features, nor did [[Chuck Sommerville]] provide any documentation; there may be features still undiscovered by the community.


== Basic usage ==
== Basic usage ==
Line 135: Line 135:
  2564 tools =
  2564 tools =


Note that tool codes > 16 will be reduced to a value <= 16, and key counts > 9 will be reduced to 9. These limits do not apply when either inventory is carried over from the previous level.
Note that tool codes between 17 and 127 will be reduced to a value <= 16. Codes from 128 to 257 produce [[negative items | strange results]]. Key counts > 9 will be reduced to 9.


=== Timed levelset ===
=== Timed levelset ===
Line 313: Line 313:
map "OkayLevel.c2m"</nowiki>
map "OkayLevel.c2m"</nowiki>


Unused bits of the "flags" variable itself are also available, but theoretically, future updates to CC2 could add new special flags at any moment.
Unused bits of the "flags" variable itself are also available, but flipping them is unadvised, as, theoretically, future updates to CC2 could add new purposes to unused flags at any moment.


== Comments box ==
== Comments box ==
Certain C2G scripts, notably ktools and speed can be placed inside a [[C2M|specific level file]]'s comments field, and will apply to the level itself. To do this, the comments field must contain the following line:
Certain C2G scripts, notably ktools and speed can be placed inside a [[C2M|specific level file]]'s comments field, and will apply to the level itself. To do this, the comments field must contain the following line:
  <nowiki>[COM]</nowiki>
  <nowiki>[COM]</nowiki>
followed, on subsequent lines, by the C2G parameters.
followed, on subsequent lines, by the C2G parameters. For example, this will cause all players to start the level with fire boots and flippers.
<nowiki>
[COM]
flags ktools | flags = 1027 tools =</nowiki>


== Reference ==
== Reference ==
Line 489: Line 492:
|
|
| Appears to be unused.
| Appears to be unused.
|-
| *<br />/<br />+<br />-<br />&amp;&amp;<br />&amp;<br />&#124;&#124;<br />&#124;<br />%<br />^
| binary operator
| <pre>&lt;expressions...&gt; &lt;operator&gt;</pre>
| Pop two values from the preceding expressions and evaluate them with the specified operator, then push the result.  The operators have the same meanings as in C.
|-
|-
| REPLAY
| REPLAY
Anonymous user