multi scene map with global variables

im wanting to make a map split into sveral scenes
and linked together. The poblem im having is making the character apear at a different start location depending on what other scene he enters from

You might need a little python for that, but it should be fairly simple. Using an always sensor with the pulses turned off will cause a single pulse at scene start up. Then put an empty where you want your character to be. Then use:



scene = GameLogic.getCurrentScene()
empty = scene.getObjectList()["OBemptyName"]
player = scene.getObjectList()["OBplayerName"]
player.setPosition(empty.getPosition())



You can attach the script to the ground plane or something, it doesn’t have to be on the character. If you doing this a lot, then make a property with name of empty and you can use the same script over and over by getting owner.property, or you might be able to use the same name for the empty in another scene.

Oops, didn’t read far enough. You’ll have to use a GameLogic variable to get the last scene before the character exits and then use some if statements to position the character depending on the last scene. So you’ll need multiple empties.

1 Like