proc
radarupdate()
for(var/obj/HUD/Pointer/O in world) //delete every pointer object in the world.
del O
for(var/mob/M in world) // I've tried range(radarrange,M) for this instead of world. It made the radar behave very wierdly.
if(!M.client) continue
for(var/mob/N in world)//range( radarrange ,M))
if(N.z != M.z) continue//Checks Z layer.
if(N == M) continue
//if(N.team != M.team) continue //uncomment this line to make enemies NOT show up on radars
var/r = ((((N.x - M.x)**2)+((N.y - M.y)**2))**0.5) // This nasty piece is the distance formula. It gives me the distance between the two mobs.
if(round(r) > radarrange) continue// I use the distance and make sure it isn't more than 16 units away
var/obj/HUD/Pointer/O = new()
var/x = (N.x - M.x) * round(48/round(radarrange))
var/y = (N.y - M.y) * round(48/round(radarrange))
M.client.screen += O
O.icon_state = "ally"
O.pixel_x = x
O.pixel_y = y
O.screen_loc = "WEST+1:[O.pixel_x],NORTH-1:[O.pixel_y]" // This part just makes the pointers move around on all 9 tiles of the radar
if(get_dir(M,N) == NORTHEAST)
O.pixel_x -= 32
O.pixel_y -= 32
O.screen_loc = "WEST+2:[O.pixel_x],NORTH:[O.pixel_y]"
if(get_dir(M,N) == SOUTHWEST)
O.pixel_x += 32
O.pixel_y += 32
O.screen_loc = "WEST:[O.pixel_x],NORTH-2:[O.pixel_y]"
if(get_dir(M,N) == SOUTHEAST)
O.pixel_x -= 32
O.pixel_y += 32
O.screen_loc = "WEST+2:[O.pixel_x],NORTH-2:[O.pixel_y]"
if(get_dir(M,N) == NORTHWEST)
O.pixel_x += 32
O.pixel_y -= 32
O.screen_loc = "WEST:[O.pixel_x],NORTH:[O.pixel_y]"
if(get_dir(M,N) == NORTH)
O.pixel_y -= 32
O.screen_loc = "WEST+1:[O.pixel_x],NORTH:[O.pixel_y]"
if(get_dir(M,N) == SOUTH)
O.pixel_y += 32
O.screen_loc = "WEST+1:[O.pixel_x],NORTH-2:[O.pixel_y]"
if(get_dir(M,N) == WEST)
O.pixel_x += 32
O.screen_loc = "WEST:[O.pixel_x],NORTH-1:[O.pixel_y]"
if(get_dir(M,N) == EAST)
O.pixel_x -= 160
O.screen_loc = "WEST+2:[O.pixel_x],NORTH-1:[O.pixel_y]"
spawn(radarupdate) radarupdate() //restart the loop!
Problem description:
I know this problem is it shows all mobs in the world on the radar..., But this is not a Radar For the mobs This is a Dragonball Radar.
need this
for(var/mob/M in world)
replaced with this
for(var/dragonballs/earth/A in world)
so it only displays the dragon balls and not the mobs.
--
and also need the whole circomferance start point from center to side at (7,9) on the map this is extra i would be greatfull if you could help with this one as well thx alot.
thank you.
for(var/dragonballs/earth/A in world)
Replace that and try this.
for(var/obj/dragonballs/earth/A in world)
the dragon balls are an object right?