C2G: Difference between revisions

847 bytes added ,  7 February 2019
no edit summary
No edit summary
No edit summary
Line 126: Line 126:
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.
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. All labels must also contain the text "1 level =" (without the quotes) For example:
In order to do this, each level must be given a label starting with a pound (#) character. For example:
  <nowiki>#bonuslevel
  <nowiki>#bonuslevel
1 level =
script
script
"Congratulations!"
"Congratulations!"
Line 144: Line 143:


#secret
#secret
1 level =
map "SuperSecretFinalLevel.c2m"
map "SuperSecretFinalLevel.c2m"


#end
#end
1 level =
script
script
"This is the end."</nowiki>
"This is the end."</nowiki>
Line 164: 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.
=== Fake level numbers ===
C2G scripting can be used to assign specific numbers to levels. To do this, the following line must be added before calling the level's "map":
<nowiki><#> level =</nowiki>
Replace <#> with the desired level number. This makes it possible to skip (nonexistent) levels and go backwards (for example, going from level 2 to 5 to 248 to 125). Any number can be specified, including four digit numbers (although this will be displayed in-game as 999) and 0. It is also possible to have several levels with the same number.
It is not required to specify numbers for all levels; if the line is absent, or an invalid value (such as a string of number) is given, the game will simply add 1 to the previous level's number. For example:
<nowiki>game "Jumping Around"
2 level =
map "Wheres1.c2m"
0 level =
map "Backwards.c2m"
8 level =
map "Jumping.c2m"
map "Normal.c2m"</nowiki>
In the example above, Normal.c2m will be level 9.


=== Blocking flags ===
=== Blocking flags ===