Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ color: set_pager_color, &c, or ^[[33m ?

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

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Sylaer   (20 posts)  Bio
Date Wed 10 May 2006 05:04 PM (UTC)
Message
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?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Wed 10 May 2006 05:08 PM (UTC)
Message
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.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Sylaer   (20 posts)  Bio
Date Reply #2 on Wed 10 May 2006 11:34 PM (UTC)

Amended on Wed 10 May 2006 11:36 PM (UTC) by Sylaer

Message
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?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Wed 10 May 2006 11:54 PM (UTC)

Amended on Thu 11 May 2006 12:42 AM (UTC) by Zeno

Message
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.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #4 on Thu 11 May 2006 08:10 AM (UTC)
Message
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.)

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


19,488 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.