ID:1605783
 
Keywords: bug, locate
(See the best response by Legacy of Caine.)
Anyone else having the issue where they set src.loc = locate(x,y,z) and it ends up sending them to Z - 1 so you have to use usr.loc = locate(x,y,z+1) instead?
Best response
I can't say that I've ever encountered this issue, I use locate quite a lot and it always does as it's told.
I'd have to agree with Caine. I've never experienced difficulties with locate(), especially the z cord. Have you tried testing it on a complete seperate project?
Do you have at least two map files? IIRC, the Z levels are added in alphabetical order of the files (though, mind you, I did not program in BYOND for YEARS).

If this is the case, I suggest having some sort of location tag which you can locate() to.

To do this, place (or edit an existing) object at the point of interest (at some places, you may want to make it invisible + density=0). In the map editor, right click the object and edit its property. Set the 'tag' value with a unique value (ex: "Site1")

Then you can translocate people by doing: x.loc = locate("Site1")
In response to GhostAnime
GhostAnime wrote:
Do you have at least two map files? IIRC, the Z levels are added in alphabetical order of the files (though, mind you, I did not program in BYOND for YEARS).

If this is the case, I suggest having some sort of location tag which you can locate() to.

To do this, place (or edit an existing) object at the point of interest (at some places, you may want to make it invisible + density=0). In the map editor, right click the object and edit its property. Set the 'tag' value with a unique value (ex: "Site1")

Then you can translocate people by doing: x.loc = locate("Site1")

Just to add on to this. When map files are added together, their z levels are merged. A map file containing five z levels will combine with your second map, of say another five to form ten. You can then directly call locate() to set an atom's location onto either map.