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
➜ ANSI Color Code Locations
|
ANSI Color Code Locations
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| MattWall
(9 posts) Bio
|
| Date
| Fri 03 Jan 2003 02:19 PM (UTC) |
| Message
| Hello everyone,
I am sorry to say that I have another question. Well here goes,
** Question - ANSI Color Codes Location **
Does anyone know where the in the mud code it assigns the colors to the deferent parts of the room description. As I wish to change the colors that it uses, as well, I can't see them. Moreover I don't want my users to have to change the color settings on their clients. I would like to set it right at the server. Thanks for lessening, I hope that you can help.
Regards, Matt Wall | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Fri 03 Jan 2003 08:50 PM (UTC) |
| Message
| Take a look at the code in do_look (act_info.c). Here is an example:
if ( !IS_NPC(ch)
&& !xIS_SET(ch->act, PLR_HOLYLIGHT)
&& !IS_AFFECTED(ch, AFF_TRUESIGHT)
&& room_is_dark( ch->in_room ) )
{
set_char_color( AT_DGREY, ch );
send_to_char( "It is pitch black ... \n\r", ch );
show_char_to_char( ch->in_room->first_person, ch );
return;
}
As you can see a dark room is down in DGREY colour. Later on I see this:
if ( IS_SET( pexit->exit_info, EX_BASHED ) )
act(AT_RED, "The $d has been bashed from its hinges!",ch,
NULL, pexit->keyword, TO_CHAR);
So, this description will be in red.
Basically you need to search for (using grep for instance) things like "set_char_color" and "act" and change the colours for each case.
This may take a while. I see that there are 504 instances of "set_char_color", 1721 instance of "act", 87 instances of "send_to_char_color". and 136 instances of "ch_printf_color". There may be other places too where colours are set. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| MattWall
(9 posts) Bio
|
| Date
| Reply #2 on Fri 03 Jan 2003 11:11 PM (UTC) |
| Message
| Thanks Nick for the help!
I was wondering, in my mind, and this is something that I have seen in the past, the actual color code for say RED is 9905 and somewhere in the code this is defined as being so.
Int red = 9905
So I assumed that there would be a file that contained all the color blend codes associated with the words. Thus if I wanted a quick fix I would just change the color of read, to say weight. And wherever red is loaded it will be white. I know it’s a bodge, but its quick ;)
Thanks again for all your help, very good of you!
Regards Matt
| | Top |
|
| Posted by
| MattWall
(9 posts) Bio
|
| Date
| Reply #3 on Fri 03 Jan 2003 11:25 PM (UTC) |
| Message
| Most of all I want to change the defult colors of Dark Dlue/Red into brights or white.
Plus the defult color of green would be good as white. Thats must be one line of code. If text has no other flags then make it green.
Thanks. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #4 on Fri 03 Jan 2003 11:39 PM (UTC) |
| Message
| There is a file in the SMAUG system directory, colors.dat, that may do that, if you just want to make bulk changes.
Also, see mud.h which defines things like AT_DGREY.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| MattWall
(9 posts) Bio
|
| Date
| Reply #5 on Fri 03 Jan 2003 11:54 PM (UTC) Amended on Fri 03 Jan 2003 11:56 PM (UTC) by MattWall
|
| Message
| Ah HA! Thats the one Nick, thank you very much.
*color.dat*
1024 plain~ 7
1025 action~ 7
1026 say~ 14
1027 gossip~ 14
1028 yell~ 15
1029 tell~ 15
Thank you once again.
Regards Matt | | 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,372 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top