world
New()
..()
OnlineList()
proc
OnlineList()
var/counter=0
for(var/mob/Player/M in world)
winset(M,"onlineusers","current-cell=[++counter]")
M << output("[M] ([M.key])","onlineusers")
spawn(10) OnlineList()
Problem description:
I'm very very new to this system and have seen no threads, no demos, and no libraries on these forums which breach this particular scenario, which makes me think doing this is either impossible, impractical, or so incredibly easy that I should feel dumber than a monkey for not understanding why this isn't working, despite being nearly copypasta from one of the "tutorial" threads that exist by Lummox JR.
All I want to do is have a grid called "onlineusers" in my game update every second on all players' screens with a list of all players who are currently logged in, with their name, key, and an icon view of their "avatar" (which I have not included here because god help me I can't even place simple text let alone images next to it).
I'm going to wind up needing similar things for other "lists" in my game that update every second (granted those will be for objects, not mobs), and I can't even get one to work right. Pls send help.
M << output("[M] ([M.key])","onlineusers")
Also, a new syntax has become available since Lummox JR's tutorials that lets you specify the cell in the output() command itself:
Once you've output the names, you'll want to update the cell count. The grid will automatically grow to fit whatever you output, but it won't shrink. So, if someone leaves and the list length decreases, the old names at the end of the list won't be cleared.
With those things taken into account, you get something like this:
Later on, especially if you're going to be outputting more lists like these, you might want to consider only updating them when someone joins/leaves the game, instead of every second.