Exit_Secret

From ZDoom Wiki
Jump to navigation Jump to search

244:Exit_Secret (pos)

  • pos: Corresponds to destination player start spot arg0

Usage

Teleports the player to the secret map defined for this map in MAPINFO and to the player start spot whose arg0 matches pos. Note that on standard Doom 1 maps, ZDoom will only use this special on maps E1M3, E2M5, E3M6 and E4M2. In Doom 2, only maps MAP15 and MAP31 will be affected by its use. This can be overridden by the use of MAPINFO.

Note that the map will not immediately exit as soon as this command is encountered; instead, a flag will be set that causes the map to exit during processing of the next tic. Therefore, if there are any further commands in the ACS script it is present in, they will be executed up until the first delay. To ensure that the script halts immediately at this command, make it the final command within its script or put a terminate/delay(1) command immediately after it.

Examples

It is possible to make an exit that is both normal and secret, and only goes to the secret level based on some condition, for example: How many tokens were collected — tokens being some sort of predefined thing that can be picked up, be it a DECORATE item or a standard doom item.

int tokens = 0;

script 1 (void)
{
	if (tokens == 5)
		Exit_Secret(0);
	else
		Exit_Normal(0);
}

script 7 (void)
{
	tokens++;
	PrintBold(d:tokens, s:"/5 collected!");
}

The first script exits the level. If the player has all five tokens, the next level will be the secret level. Otherwise they will have missed it and are sent to the next level.

The script numbered 7 is set activate upon each of the token's specials. That is, make their thing special to be ACS_Execute and the arguments to be (7, 0, 0, 0, 0). When a thing is picked up, its special is activated, so these five items will add to the token count and allow the secret level to be reached.

Conversions from linedef types

The following Doom map format types can be converted as Exit_Secret:

Type Conversion Trigger
MiniDoomLogoIcon.pngDoom 51:S1 Exit (Secret) Exit_Secret (0) Player Use
MiniHereticLogoIcon.pngHeretic 105:W1 Exit (Secret) Exit_Secret (0) Player Cross
MiniDoomLogoIcon.pngDoom 124:W1 Exit (Secret) Exit_Secret (0) Player Cross
MiniBoomLogoIcon.pngBoom 198:G1 Exit (Secret) Exit_Secret (0) Attack Hit, Missile Cross