How do I format a player list?
The way to do this is to edit your 'conformat' attribute on your room parent. You set this object by using @conformat <room parent>=<code>
. You can do it in different ways, but I'll show you a basic way to do it now.
You'll want to use iter(), lcon(), and a few other bits of a code. So you may want to read their help files if you plan to customize. (help lcon, help iter).
So first we need to build a list of players in the room so we start with:
lcon(%!) --> #42 #459 #79 #2526 #1127 #1186 #960 #12
Are all of those players? Also what are their names?
Here is where iter() comes in. We're going to put that list through an iter to give us the name of the objects in the room.
iter(lcon(%!), name(%i0), ,%,%b) --> Cobalt, Official, Census, Tributary, Locus: Parent Object, Nuker Object <NO>, Richard Doll, Demon Eightball, Grey
Okay so first of all those aren't all players, and they aren't all connected -- are they? The fix for that is to change the lcon() a little like this:
iter(lcon(%!, player), name(%i0), ,%,%b) --> Cobalt, Tributary, Grey
Now those are all the players in that room -- but Tributary and Grey are not connected. Do you want them still listed but marked as offline somehow? Or do you want them not listed? I'll show you how to do the latter first because it's easier. Once more we just change the lcon().
iter(lcon(%!, connect), name(%i0), ,%,%b) --> Cobalt
Now what if you want to have offline players listed, but noted as offline? Perhaps have their names greyed out or have a little asterisk by their name or something? This is a little complicated as you're going to have to check and see if the players have the 'connect' flag that tells the game if they are online at the time. And you'll need to to tell the code what to do if they do or don't, so we'll be using 'if()'.
iter(lcon(%!, player), if(hasflag(%i0, connect), name(%i0), ansi(hx, %([name(%i0)]%))), ,%,%b) --> Cobalt, (Tributary), (Grey)
(Where Tributary and Grey are grayed out (I put the %( %) around the name() so you could see it on the board.)
Now how do you put that in your room parent? Simple!
@conformat #25=[iter(lcon(%!, player), if(hasflag(%i0, connect), name(%i0), ansi(hx, %([name(%i0)]%))), ,%,%b)]
Or
@conformat #25=%r%r[iter(lcon(%!, connect), name(%i0), ,%,%b)]
If you want you can set an 'itemize()' around the outside of your code and it'll make it so that an 'and' is thrown in after the last item (and a coma between each item if you delimit your list differently, technically). To do that you would do:
@conformat #25=%r%r[itemize(iter(lcon(%!, player), if(hasflag(%i0, connect), name(%i0), ansi(hx, %([name(%i0)]%))), ,%,%b), %,%b)]
(Replacing #25 with the number of your roomparent of course. So so far our roomparent will look like this:
Conference Room(#80RI)
This is the stock room description. You may replace it using the command @desc here=. For this
build to be complete you must set @desc, @osucc, @odrop, and either @succ or @drop. Your exits
should be @desc'd with at least one or two words. And your description should start with %r%tand
have %r%r%t between each paragraph and end with %r.
Cobalt and (Wizard)
Obvious exits:
OOC Room <O>