mob/npc/var/target = 0
var/mob/npc/last_target = new()
var/mob/npc/same_target = new()
mob/npc
DblClick()
if(last_target)
if(src.target)
src.overlays -= image('blinking_cursor.dmi')
usr << "[src] [src.target] [last_target.target]" //debuging code
usr << "<font color =red>[src] is no longer your target.</font>"
src.target = 0
usr << "[src] [src.target] [last_target.target]"
return
else
last_target.overlays -= image('blinking_cursor.dmi')
last_target.target = 0
src.overlays += image('blinking_cursor.dmi')
last_target = src
src.target = 1
usr << "[src] [src.target] [last_target.target]"
usr << "<font color =red><strike>[src]</strike> has been set to your target.</font>"
else
src.overlays += image('blinking_cursor.dmi')
last_target = src
src.target = 1
usr << "[src] [src.target] [last_target.target]"
usr << "<font color =red><strike>[src]</strike> has been set to your target.</font>"
..()
Problem description:Ok, first off, everything works fine with this code. There is nothing wrong with it at all. The point of this question however is how do I make it so that the target and the icon overlays is only visible to the client.screen, meaning only visible to the player and not the world?
<font size=1>
Instead of client.screen, you want to use images (Make sure you read about the arguments /image has.
it should be straight foward of how to use images to show only to the user but if you want, you can check out my demos on them .
(To see if it actually does only show to one player, host the game locally and join it with another key. What one will see the other won't (or it'll be different))</font>
- GhostAnime