ChangeMap

From Spheriki

Jump to: navigation, search

Changes the current map of the Sphere map engine.


Contents

Usage

ChangeMap(map_filename);
  • map_filename String. Filename or path to the map to switch to, relative to the maps subdirectory of the game.


Examples

To run the following example, the "forest.rmp" map must exist. This code can be placed in a trigger in another map which the player has access to.

ChangeMap("forest.rmp");


Notes

  • This function will only work while the map engine is running. This condition can be checked for using the IsMapEngineRunning() function.
  • (untested) The map_filename argument can also take a path that can access any subdirectory of the same game. To do this, use the .. as the first directory of the path, to indicate the parent directory of the maps game subdirectory.
  • Any person specified in the old map, as well as any people created using CreatePerson() with the third parameter set to true (destroy_on_exit), will be cleared so they won't appear on the map specified to this function.
  • Script execution will still continue after a call to this function. This can be used as an opportunity to set up flags, variables or modify the map before it is seen in the next refresh. This can also be accomplished using the SCRIPT_ON_ENTER_MAP map script.


See also

Personal tools