ID:165880
 
So i was starting my first project since im new at creating these games, How do you switch from one room or map to another? When your making rooms how do you make that thing that takes you to the next part of the map.
turf
town
icon='town.dmi'
Enter(mob/M)// checks to see if it is a mob
if(ismob(M))// safety check
if(M.client)// if it is a client
M.loc = locate(22,22,4) // locates the player
In response to Xx Dark Wizard xX
Xx Dark Wizard xX wrote:
> turf
> town
> icon='town.dmi'
> Enter(mob/M)// checks to see if it is a mob
> if(ismob(M))// safety check
> if(M.client)// if it is a client
> M.loc = locate(22,22,4) // locates the player


Enter(mob/M) does not check to see if it is a mob. It just defines it as a mob regardless of what it might be. if(ismob(M)) checks if it is a mob.
In response to DeathAwaitsU
That didnt really explain anything to him;

There's 3 locations for every atom, x, y and z. x is the left/right position, y is the up/down position, and z is the map position. If you're using multiple maps, you give each map a different z level, so say you had 2 maps, the first one called "Town", and the second called "City". You'd set town's z level to 1, and the City z level to 2. Then, using the locate command (as demo'd in the previous posts) you'd locate the user at the required x/y/z coordinate.

In response to The Conjuror
The Conjuror wrote:
That didnt really explain anything to him;

I didn't reply to the person asking for help. I was correcting a mistake in Dark Wizard's post.
In response to The Conjuror
The Conjuror wrote:
That didnt really explain anything to him;

There's 3 locations for every atom, x, y and z. x is the left/right position, y is the up/down position, and z is the map position. If you're using multiple maps, you give each map a different z level, so say you had 2 maps, the first one called "Town", and the second called "City". You'd set town's z level to 1, and the City z level to 2. Then, using the locate command (as demo'd in the previous posts) you'd locate the user at the required x/y/z coordinate.

Thanks man this helped and for dark that helped and thanks death4u cuz u corrected him, I see now.
You probably want to use the <code>Move()</code> proc rather than setting <code>loc</code> directly. Doing so will allow the default checks - like rejecting movement if the target turf is dense, or someone is already standing there - to continue.