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 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.''' | ||
=== Score === | === Score === | ||
Line 144: | Line 123: | ||
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 | |||
<nowiki> | |||
script | script | ||
" | "Congratulations!" | ||
"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, | 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: | ||
<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 148: | ||
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 161: | ||
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 186: | ||
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 === | ||
C2G scripting can be used to modify the | C2G scripting can be used to modify the game at which the speed is played. To do this, the following line must be added before calling the map: | ||
<nowiki> 1 speed =</nowiki> | <nowiki> 1 speed =</nowiki> | ||
The number determines the speed, | The number determines the speed, with 1 is normal speed; the upper limit is unknown. This flag will apply for all future levels; in order to restore normal speed, the flag must be called again before a later level. | ||
=== Blocking flags === | === Blocking flags === | ||
Line 272: | Line 209: | ||
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 217: | ||
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 valid keywords for C2G scripting, including numbers and comparison operators. The function of some keywords in here is unknown. | |||
<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]] |