ID:165411
 
Lately i've been thinking of adding a multi-tiled HUD where it shows the map for 12 tiles away with a pixel in the place of a turf on the map how would i do that where it finds the turf(i'm thinking of having a var to check it and see in 12 tiles) and then the part that stumps me was how to determine where to place it and how to place it on that location. I've looked at demos but can't find anything. If people could help by supplying code snippets that would be great.
I'll just paste what I found to be good.
Could probably do with improvements.
obj
minimap
invisibility=1
layer=999
icon='minimap.dmi'
pointer
icon_state="marker"
layer=1000
New(client/C)
screen_loc="NORTH-3,WEST+1"
C.screen+=src
minimap01
icon_state="0,1"
New(client/C)
screen_loc="NORTH-3,WEST+1"
C.screen+=src
minimap02
icon_state="0,2"
New(client/C)
screen_loc="NORTH-3,WEST+2"
C.screen+=src
minimap03
icon_state="0,3"
New(client/C)
screen_loc="NORTH-3,WEST+3"
C.screen+=src
minimap04
icon_state="0,4"
New(client/C)
screen_loc="NORTH-3,WEST+4"
C.screen+=src
minimap11
icon_state="1,1"
New(client/C)
screen_loc="NORTH-2,WEST+1"
C.screen+=src
minimap12
icon_state="1,2"
New(client/C)
screen_loc="NORTH-2,WEST+2"
C.screen+=src
minimap13
icon_state="1,3"
New(client/C)
screen_loc="NORTH-2,WEST+3"
C.screen+=src
minimap14
icon_state="1,4"
New(client/C)
screen_loc="NORTH-2,WEST+4"
C.screen+=src
minimap21
icon_state="2,1"
New(client/C)
screen_loc="NORTH-1,WEST+1"
C.screen+=src
minimap22
icon_state="2,2"
New(client/C)
screen_loc="NORTH-1,WEST+2"
C.screen+=src
minimap23
icon_state="2,3"
New(client/C)
screen_loc="NORTH-1,WEST+3"
C.screen+=src
minimap24
icon_state="2,4"
New(client/C)
screen_loc="NORTH-1,WEST+4"
C.screen+=src
minimap31
icon_state="3,1"
New(client/C)
screen_loc="NORTH,WEST+1"
C.screen+=src
minimap32
icon_state="3,2"
New(client/C)
screen_loc="NORTH,WEST+2"
C.screen+=src
minimap33
icon_state="3,3"
New(client/C)
screen_loc="NORTH,WEST+3"
C.screen+=src
minimap34
icon_state="3,4"
New(client/C)
screen_loc="NORTH,WEST+4"
C.screen+=src


run this next bit when a player logs in or something (it refreshes the pointer)

mob/proc
RefreshVisuals()
if(src.mapon&&src.z==1&&src.y<=400)
for(var/obj/minimap/M in src.client.screen)
M.invisibility=0
for(var/obj/minimap/pointer/P in src.client.screen)
P.pixel_y=1/4*src.y+1.3
P.pixel_x=1/4*src.x+1
P.screen_loc="WEST+1:[P.pixel_x],NORTH-3:[P.pixel_y]"
else
for(var/obj/minimap/M in src.client.screen)
M.invisibility=1
spawn(10)
RefreshVisuals()

heres the visibility toggle
        MinimapToggle()
set name="Minimap On/Off"
set desc="Turn the Earth Minimap On/Off"
if(usr.mapon)
for(var/obj/minimap/M in usr.client.screen)
M.invisibility=1
usr.mapon=0
usr<<"<font color=silver size=1>Minimap Off</font>"
else
for(var/obj/minimap/M in usr.client.screen)
M.invisibility=0
usr.mapon=1
usr<<"<font color=silver size=1>Minimap On</font>"


create the objs
client/New()

new/obj/minimap/minimap34(src)
new/obj/minimap/minimap33(src)
new/obj/minimap/minimap32(src)
new/obj/minimap/minimap31(src)
new/obj/minimap/minimap24(src)
new/obj/minimap/minimap23(src)
new/obj/minimap/minimap22(src)
new/obj/minimap/minimap21(src)
new/obj/minimap/minimap14(src)
new/obj/minimap/minimap13(src)
new/obj/minimap/minimap12(src)
new/obj/minimap/minimap11(src)
new/obj/minimap/minimap04(src)
new/obj/minimap/minimap03(src)
new/obj/minimap/minimap02(src)
new/obj/minimap/minimap01(src)
new/obj/minimap/pointer(src)
..()



And I think thats all.... Sorry about the out of order-ness.

I've also made a 4-tile radar display to be used as a dragon radar ^_^ im not making dbz game anymore though O.o
Who wants it?
In response to CuriousNeptune
Holy crap. If you was a BYONDscape subscriber, I would say you are the dumbest piece of #$@! I ever knew.


But you ain't so I can't blame for you for the bad code you copied and pasted. There is a much smaller code, but you have to pay for it.