Users who would like to run for moderator must be autoconfirmed and have at least 100 edits. Users can check their own edit count at Special:Preferences.
trigger_changelevel
![]() |
---|
CChangeLevel defined in ![]() triggers.cpp
|
trigger_changelevel
is a brush entity available in all Source games. Upon being triggered, it will prompt the game to load another level.
![Note.png](/w/images/thumb/c/cc/Note.png/10px-Note.png)
![Half-Life 2: Deathmatch](/w/images/thumb/8/80/Hl2dm_icon.png/32px-Hl2dm_icon.png)
![Note.png](/w/images/thumb/c/cc/Note.png/10px-Note.png)
![Left 4 Dead series](/w/images/thumb/9/9b/L4dseries-16px.png/32px-L4dseries-16px.png)
![Icon-Bug.png](/w/images/thumb/b/b4/Icon-Bug.png/10px-Icon-Bug.png)
Start Disabled
option is set to Yes
the brush will become solid to the player, getting it stuck if the transition happens within its volume.Contents
Notes
Place an info_landmark in both maps to mark the same location in both maps. The info_landmark must be in the player's PVS when the level change is triggered. If it is not, the level change will fail. Both info_landmark entities must have the same name. This name must not have any spaces in it. They also must not be inside a solid brush. Both the landmark name and the map name must be less than 32 characters in length.
![Note.png](/w/images/thumb/c/cc/Note.png/10px-Note.png)
Level transitions must be two-way. That is to say, there must be a trigger_changelevel in the next level that points to the current level, as well as the trigger_changelevel taking the player to the next level. If a one-way level transition is desired, simply make this second trigger_changelevel inaccessible to the player (and/or check the Disable Touch
flag).
![Warning.png](/w/images/thumb/c/cb/Warning.png/10px-Warning.png)
To fire events in the next level, use a trigger output to turn on an env_global in the current level. The entity has a few pre-defined states but you can manually type your own custom state. Create a logic_auto in the next level that checks for the state set by the env_global. Now use the OnChangeLevel output of the logic_auto to trigger events.
To control which entities go through the level transition, create one or more trigger_transitions and give them the same name as the landmark. Any entities within the trigger_transition(s) will go to the next map.
Keyvalues
- Name
(???)
<targetname> - Name of the brush.
- New Map Name
(???)
<string> - Name of the map to change to.
- Landmark Name
(???)
<targetname> - Name of the landmark to use. (See above for details!)
Flags
- [
2
] : Disable Touch
- [
4
] : To Previous Chapter
Inputs
ChangeLevel
- Cause the level change. Use this when triggering the level change with a button, etc.
![Warning.png](/w/images/thumb/c/cb/Warning.png/10px-Warning.png)
![Source 2007](/w/images/thumb/7/78/Src07-16px.png/32px-Src07-16px.png)
Outputs
OnChangeLevel
- Fired when the level changes.