ID:156912
 
I am currently making a MUD, using the map maker in dream maker and use turfs to control exits and areas to control descriptions and else..

stuck at figuring out how to get it to display the areas description when you enter the turf...

Also if you see errors in my code.. Please explain.. It al works properly.. just dont know how to get area var to display see how I am using turf to enter already. and when I add Enter to Area it doesnt let me move into any spaces.

turf
var
list/Exits // Exit list
list/Enters // Enter list

Exit(atom/M)
if(src.Exits.len<=0)
..()
else
if(src.Exits.Find(usr.dir))
return ..()
else
..()
Enter(atom/M)
if(src.Enters.len<=0)
..()
else
if(src.Enters.Find(usr.dir))
return ..()
else
..()
//----
ZEROExit
icon = 'Rooms.dmi'
icon_state = "noexit"
Exits = list()
Enters = list()
//------
North
NExit
icon = 'Rooms.dmi'
icon_state = "n"
Exits = list(NORTH)
Enters = list(SOUTH)
NandEExit
icon = 'Rooms.dmi'
icon_state = "n and e"
Exits = list(NORTH, EAST)
Enters = list(SOUTH, WEST)
NandWExit
icon = 'Rooms.dmi'
icon_state = "n and w"
Exits = list(NORTH, WEST)
Enters = list(SOUTH, EAST)
NandSExit
icon = 'Rooms.dmi'
icon_state = "n and s"
Exits = list(NORTH, SOUTH)
Enters = list(NORTH, SOUTH)
NorthSouth
NandSandE
icon = 'Rooms.dmi'
icon_state = "n and s and e"
Exits = list(NORTH, SOUTH, EAST)
Enters = list(NORTH, SOUTH, WEST)
NandSandW
icon = 'Rooms.dmi'
icon_state = "n and s and w"
Exits = list(NORTH, SOUTH, WEST)
Enters = list(NORTH, SOUTH, EAST)
South
SExit
icon = 'Rooms.dmi'
icon_state = "s"
Exits = list(SOUTH)
Enters = list(NORTH)
SandEExit
icon = 'Rooms.dmi'
icon_state = "s and e"
Exits = list(SOUTH, EAST)
Enters = list(NORTH, WEST)
SandWExit
icon = 'Rooms.dmi'
icon_state = "s and w"
Exits = list(SOUTH, WEST)
Enters = list(NORTH, EAST)
SandNSExit
icon = 'Rooms.dmi'
icon_state = "n and s"
Exits = list(NORTH, SOUTH)
Enters = list(NORTH, SOUTH)
EastandWest
EExit
icon = 'Rooms.dmi'
icon_state = "e"
Exits = list(EAST)
Enters = list(WEST)
WExit
icon = 'Rooms.dmi'
icon_state = "w"
Exits = list(WEST)
Enters = list(EAST)
WandEExit
icon = 'Rooms.dmi'
icon_state = "e and w"
Exits = list(WEST, EAST)
Enters = list(EAST, WEST)
WandEandSExit
icon = 'Rooms.dmi'
icon_state = "e and w and s"
Exits = list(WEST, EAST, SOUTH)
Enters = list(EAST, WEST, NORTH)
WandEandNExit
icon = 'Rooms.dmi'
icon_state = "e and w and n"
Exits = list(WEST, EAST, NORTH)
Enters = list(EAST, WEST, SOUTH)
ALL
icon = 'Rooms.dmi'
icon_state = "all"
Exits = list(NORTH, SOUTH, EAST, WEST)
Enters = list(NORTH, SOUTH, EAST, WEST)


AREAS

area
var/description = "BASICS!"

ShintolTemple
Hallway
name = "Shintol Temple Hallway"
description = "Your in the Hallway of the Shintol Temple."
turf.loc is usually an area, I think.
In response to Kaiochao
Got it .. Thanks for help
In response to V3RR3Z
So another question..
area
icon = 'Rooms.dmi'
icon_state = "UnusedArea"
invisibility = 9
layer = OBJ_LAYER +1
var/description = "BASICS!"
Entered(var/mob/M)
if(istype(M))
usr << "<font color = white>[name]"
usr << "<font color = white>[description]"
usr << "<font color = white>[Exits]"
else
return 1

turf
var
list/Exits // Exit list
list/Enters // Enter list

Exit(atom/M)
if(src.Exits.len<=0)
..()
else
if(src.Exits.Find(usr.dir))
return ..()
else
..()
Enter(atom/M)
if(src.Enters.len<=0)
..()
else
if(src.Enters.Find(usr.dir))
return ..()
else
..()
//----
ZEROExit
icon = 'Rooms.dmi'
icon_state = "noexit"
Exits = list()
Enters = list()
//------
North
NExit
icon = 'Rooms.dmi'
icon_state = "n"
Exits = list(NORTH)
Enters = list(SOUTH)


How do I get the
usr << "<font color = white>[Exits]"
to actually output the Turf list Exits?
In response to V3RR3Z
You should not be using usr here, or in Enter() or Exit(). You should be using M instead.

The argument to Enter() and Exit() should also technically be atom/movable/M, not atom/M, though that's not causing any issues at the moment.

If you want to block movement in Exit() or Enter(), put "return 0", not just "..()".

To display a list, you'll need to loop through it. So, something like:

if(Exits.len)
M << "Exits are: [Exits[1]]\..."
for(var/v = 2 to Exits.len)
M << ", [Exits[v]]\..."
M << ""
In response to Garthor
Switched the other stuff but.. mind showing me in my code or similar code.. where to put that information?
In response to V3RR3Z
Still not sure how to show list or the turfs Exits through area entered proc....

and and all help appreciated.
In response to V3RR3Z