mob/proc/ShowMap(R=11)
var/TopLeftX = x - R
var/TopLeftY = y + R /2
var/LowRightX = x + R
var/LowRightY = y - R /2
var/buf = ""
for(var/Ye = TopLeftY, Ye >= LowRightY, Ye--)
for(var/Ex = TopLeftX, Ex <= LowRightX, Ex++)
var/turf/T = locate(Ex,Ye,z)
var/mob/M = locate() in T
if(M)
buf += "[usr.symbol]"
if(T)
buf += T.symbol
buf += "\n"
src << mb_msgout(buf)
The only problem I'm having with this is that I can't figure out how to get it to not include that one turf, I'v tried various ways of subtracting the turf in the users coordinates but all have failed. Any help is much appreciated.
mb_msgout() Is just a part of Ebonshadow's library for displaying colors in telnet and BYOND clients. The symbol variable is obviously that turf/mob's designated symbol to display.
Here is an example of the problem in displaying.
^~~~~~~~~~~############
~~~~~~~~~~~############
#########^~############
#########^~############
#########^~############
^^^^^^^^^^~@############ <--- right here is the line that
~~~~~~~~~~~~~~~~~~~~~~~ shows the mobile, and also
#########~######^^^^^^^ where the output displaces in
^^^^#####~######^^^^^^^ showing the turf that would be
~~~^#####~######^^^^^^^ under the mobile.(the @ symbol ##~######~######^^^^^^^ is the current user.)
##~######~######^^^^^^^
If what i gathered is right, the if statements are causing the problem. What you have now is, if there is a mob in the current turf, display the mob symbol, and also print out the turf symbol aswell.
What you want to do is to change that 'if(T)' to an else, hence making it, if there is a mob in the current turf, display the mob symbol, else, print out the turf symbol.
eg