color: set_pager_color, &c, or ^[[33m ?

Posted by Sylaer on Wed 10 May 2006 05:04 PM — 5 posts, 21,575 views.

#0
I was hoping to change the colors used in the Practice List, but realized I don't know the best way to output them within functions.
I looked into set_pager_color, but all my experiments with this suggest that only one pager color can be set per function. Is this true? --- eg: set_pager_color at_yellow, send_to_pager"Nya", set_pager_color at_magic, send_to_pager"Hah" both output the same color for me, and not always the first one.

Then I found &c and &d used to change colors in the prac list already, but I can't find a chart of what they refer to. Are they variables or color codes?
Some mud clients allow players to change colors that are output to them- they can replace all instances of one color from the mud with their own, so I'm guessing there's some kind of color regulation that I should be using.
Most importantly, I want the color codes that I use when I DO discover them to be affected by a player's choice of ansi on or off. So that if they turn ansi off, they won't get garbage-looking color codes written to their screen. So what's the best way to change colors written to the player, with these things in mind?
USA #1
You may want to stick to using/adding custom colors (there are 4 different practice custom colors used, prac to prac4). That way, players can change the colors through the MUD.

Quote:
Most importantly, I want the color codes that I use when I DO discover them to be affected by a player's choice of ansi on or off. So that if they turn ansi off, they won't get garbage-looking color codes written to their screen. So what's the best way to change colors written to the player, with these things in mind?

As long as you use Smaug's color codes (&C etc) and not hardcode ANSI then when they turn off color through the MUD it will never display "garbage-looking" color codes.
#2
There's already a line in the prac list that looks like it's supposed to change the output color depending on the practice % learned. It's something like this:

++cnt;
     set_pager_color( AT_MAGIC, ch );
     pager_printf_color( ch, "%20.20s", skill_table[sn]->name );
     if( ch->pcdata->learned[sn] > 75 )
         set_pager_color...


but like I said before, set_page_color never seems to change the output color more than once.
Tried using at_prac2 etc, but the output always remained at_magic. Could you give an example of the FUSS way to change pager color twice on the same line?
Amended on Wed 10 May 2006 11:36 PM by Sylaer
USA #3
This isn't setting the color on the player, rather displaying the color in the text:

pager_printf_color( ch, "&[prac]%s &[prac2]%s", name, race );


It sets the first variable to the players prac color, then the second variable to the players prac2 color.
Amended on Thu 11 May 2006 12:42 AM by Zeno
USA #4
That's cool Zeno, I think I'd read about doing that once before, but I'd entirely forgotten that we could do that. Thanks for the reminder! :)

(Oh, and the &c &d type stuff are smaug color codes, they're referenced under help pcolors.)