Changing mapsI. IntroductionThis tutorial will teach you how to switch from one map to another, to put multiple maps together in order to create a full game.
II. The easy wayThe easiest way to get to the next map can be set up in the editor with a few clicks, but is quite limited in functionality.
It will allow you to start a different map when the player steps into a certain mesh.
This can be useful if you want the map to end when the player reaches a certain spot like the exit of a burning building,
a helicopter to rescue him or a teleporter to warp him to the battlefield.
First, create a new mesh where you want that final zone to be. You should make sure that there is no way for the player to walk around it,
because they will end up everywhere but where they wanted to go. Possibly some unfinished part of your level.
You can also use an already existing mesh. It all depends on the map.
Select the mesh and click the messages tab in the window that pops up.

Check the Auto Map Change checkbox, select your map from the list and enter the name and type of the start spot in that map.
(The default values are probably fine.)
...and you're done!
Hit the Run button and see if it works and modify the settings until you are happy with the result.
III. Scripting map changesWhile using the Auto Map Change is quick and easy and might be all you will need for your game, some things cannot be done that way.
For example: Maybe you want the map to change when the player defeats a boss or presses a switch.
Here you will have to script a bit, but it's actually quite simple, because there is just one line that you will need to add.
map.action.setMap(mapname,spotname,spotype);The three parameters are the name of the map to change to, the name of the start spot in that map and the type of the start spot.
Example:
map.action.setMap("my_Map","Start","Player");So basically, it works just like the Auto Map Change, but gives you more freedom in choosing when the map should be changed.
A few ideas:
- Add it to the death function of your levels boss. When the player kills it, he will be sent to the next map.
- Add it to a switch or an important item. When it is pressed or picked up, move on to the next level.
- Add a timer to your map script that changes the map after a certain amount of time has passed. This could be used in a survival mission.
- You can even create a large, open world by having multiple entries and exits that interconnect different maps.
If you have further questions, don't hesitate to PM me.