ANSI Color Code Locations

Posted by MattWall on Fri 03 Jan 2003 02:19 PM — 6 posts, 20,375 views.

#0
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
Australia Forum Administrator #1
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.
#2
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
#3
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.
Australia Forum Administrator #4
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.

#5
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