ID:174272
 
How exactly does the z coordinate work for maps? :/
Can each map contain multiple levels designated by the z coordinate, or is each map itself a "Z level" of the world's maxz? What I want to do is have 2 map layers with one being an outdoors map and the other an indoors map. Can this be done in a single map file or do I need one for each layer? If it's multiple maps, do I specify it's Z as the layer it is or what?

Confused about Z,
Edhrid
Each map can contain multiple Z levels. To set how many a map file has, just open up the map editor, then click Options-->Set Map Size... Then increase the Z.
Now to move between Z levels on the map editor, you just click the left and right arrows (Located where it says "Coordinate".
Also, when you compile and run a game all map files are merged into one. The map files get stacked on top of each other. So if I have 3 files, each with 2 Z levels, when I compile it will become a 6 Z level map.
I belive they are stacked according to the file names (Alphabetical order).
In response to DarkView
Awsome! Thanks a bunch. :D That's exactly the info I was looking for. So, multiple map files are really only used for organisational purposes. One more question. Say you are working with 2 different map files, each with 2 z levels. You set up an area on the 1st map which transports mobs to the 2nd map's 1st z level. Would you just use something like this?:

mob.loc = locate(1,1,3)

Also, can anybody confirm the map stacking order?
In response to Edhrid
Yes, that should work. And yes, maps are stacked alphabetically.

A more reliable way of keeping track of multiple Z levels is to "tag" them. That way, if you rename maps or add in new maps that disrupt the stacking order, you won't have to go through updating all your Z level references.

You do this by placing objs on each map, and setting their tag vars to things like "maptag_startingmap" or "maptag_evildungeon". Then you can use locate() to find the obj, and thus the appropriate Z level. For example:

<code>obj/maptag //Use these objs to tag maps proc/FindMap(mapname) var/obj/maptag/TheTag=locate("maptag_[mapname]") if (!TheTag) //Couldn't find that map! CRASH("Could not find a map with the tag '[mapname]'") return TheTag.z //Return Z level of the obj</code>