ID:154738
 
I'm not much of a programmer, and my knowledge of how to code on Byond is extremely limited to the bare basics. I'm working on a project, but I'm interested in a specific verb that I have no idea how to go about creating. If anybody could lend a hand, thanks!

Basically what I'm looking to create is a verb that lets me go from, say, my Admin Commands panel to a verb called "Spy" or "Watch" that lets me stay in the place I'm currently standing, but then change my screen to the person that was named in a drop down list kind of thing. If possible, I'd like to be able to hear what the person is saying as well as the people around them, but that's only if it would be possible. Sorry if this is poorly worded or sounds confusing.

Thanks again!
I clobbered something together like this in the past:

mob
verb
Emote(T as text)
if(T)
if(!findtext(T, "'s", 1, 3))
T = " " + T

var
list/L = view(src)

L << "<font color = 'blue'>\icon[src][src][T]</font>"

talklog << "[src][T]"

for(var/client/C)
for(var/atom/movable/O in L)
if(C.eye == O && C.mob != O)
if(!(C.mob in L))
C.mob << "<font color = 'gray'>\icon[src][src][T]</font>"

Say(T as text)
if(T)
Emote("says: [T]")


admin // verb container datum
verb
GM_Watch(atom/movable/O in world)
set category = "Admin"

usr << "You watch [O]."

usr.client.eye = O


I can't guarentee any of this is efficient or right though but it works.
In response to LordAndrew
I think this is perfect, actually. Thanks a bunch! Is there a way I can make the little icon that appears in front of the emote text to be automatically set at 32x32? It appears as a miniature stretched version whenever I run it.
In response to ZaibTrain
Oh right, sorry. The game in question this came from used 16x16 graphics that were manually upscaled, so the icons looked clear and crisp in chat.

There is a way to modify the size according to the reference page on the \icon macro, but I've never done it.