Please create an account or Login! Have fun!
Editing C2G
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 72: | Line 72: | ||
In addition, variables can be formatted into strings in script sections by placing the variable after a string with a printf-style format specifier: | 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 | "flags = %ld" flags | ||
=== Score === | === Score === | ||
Line 144: | Line 133: | ||
Replace "<#>" with the desired time limit for the set. This will ignore any time limits set for individual levels. Time limits will be carried over from one level to the next, and restarting the level does not reset the time limit. [[Time bonus]]es and [[time penalty|time penalties]] can still be used. After the time limit reaches 0, or if a level is skipped, all future levels will be untimed. | Replace "<#>" with the desired time limit for the set. This will ignore any time limits set for individual levels. Time limits will be carried over from one level to the next, and restarting the level does not reset the time limit. [[Time bonus]]es and [[time penalty|time penalties]] can still be used. After the time limit reaches 0, or if a level is skipped, all future levels will be untimed. | ||
=== | === Exit choices === | ||
If a level has several [[exit]]s, C2G scripting can be used to send the player to different levels depending on what exit is entered. | |||
In order to do this, each level must be given a label starting with a pound (#) character. For example: | |||
<nowiki>#bonuslevel | |||
In order to do this, | |||
<nowiki># | |||
script | script | ||
" | "Congratulations!" | ||
"the secret | "You have reached" | ||
"the secret level!" | |||
" | map "BonusLevel.c2m"</nowiki> | ||
In the example above, the level BonusLevel.c2m as well as the preceding text are given the label "bonuslevel". | |||
In the above | |||
Exits are numbered in reading order, starting at 1; there does not appear to be any limit. In order to use the feature, after calling the "map" of the level containing the exits, a line similar to this will be required: | |||
Exits are numbered in reading order, starting at 1; there does not appear to be any limit. In order to use the feature, after calling the "map" of the level containing the exits, | |||
<nowiki> <#> exit == do goto #label</nowiki> | <nowiki> <#> exit == do goto #label</nowiki> | ||
Replace <#> with the exit number, and #label with the label name (including the #). For example: | Replace <#> with the exit number, and #label with the label name (including the #). For example: | ||
Line 218: | Line 158: | ||
script | script | ||
"This is the end."</nowiki> | "This is the end."</nowiki> | ||
In the example above, the game will load the level stored in the file ChooseYourFuture.c2m; if the player exits using the first exit in reading order, the game will then display the THIS IS THE END message. If the player exits using the second exit, however, the game will load the level in the file SuperSecretFinalLevel.c2m instead, and the THIS IS THE END message will be displayed after the level has been solved. | In the example above, the game will load the level stored in the file ChooseYourFuture.c2m; if the player exits using the first exit in reading order, the game will then display the THIS IS THE END. message. If the player exits using the second exit, however, the game will load the level in the file SuperSecretFinalLevel.c2m instead, and the THIS IS THE END message will be displayed after the level has been solved. | ||
If there are several players in the level, the exit used by the last player to finish the level will be the one used by the C2G script. If an invalid label is called, or no label is assigned for the exit that was used, the game will continue to work through the C2G file as it would normally. | If there are several players in the level, the exit used by the last player to finish the level will be the one used by the C2G script. If an invalid label is called, or no label is assigned for the exit that was used, the game will continue to work through the C2G file as it would normally. | ||
Line 231: | Line 171: | ||
If there are several players in the level, the gender of the last one to finish the level will be the one used by the C2G script. If an invalid label is called, or no line is specified for a specific gender, the game will continue to work through the C2G file as it would normally. | If there are several players in the level, the gender of the last one to finish the level will be the one used by the C2G script. If an invalid label is called, or no line is specified for a specific gender, the game will continue to work through the C2G file as it would normally. | ||
=== Goto === | |||
Goto can also be used in absence of a gender or exit check. For example: | |||
<nowiki>map "NormalProgression.c2m" | |||
#loop | |||
map "DejaVu.c2m" | |||
map "StuckInALoop.c2m" | |||
goto #loop</nowiki> | |||
In the example above, completing StuckInALoop.c2m will always take you back by one level to DejaVu.c2m. | |||
=== Fake level numbers === | === Fake level numbers === | ||
Line 247: | Line 196: | ||
map "Normal.c2m"</nowiki> | map "Normal.c2m"</nowiki> | ||
In the example above, Normal.c2m will be level 9. | In the example above, Normal.c2m will be level 9. | ||
=== Speed === | === Speed === | ||
Line 272: | Line 219: | ||
The following lines | The following lines | ||
<nowiki>1 level = | <nowiki>1 level = | ||
50 | 50 highspeed = continue replay | silent | flags =</nowiki> | ||
added to the beginning of the file (after the set name) will cause the game to automatically replay the recorded solutions for all levels in the set, in extremely high speed. This can be used to quickly verify that all levels are solvable and have recorded replays. | added to the beginning of the file (after the set name) will cause the game to automatically replay the recorded solutions for all levels in the set, in extremely high speed. This can be used to quickly verify that all levels are solvable and have recorded replays. | ||
== Comments box == | == Comments box == | ||
Line 320: | Line 227: | ||
followed, on subsequent lines, by the C2G parameters. | followed, on subsequent lines, by the C2G parameters. | ||
== | == Complete set of keywords == | ||
On September 19th, 2019, [[Joshua Bone]] posted a complete list of keywords that can or could be used in C2G scripting, including numbers and comparison operators. The function of some keywords in here is unknown, and some formerly did something but are now just gibberish to the engine (NO_L_DOORS for example). | |||
<nowiki>MUSIC | |||
GOTO | |||
DO | |||
== | |||
<= | |||
>= | |||
!= | |||
= | |||
< | |||
> | |||
LEVEL | |||
GENDER | |||
EXIT | |||
ENTER | |||
SCORE | |||
BONUS | |||
MENU | |||
CHIPS | |||
START | |||
MALE | |||
FEMALE | |||
MAP | |||
SCRIPT | |||
" | |||
# | |||
0 | |||
1 | |||
2 | |||
3 | |||
4 | |||
5 | |||
6 | |||
7 | |||
8 | |||
9 | |||
; | |||
// | |||
END | |||
RESULT | |||
REG1 | |||
REG2 | |||
REG3 | |||
REG4 | |||
FLAGS | |||
EDIT | |||
CHAIN | |||
LINE | |||
CHDIR | |||
SCREEN | |||
* | |||
/ | |||
+ | |||
- | |||
&& | |||
& | |||
|| | |||
// | |||
| | |||
| | |||
| | | | ||
% | |||
^ | |||
REPLAY | |||
CONTINUE | |||
SILENT | |||
KTIME | |||
KTOOLS | |||
TLEFT | |||
TOOLS | |||
KEYS | |||
ART | |||
WAV | |||
RAND | |||
SPEED | |||
NO_BONUS | |||
NO_L_DOORS | |||
MAIN | |||
GAME | |||
DLC</nowiki> | |||
[[Category:File formats]] | [[Category:File formats]] |