Tutorial: Changing Levels Last edited 21 years ago2003-11-02 05:00:00 UTC

You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date. Click here to see the current revision of this page.

This article was converted from a previous version of TWHL and may need to be reviewed

  1. The formatting may be incorrect due to differences in the WikiCode processing engine, it needs to be revised and reformatted
  2. Some information may be out of date
  3. After the article is re-formatted and updated, remove this notice and the Review Required category.
  4. Some older tutorials are no longer useful, or they duplicate information from other tutorials and entity guides. In this case, delete the page after merging any relevant information into other pages. Contact an admin to delete a page.

Download attachment

A quick and dirty guide to perfect level changes

Level changes are often over explained, and too complicated for their own good. There really is nothing to them and if you follow this tutorial step by step, you should have absolutely no trouble whatsoever.

1. A level change is, simply put, a transition or displacement from one map (.bsp file) to another. And the reason you're reading this is because you're lost or trying to get a level change to work properly.

2. Why do I need level changes? I can get by without them, and save my self a lot of hassle...

Ok... Half-Life maps have limits. These limits should NEVER be reached or pushed, You can read more about these at Slackillers web page, go to the Tommy14 link and look at the error tutorial: general MAX_MAP limits.

3. What does that have to do with level changes?

It means, that if your levels are getting too big you should consider splitting them into 2 or more separate levels. This can be really useful for reducing r_speeds when working with two or more complex areas, or just to help you keep track of where you are in your map. Huge detailed maps are really difficult to work with in Hammer, as you probably already know.

4. Tell me what I need to know...

There are 3 types of level changes:

Seamless: The simplest level change you can have - walk through a corridor, see some loading text, end up in another map, but your position in the corridor and the environment around you does not change. The place you end up in is a carbon copy of the place you have come from.

Displacement: Same as above only the environment changes - i.e. go through a corridor in a lab and end up in your office/classroom searching for the 'check for problems' button in your life...It is a bit like teleporting, but you are doing it across maps.

One-way: You can get there, but you can never return.

6. So, What exactly do I do for a simple seamless level change?

Before we start these things are very important:

NEVER test level changes by running your map through Hammer using F9 or running it through any other editor, always use the console to load your map or start your map from a shortcut. You can get more information on how to do this by reading SKEEVE'S How to run a hl.bsp file tutorial.

ALWAYS put names of maps and info_landmarks in lowercase!!! And do not use spaces or other characters except numbers and letters, _ underscores are ok.

Right.

The only entities you'll need - since you just want a simple level change - will be tigger_changelevel (one in each map) and an info_landmark (the same one in each map)

Start by making a suitable corridor:
A suitably suitable corridorA suitably suitable corridor
VERY IMPORTANT STUFF

The info_landmark:

The info_landmark sets up a constant point of reference in the origin and destination maps. It must appear in both maps otherwise the level change will not work correctly. The origin and destination info_landmark must both have the same Name (targetname)

So basically, it's the same info_landmark in both maps.
LandmarkLandmark
The Origin map trigger_changelevel:

Set these properties you need to change:

New map name: map2
Landmark Name: landmark1 (or whatever you called your two identical landmarks - one in each map)

The Destination map trigger_changelevel:

Set these properties you need to change:

New map name: map1
Landmark Name: landmark1 (or whatever you called your two identical landmarks - one in each map)
TriggerTrigger
Now, compile the maps through hammer or any other front-end compiler but remember not to run the game!, fire up hl with the console, and test the transition. If you did this correctly you should seamlessly jump from one map to the next no matter how you enter the trigger_changelevel.

One Way Changes

You would think a one way level change would only require one trigger_changelevel?

Wrong.

You have to set the level change up exactly as you would for a normal change. The difference is that in the second map, reduce the size of the trigger_changelevel brush and move it somewhere that the player cannot get to it. That is what stops the player from going back. You can also check the Use Only Flag just to make sure those NoClipping players still can't get back.

Well done, now drink some water - it helps re-hydrate your brain.

21 Comments

