ID:268029
 
I know theres a way to do this, Ive seen it in games where the player moves around in a text based map.. heres a link, how would I do this?http://www.ashavar.com/client/images/screen10.jpg
NOTE: I am running byond though telenet
Kasumi Tomonari wrote:
I know theres a way to do this, Ive seen it in games where the player moves around in a text based map.. heres a link, how would I do this?http://www.ashavar.com/client/images/screen10.jpg
NOTE: I am running byond though telenet

If I understand you right, you want a non-DS based text map ?

This is the procedure for doing said action on my MUD, relatively unmodified. I removed the section that displays the players standing in the same turf as you. It assumes your text map is a map of turfs. All the {x (where x is a letter) are color changes, translated into telnet color escape codes. It's pretty self explanatory.

To summarize it, it involves going through the turfs one by one and adding them to a "buffer". The buffer scans left to right, top to bottom. When it reaches the end of a row, it appends a \n and continues to the next row. That's all there really is to it.

player
proc
ViewMap(R=view_range)
var/turf/Standing = src.loc
if(!isturf(Standing)) return 0

if(R < 1) R=1
if(R > 50) R = 50

var/list/buffer = list()
var/tempbuffer = ""
var/atom/A
var/TopLeftX = x - R
var/TopLeftY = y + R
var/LowRightX = x + R
var/LowRightY = y - R

if(TopLeftX < 1) TopLeftX=1
if(TopLeftY > world.maxy) TopLeftY = world.maxy
if(LowRightX > world.maxx) LowRightX = world.maxx
if(LowRightY < 1) LowRightY = 1

buffer += "\[[Standing.name]] ([Standing.x],[Standing.y],[Standing.z])"

for(var/Ye = TopLeftY, Ye >= LowRightY, Ye--)
for(var/Ex = TopLeftX, Ex <= LowRightX, Ex++)
var/turf/RealTurf = locate(Ex,Ye,z)
var/display = "[RealTurf.text]"
var/atom/highest_layer

for(A in RealTurf.contents)
if(A.ascii_layer > highest_layer.ascii_layer)
highest_layer = A

display = "[highest_layer.ascii_color][highest_layer.ascii_icon]{g"
tempbuffer += display
continue
buffer += tempbuffer
tempbuffer = ""
continue

if(Standing.desc) buffer += Standing.desc


var/dirs = ""

if(isturf(locate(x,y+1,z)))
dirs += " North"
if(isturf(locate(x-1,y,z)))
dirs += " West"
if(isturf(locate(x,y-1,z)))
dirs += " South"
if(isturf(locate(x+1,y,z)))
dirs += " East"

if(dirs)
buffer += "\n{z\[{rExits{Z:{g[dirs]\]"

else if(!dirs)
buffer += "\n{z\[{rExits{Z:{gNone\]"

send(List2Text(buffer,"\n"),src,0)
return buffer
In response to Alathon
loading Neo Quest Text MUD.dme
Map.dm:3:error:view_range:undefined var
Map.dm:62:error:List2Text:undefined proc
Map.dm:62:error:send:undefined proc
Map.dm:32:error:A.ascii_layer:undefined var
Map.dm:32:error:highest_layer.ascii_layer:undefined var
Map.dm:35:error:highest_layer.ascii_color:undefined var
Map.dm:35:error:highest_layer.ascii_icon:undefined var
Map.dm:29:highest_layer :warning: variable defined but not used

Neo Quest Text MUD.dmb - 7 errors, 1 warning (double-click on an error to jump to it)
In response to Alathon
I'm thinking he simply wants to use the text mode for his map.
In response to Garthor
In telnet.
In response to Foomer
Foomer get on ya pager I wana show u my big update, and yes I want to just use the text map function, on telenet
In response to Kasumi Tomonari
by the way, Kasumi, I know this is a dumb correction, but I'm just feeling nitpicky. It's not "telenet", it's "telnet". Sorry, I couldn't resist :P
In response to Foomer
I didn't read his post after he edited it.