ID:165208
 
How do u make rooms or buildings or areas where you walk in and your in another map or something. like enter a door and your inside the building. Go through a gate at the edge of a map and your in a new map etc.
You make a turf like this:
        turf
Door
Enter()
usr.loc = locate(x,y,z)


You may wish to use Enter() and Entered() interchangeably.

Enter will do the action as a mob walks into the tile.
Entered will do it after the mob has

There are usually certain parametres coders set up, to prevent certain types of obj or mob being able to access the turf/door; this will to the basic job, and allow everything through...
In response to CuriousNeptune
CuriousNeptune wrote:
You may wish to use Enter() and Entered() interchangeably.

No. This is bad practice. Enter() and Exit() should ONLY be used simply for it's original purpose - determining whether movement should be allowed or not, by returning 1 or 0 - no actual other actions should be done there. That's what Entered() and Exited() are for.
In response to CuriousNeptune
Thanks for the help but will this still work:
turf
Door
icon = 'door.dmi'
Enter()
usr.loc = locate(x,y,z)


will i have to specify the new location(x,y,z)?
In response to Jiraiya999
Jiraiya999 wrote:
Thanks for the help but will this still work:
> turf
> Door
> icon = 'door.dmi'
> Enter()
> usr.loc = locate(x,y,z)
>

will i have to specify the new location(x,y,z)?


Forgot to have icon in right spot.
In response to Jiraiya999
Just edit your post next time.

No, it won't work properly.
First of all, as I said, use Entered(), not Enter().
Also, don't use 'usr'. It isn't always valid - instead, use the proc's first argument. Look Entered() up in the DM Reference for more info, it shows examples of using it.
In response to Jiraiya999
Jiraiya999 wrote:
Jiraiya999 wrote:
Thanks for the help but will this still work:
> > turf
> > Door
> > icon = 'door.dmi'
> > Enter()
> > usr.loc = locate(x,y,z)
> >

will i have to specify the new location(x,y,z)?


Forgot to have icon in right spot.

 turf
Door
icon = 'door.dmi'
Entered()
usr.loc = locate(x,y,z)


Get it right mate.
In response to A.T.H.K
I'd preffer not using user to locate instead try using atom.
In response to Miran94
Eh? ahm...Actually, you need to use the proc's first argument.
Ok thanks for all the help but i dont really under stand much of what your talking about. I used the F1 thing but that didnt really help. So could someone give me a reference to where it is being used in actual coding or give the code. And how would you edit the new area where your mob would end up, because i only know how to edit a map with 1 "z".