Commented 16 years ago2008-07-24 03:43:29 UTC Comment #100615
great tutorial ;)
Commented 16 years ago2008-08-03 13:59:00 UTC Comment #100616
When I loaded the next level, I was outside of the map. Can anyone help me? :(
Commented 16 years ago2008-10-05 20:40:54 UTC Comment #100617
couldnt be explained clearer.
Commented 15 years ago2009-01-24 19:30:37 UTC Comment #100618
it crashes when i get on the 2nd map
Commented 15 years ago2009-06-10 23:56:06 UTC Comment #100619
great tutorial thanks! i set up everything the way you said, but i get "stuck" when i arrive at map2, that is, i can't move, even with noclipping!
Commented 15 years ago2009-09-14 04:19:55 UTC Comment #100620
Why don't I have trigger_changlevel?
Commented 14 years ago2010-10-11 04:25:36 UTC Comment #100621
it crashes for me too, i cant get it to work!
Commented 13 years ago2011-02-19 06:52:39 UTC Comment #100622
If its crashing, make sure your landmarks have the SAME name, and that BOTH levels, regardless of one way or both ways, have the trigger AND a landmark. I just had that problem, and now my map works.
Commented 13 years ago2011-08-24 00:06:36 UTC Comment #100623
Also make sure you've actually compiled both maps before running the game. Yeah, that has happened to me. Twice.
Commented 9 years ago2015-03-26 22:07:25 UTC Comment #100624
Moreover this trigger_changelevel method allows the following entity persistence !
Commented 9 years ago2015-07-23 02:16:49 UTC Comment #100625
Why is it taking me back to the loading screen where I choose the player and teams?
Commented 9 years ago2015-08-17 08:15:46 UTC Comment #100626
Good tutorial it's just that I'm stuck when on the second map...
Commented 9 years ago2015-11-10 01:53:51 UTC Comment #100627
I had a problem with a levelchange, maybe it helps someone what I found out.

I have three maps and the player traverses them in this order:

Map a
Map b
Map c

The transition between Map b and Map c didn't work because the trigger_changelevel from "map a" to "map b" had a wrong "New map name", like "Map C". So I guess The Value you type in for "New map name" is Case-Sensitive.
Commented 8 years ago2016-05-24 08:40:17 UTC Comment #100628
I made two test maps for an HL mod I want create.

The transition from 1st map to 2nd map worked correctly.

But when I tried to return to 1st map, it didn't worked. Why?
Commented 8 years ago2016-05-29 11:59:17 UTC Comment #100629
alright, the level change work for me, only one issue: since my level change is in an elevator, i have npcs from the previous level who shows up in the next level, but i really dont need them in here, so how do i get rid of them?
Commented 8 years ago2016-10-01 06:17:55 UTC Comment #100630
Me works, but the npcs of the another map continue in the new map? Why?
Commented 3 years ago2021-03-09 00:47:21 UTC Comment #103401
Never intersect the trigger changelevel, bcoz the trigger to get to the other map doesnt work, and thats was my error, the game change the map when I get into the intersection and the trigger doesnt work anyway. :confused:
On the superior of the screen it say : CHANGELEVEL Map1 Map1toMap2
The error was solved when I moved the trigger a bit more far than the other. Thanks for read.
Commented 3 years ago2021-08-11 15:56:42 UTC Comment #103664
why can't you do one-way level change by omission? does it affect some parts of the game?
Commented 2 years ago2022-01-31 15:46:04 UTC Comment #104066
I often keep Half-Life running in the background while I make small changes and quickly recompile maps. I then restart the map through the console and test again. I can verify that this is a bad way to test trigger_changelevels. Even though it's all perfectly set up, I ended up on world coordinate 0,0,0. You really have to restart Half-Life completely if you make any changes to the changelevel triggers.
Commented 11 months ago2023-11-27 19:24:33 UTC Comment #105663
when i play my first map and walk into the trigger, it spawns me out of bounds, i did everything. HELP PLS.
EDIT: fixed it. i put a info_player_start in the second map and it was interfering.
Commented 1 month ago2024-10-03 17:01:20 UTC Comment #106437
a super helpful guide, thanks!

You must log in to post a comment. You can login or register a new account.