ChangeLevel
From ZDoom Wiki
void ChangeLevel (str mapname, int position, int flags, int skill)
Usage
Changes to a new map, places the player at the specified start spot, and optionally changes the skill level at the same time.
Parameters
- mapname
- The map (by lump name) to change to.
- position
- The player start number to use. This should match the number specified as the first argument of the player start thing. If there is only one player start, this parameter should be set to 0.
- flags
- The following flags are supported:
- CHANGELEVEL_KEEPFACING: The player's facing angle will not be adjusted during the map change.
- CHANGELEVEL_RESETINVENTORY: The player's inventory is reset as if they had started a new game.
- CHANGELEVEL_NOMONSTERS: Start the new map with nomonsters in effect.
- CHANGELEVEL_NOINTERMISSION: Do not display the intermission screen during the map change.
- skill
- Sets the skill level to start the new map at. This can be useful to create skill-choice maps such as that seen at the beginning of Quake 1.
Examples
When this script is activated, the player is sent to MAP01 (without intermission), his inventory is reset to default and the skill is set to normal (hurt me plenty).
#include "zcommon.acs"
script 22 (VOID)
{
ChangeLevel ("MAP01", 1, CHANGLELEVEL_RESETINVENTORY|CHANGELEVEL_NOINTERMISSION, SKILL_NORMAL);
}
This example will warp the player to map E3M1 at the default player start, will change the skill to Hard (Ultra-Violence) and reset the player's inventory. It will also use the player's current facing.
#include "zcommon.acs"
script 1 (VOID)
{
ChangeLevel ("E3M1", 0, CHANGLELEVEL_RESETINVENTORY|CHANGELEVEL_KEEPFACING, SKILL_HARD);
}

