ID:139809
 
Code for Creating a Planet:
mob
verb
Create_Planet(map as text)
if(src.planet==0)
var/obj/M=new(map,_x=50,_y=50,_z=1)
var/obj/Z=new/obj/planetr(src.loc)
Z.claimer=src.ckey
Z.inside=M
src.planet=1
else
src<<"You have already made a planet!"</

Code for using the inside variable:
obj
planetr
icon='ICONS.dmi'
icon_state="Planet_Red"
name="Planet"
density=1
verb/Visit()
set src in range(1)
if(src.claimer==usr.ckey)
usr.owner=1
usr.inplanet=1
usr.loc=locate(src.inside)
else
if(src.locked==0)
usr.loc=locate(src.inside)
usr.inplanet=1
else
usr<<"That planet has been locked by its owner."

Problem description: Whenever I try to visit the planet, I just go to an expanse of blank space, and my character is no where in sight. You're supposed to be on a whole new layer, and since every player makes their own planet, it can't be a set layer. So I'm trying to make it make a new one, and it won't let me go to it.

http://www.byond.com/ members/?command=reference&path=proc%2Flocate

Notice how none of the forms of locate() take an object as an argument.
Apply a tag to any turf on that new map with tag="".
Then use src.loc=locate("[the tag]")

OR

You can jump straight to an object, but .loc must be added onto the end so that you move to that objects location and not inside that object itself.
In response to Garthor
not an object directly, no, but if he uses a tag or a .loc variable of an atom, it'll bring him there. He could use a direct turf reference, but yes, not an object, doing that moves him into the object itself.
In response to Bravo1
No. locate(object) will give you null.
In response to Garthor
locate(object.loc) will return that loc. Which is what I said.
In response to Bravo1
locate(object.loc) will return null. Take two seconds to test it out for yourself.
In response to Garthor
Sorry, I was confused by what you meant. Yes, locate(obj.loc) returns null I was telling him to either use locate(tag) or a.loc=b.loc