Info changelevel: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 2: Line 2:
{{Entity|info_changelevel|type=e2|series=Left 4 Dead}}
{{Entity|info_changelevel|type=e2|series=Left 4 Dead}}
It is the entity that marks a level change.
It is the entity that marks a level change.
It safely changes the level in Left 4 Dead series, and defines the end-of-level safe room. It is unusual as it is a brush entity, where info_* entities are typically point entities. Place an [[info_landmark]] in both maps that marks the ''same'' location in each map. In Hammer, <code>info_changelevel</code> will be listed in entity class selection menu when [[Entity_Creation|tied to a brush as an entity]].  
It safely changes the level in Left 4 Dead series, and defines the end-of-level safe room. It is unusual as it is a brush entity, where info_* entities are typically point entities. Place an {{Ent|info_landmark}} in both maps that marks the ''same'' location in each map. In Hammer, <code>info_changelevel</code> will be listed in entity class selection menu when [[Entity_Creation|tied to a brush as an entity]].  
{{Note|{{Ent|trigger_changelevel}} can also be used in Left 4 Dead, although it isn't recommended. It teleports survivors to next saferoom where info_landmark is but it doesn't take into account checkpoint nav squares. You need a info_landmark on both sides, in the same place (relative to the room) so that things end up in the right place. It's like [[trigger_teleport]], the info_landmark in the end safe room is the "center" of the brush, and the new map is the exit (the info_landmark again denoting the center so things are offset correctly). The transition from ''l4d_smalltown02_drainage'' to ''l4d_smalltown03_ranchhouse'' (Death Toll campaign) uses trigger_changelevel instead of info_changelevel.{{confirm|{{Code|oneclick|trigger_changelevel}} is automatically converted to {{Code|oneclick|info_changelevel}}}}}}
{{Note|{{Ent|trigger_changelevel}} can also be used in Left 4 Dead, although it isn't recommended. It teleports survivors to next saferoom where info_landmark is but it doesn't take into account checkpoint nav squares. You need a info_landmark on both sides, in the same place (relative to the room) so that things end up in the right place. It's like {{Ent|trigger_teleport}}, the info_landmark in the end safe room is the "center" of the brush, and the new map is the exit (the info_landmark again denoting the center so things are offset correctly). The transition from ''l4d_smalltown02_drainage'' to ''l4d_smalltown03_ranchhouse'' (Death Toll campaign) uses trigger_changelevel instead of info_changelevel.{{Confirm|{{Code|trigger_changelevel}} is automatically converted to {{Code|info_changelevel}}}}}}
{{Tip|To fire events in the next level, use the <code>OnChangeLevel</code> output to turn on an {{Ent|env_global}} in the current level. Create a [[logic_auto]] entity in the next level that checks for the state set by the env_global.<br>
{{Tip|To fire events in the next level, use the <code>OnChangeLevel</code> output to turn on an {{Ent|env_global}} in the current level. Create a {{Ent|logic_auto}} entity in the next level that checks for the state set by the env_global.<br>
To control which entities go through the level transition, create one or more {{Ent|trigger_transition}} entities and give them the same name as the landmark. Any entities within the trigger_transition(s) will go to the next map.}}
To control which entities go through the level transition, create one or more {{Ent|trigger_transition}} entities and give them the same name as the landmark. Any entities within the trigger_transition(s) will go to the next map.}}


Line 21: Line 21:
== See Also ==
== See Also ==
* [[Level Transitions]]
* [[Level Transitions]]
* [[info_landmark]]
* {{Ent|info_landmark}}
* [[trigger_changelevel]]
* {{Ent|trigger_changelevel}}
* [[trigger_transition]]
* {{Ent|trigger_transition}}
* [[point_changelevel]] {{only|{{portal2}}}}
* {{Ent|point_changelevel}} {{only|{{portal2}}}}
* [[info_changelevel]] {{only|{{l4ds}}}}
* {{Ent|info_changelevel}} {{only|{{l4ds}}}}

Revision as of 02:35, 15 February 2023

C++ Class hierarchy
InfoChangelevel
CBaseTrigger
CBaseToggle
CBaseEntity

Template:Entity It is the entity that marks a level change. It safely changes the level in Left 4 Dead series, and defines the end-of-level safe room. It is unusual as it is a brush entity, where info_* entities are typically point entities. Place an info_landmark in both maps that marks the same location in each map. In Hammer, info_changelevel will be listed in entity class selection menu when tied to a brush as an entity.

Note.pngNote:trigger_changelevel can also be used in Left 4 Dead, although it isn't recommended. It teleports survivors to next saferoom where info_landmark is but it doesn't take into account checkpoint nav squares. You need a info_landmark on both sides, in the same place (relative to the room) so that things end up in the right place. It's like trigger_teleport, the info_landmark in the end safe room is the "center" of the brush, and the new map is the exit (the info_landmark again denoting the center so things are offset correctly). The transition from l4d_smalltown02_drainage to l4d_smalltown03_ranchhouse (Death Toll campaign) uses trigger_changelevel instead of info_changelevel.
Confirm:trigger_changelevel is automatically converted to info_changelevel
Tip.pngTip:To fire events in the next level, use the OnChangeLevel output to turn on an env_global in the current level. Create a logic_auto entity in the next level that checks for the state set by the env_global.
To control which entities go through the level transition, create one or more trigger_transition entities 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) <string>
Name of this landmark.
New Map Name (map) <string>
The filename of the next map (without ".bsp").
Landmark Name (landmark) <targetname>
Changes of positions will take place on transition relative to this landmark.

Flags

Disable Touch : [2]
To Previous Chapter : [4]

Outputs

OnChangeLevel
Fired when the level changes.

See Also