ID:155178
 
Hi all I am in the process of creating a MUD. I am using a map system. My problem is that it doesn't bring up the name and desc of the area when I enter it. It just brings up "turf" as the name.Here is the related code:

area
icon = 'Map Turf.dmi'
portal
icon_state = "portal"
name = "Far Glenn Portal"
desc = "This is the Far Glenn portal. When you die or are teleported, you will end up at the closest portal."

mob

Move(var/area/A)
usr << "<font color=blue><b>[A.name]</b></font>"
usr << "<font color=blue><i>[A.desc]</i></font>"
..()


verb
n(var/area/A)
Move(locate(x+0,y+1,z+0))
s(var/area/A)
Move(locate(x+0,y-1,z+0))
e(var/area/A)
Move(locate(x+1,y+0,z+0))
w(var/area/A)
Move(locate(x-1,y+0,z+0))

/* Problem: When I enter an area, it brings up "turf" instead of name and description of the area. */


please could someone help me with this
I think the Entered() proc fits for that.
area
Entered(M,area/A)
M << "<font color=blue><b>[A.name]</b></font>"
M << "<font color=blue><i>[A.desc]</i></font>"
..()
In response to Raimo
Why not just use src?
In response to Raimo
Thanks for your help.

Edit: I tried using the Entered() proc and it still doesn't want to work. Any ideas?
In response to Saladon
It didn't work because the argument were used incorrectly. With the exception of verbs, DM doesn't filter/give you the information you told what you want. If you look up the argument passed by DM for Entered(), it'll tell you that it only passes the object references that successfully entered.

Entered(mob/A)
world << "[A.type] entered!"
A here is not necessarily a /mob! It can be an /obj and other datum as well!!

What you want to do is (make sure A is a mob via ismob() then) output to A the descriotion using src.
 A << "This is [src.name]!"


src is the SOURCE of the procedure/verb. Since you are defining Entered() on an area/portal, then the src would refer to the /area/portal that the object Entered().