ID:177886
 
How do you make your character go from one map to another?
character.loc = locate(x,y,z), where z is the number of the map you want. If you're using multiple maps, all the maps are combined into one map and each put on seperate z levels.
Codesterz wrote:
How do you make your character go from one map to another?

Just to elaborate on what Foomer said, each map is given a different Z level and treated as part of the overall game map. The order may be arbitrary, so what you probably need is a tagged turf in each map indicating which map it is.

For example, if on 'worldmap1.dmp', you put a turf at (1,1,1) (map coordinates) with tag="worldmap1", then you can always find which z level the map is on like this:
var/atom/cornerstone=locate("worldmap1")
var/mapz=cornerstone.z

On the off chance this locate() may be slow (I'm not clear on how the internals work in this), you might want to try this modification:
proc/GetMapZ(mapname)
var/atom/cornerstone=locate(mapname) in \
block(locate(1,1,1),locate(1,1,world.maxz))
return cornerstone.z

(The \ is just to split up the line for readability purposes.)
You can determine the "height" of an individual map by giving the cornerstone a var with that information. (For example, all turfs could have a var/mapheight=1, but your cornerstone might set this to mapheight=3 instead to indicate that "town4" is 3 z-levels tall.

Lummox JR
Codesterz wrote:
How do you make your character go from one map to another?

Or you can make a turf on one map and he is warped to that turf. However, that is highly unflexible.