ID:145196
 
Code:
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.
Curzon wrote:
Code:
> 
> 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?
In response to Vancegetto
Isn't this just a poorly modified demo? I'm pretty sure it explains pretty well in there how to modify it and what everything does.
In response to Vancegetto
the path i gave was correct already obj was not needed it wasnt listed in a path type as that.

but thx for tryin

Well, one thing that sort of jumps out at me is that you're using:

for(var/mob/M in world)
if(!M.client) continue
for(var/mob/N in world)


Now, the first line is fine, since M corresponds to mobs with connected clients (this proc appears to update all of the player's radars, not just an individual player). HOWEVER, the second for loop is checking for other mobs -- these are what show up on the radar. You'll want to change N to to match the object type of the dragon balls.
In response to Igmolicious
I actually did a pretty crappy job when I made that. >=)

There are quite a few improvements I have in mind for the demo, but that's for later.

There are a few things you'll need to do if you want to change the screenlocs. Screenlocs right now are hard coded (yuck!) into the radar update loop and into the radar piece objects themselves. You'll need to change them (tediously) to move the radar somewhere else. Have fun! >=)
In response to D4RK3 54B3R
lol well thx man =) hard enough but ill give it my best shot and thx for making it in this case works good sofar =)
In response to Igmolicious
alright ill give it a shot seems simple so i just put the path in for N hmm lets try it! =)
In response to D4RK3 54B3R
here is a picture of it sofar

http://img163.imageshack.us/img163/9671/scrnshot17yr.png

i couldnt put the radar into shame so i had to pimp it out =)
In response to Curzon
Heh I see a problem with it already. That icon you have for it is a little... bad. You're going to have the dragonballs showing up on the white parts of the radar, unless you change the radius (Hardcoded! Ouch! It's 48) of the radar.
In response to Curzon
yah i fixed this a while back bro ; lol like a week or 2 ago it's all good now thx for assistence yall