I tried this code (adapdted from a demo):
mob/var/obj/radar // This client var will point to the radar object on the player's screen (handy because we'll need to reference to it later!)
client/New()
var/obj/O = new // This code creates the radar object and places it on the client's screen. Note how the object 'follows' the mob around as he moves. This is because the object is 'attached' to the client screen.
O.icon = 'Radar.dmi'
O.icon_state = "Radar"
O.screen_loc = "10,10"
src.screen += O
src.radar = O
..()
proc/Update_Radar()
for(var/mob/M in world)
if(M.radar)
M.radar.overlays.Cut() // Clear the radar of existing blips
var/obj/I = new
I.icon = 'Radar.dmi' // Put a white cross-ish obj at the centre to get a better idea of distance ingame
I.icon_state = "Self"
M.radar.overlays += I // Add the white cross-ish image to the radar's overlays
for(var/mob/O in world) // Search through all of the mobs...
if(get_dist(O.mob,M) < 40 && O.mob.z == M.z && O.mob != M) // If the mob is within 10 squares of the player, is on the same z level, and isn't itself (don't want to place yourself on it, do you?)
I = new
I.icon = 'Radar.dmi' // Create our new blip for the mob found
if(O.client==1)
I.icon_state = "Player"
if(/mob/monster)
I.icon_state = "Hostile"
if(/mob/monster)
if(O.client !=1)
I.icon_state = "Freindly"
I.pixel_x = -(O.mob.x - M.x)*4 // Remove the comments on the *2 to modify the range/spacing of the blips
I.pixel_y = -(O.mob.y - M.y)*4
M.radar.overlays += I
spawn(7)
Update_Radar()
But it will be obvious to you that I got lots of errors. 7 exacty:
Radar.dm:22:error:O.mob:undefined var
Radar.dm:22:error:O.mob.z:undefined var
Radar.dm:22:error:O.mob:undefined var
Radar.dm:27:error:/mob/monster:undefined type path
Radar.dm:29:error:/mob/monster:undefined type path
Radar.dm:32:error:O.mob.x:undefined var
Radar.dm:33:error:O.mob.y:undefined var
Zeta.dmb - 7 errors, 0 warnings (double-click on an error to jump to it)
How can I fix this?
~GokuSS4Neo~
P.S.THANK YOU VERY MUCH FOR YOUR TIME AND HELP!