ID:156103
 
I've created a DBFind() or Dragon Ball Finder procedure. I've started by getting the direction of the DB(Dragon Ball) from me, using get_dir(), but I can't seem to make it so, my pre-made direction pointer icons show up as an overlay to point out the direction to the nearest DB. So how would I go about doing so?

If you don't get it, let me rephrase the question:
(Assuming you've read the top, an know about all counterparts in this system)

How would I make my pointer icons show me which direction the nearest DB is in?

Text display of problem.

D = Dragon Ball
P = Player
<, >, ^, v = Direction Pointer Icons

-----
D <P
-----

-----
D

^
P
-----

I think you see what my problem is. Thanks for taking the time to read this. Much appreciated to whomever decides to help me out with this dilemma.
proc/DrawIndicator(atom/Target)
var/dir = get_dir(src, Target)
var/obj/indicator/A = new()
A.icon_state = dir // 1, 2, 4, 8 represents NORTH, SOUTH, EAST, and WEST respectively
switch(dir)
if(NORTH)
A.pixel_y = 32 // tempting to use pixel_z here
if(SOUTH)
A.pixel_y = -32
if(EAST)
A.pixel_x = 32
if(WEST)
A.pixel_x = -32
src.overlays += A
return A


Not sure if that will work, but I think you should get the general idea of what will work from that, I don't actually have Dream Maker to test this out in, and I'm going from memory. If you still need help, post whatever happens I suppose.

I'm sure there's a better way to deal with setting the pixel offsets besides what's there. I'm only giving you the idea here though. I'm also not sure how well this will react with diagonals either, so that could be an issue.

It also doesn't update in real time as you probably want it to.