Welcome to the Builder Academy

Question Changing the color of room names to something unique?

More
12 Oct 2013 13:25 #4400 by dracmas
Thought I'd look at it as well. I wanted red room names insteaad of Cyan. So.

In act.informative.c in void look_at_room(struct char_data *ch, int ignore_brief)
Code:
if (IS_DARK(IN_ROOM(ch)) && !CAN_SEE_IN_DARK(ch)) { send_to_char(ch, "It is pitch black...\r\n"); return; } else if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT) { send_to_char(ch, "You see nothing but infinite darkness...\r\n"); return; } --send_to_char(ch, "%s", CCCYN(ch, C_NRM)); ++send_to_char(ch, "%s", CCRED(ch, C_NRM)); if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS)) { char buf[MAX_STRING_LENGTH]; sprintbitarray(ROOM_FLAGS(IN_ROOM(ch)), room_bits, RF_ARRAY_MAX, buf); send_to_char(ch, "[%5d] ", GET_ROOM_VNUM(IN_ROOM(ch))); send_to_char(ch, "%s [ %s] [ %s ]", world[IN_ROOM(ch)].name, buf, sector_types[world[IN_ROOM(ch)].sector_type]);
The following user(s) said Thank You: Parnassus

Please Log in or Create an account to join the conversation.

More
12 Oct 2013 18:04 #4402 by Parnassus
Thanks so much for that pointer. I cut and pasted the section but I didn't realize that CCNRM was the colour code. This is handy info for a non-coder like me who sometimes likes to make small cosmetic changes.

Please Log in or Create an account to join the conversation.

More
13 Oct 2013 01:21 #4403 by dracmas
I still don't get it quite myself. It just popped out at me while viewing the code. Can someone explain how the color codes are defined?

I figured out with CCCYN being swapped with CCRED but still don't have a clue about the process behind it.

Please Log in or Create an account to join the conversation.

More
13 Oct 2013 04:23 #4404 by Parnassus
I don't think I understand the question but I'm guessing that CC means color codes. I can see:
CCNRM
CCGRN
CCCYN
CCRED
CCYEL
CCWHT
but I see no Blue.

In oasis.c, I see
Code:
00065: /* Set the color string pointers for that which this char will see at color 00066: * level NRM. Changing the entries here will change the colour scheme 00067: * throughout the OLC. */ 00068: void get_char_colors(struct char_data *ch) 00069: { 00070: nrm = CCNRM(ch, C_NRM); 00071: grn = CCGRN(ch, C_NRM); 00072: cyn = CCCYN(ch, C_NRM); 00073: yel = CCYEL(ch, C_NRM); 00074: }
but I see no Red.

Please Log in or Create an account to join the conversation.

More
13 Oct 2013 15:34 #4405 by dracmas
Yeah thats kinda what I meant. The functions that tell what color is which and how it's set up.

Basically where is the code that says CCRED is actually red?
Just how its passed from the beginning to where we are now.
I've been using grep to look around but still don't know. If you
look through protocol.c as well you can see where some colors are defined, but
thats more in-game I think.

Main thing though. I would like to know where the color ansi code for CCRED/CCCYN ECT
is coming from. Kinda like the color code seen below, but for what we've been looking at.
Code:
/****************************************************************************** ANSI colour codes. ******************************************************************************/ static const char s_Clean [] = "\033[0;00m"; /* Remove colour */ static const char s_DarkBlack [] = "\033[0;30m"; /* Black foreground */ static const char s_DarkRed [] = "\033[0;31m"; /* Red foreground */ static const char s_DarkGreen [] = "\033[0;32m"; /* Green foreground */ static const char s_DarkYellow [] = "\033[0;33m"; /* Yellow foreground */ static const char s_DarkBlue [] = "\033[0;34m"; /* Blue foreground */ static const char s_DarkMagenta [] = "\033[0;35m"; /* Magenta foreground */ static const char s_DarkCyan [] = "\033[0;36m"; /* Cyan foreground */ static const char s_DarkWhite [] = "\033[0;37m"; /* White foreground */ static const char s_BoldBlack [] = "\033[1;30m"; /* Grey foreground */ static const char s_BoldRed [] = "\033[1;31m"; /* Bright red foreground */ static const char s_BoldGreen [] = "\033[1;32m"; /* Bright green foreground */ static const char s_BoldYellow [] = "\033[1;33m"; /* Bright yellow foreground */ static const char s_BoldBlue [] = "\033[1;34m"; /* Bright blue foreground */ static const char s_BoldMagenta [] = "\033[1;35m"; /* Bright magenta foreground */ static const char s_BoldCyan [] = "\033[1;36m"; /* Bright cyan foreground */ static const char s_BoldWhite [] = "\033[1;37m"; /* Bright white foreground */ static const char s_BackBlack [] = "\033[1;40m"; /* Black background */ static const char s_BackRed [] = "\033[1;41m"; /* Red background */ static const char s_BackGreen [] = "\033[1;42m"; /* Green background */ static const char s_BackYellow [] = "\033[1;43m"; /* Yellow background */ static const char s_BackBlue [] = "\033[1;44m"; /* Blue background */ static const char s_BackMagenta [] = "\033[1;45m"; /* Magenta background */ static const char s_BackCyan [] = "\033[1;46m"; /* Cyan background */ static const char s_BackWhite [] = "\033[1;47m"; /* White background */

and here
Code:
/* 1,2,3 to be used a MUD's base colour palette. Just to maintain * some sort of common colouring scheme amongst coders/builders */ case '1': pCopyFrom = ColourRGB(apDescriptor, RGBone); break; case '2': pCopyFrom = ColourRGB(apDescriptor, RGBtwo); break; case '3': pCopyFrom = ColourRGB(apDescriptor, RGBthree); break; case 'n': pCopyFrom = s_Clean; break; case 'd': /* dark grey / black */ pCopyFrom = ColourRGB(apDescriptor, "F000"); break; case 'D': /* light grey */ pCopyFrom = ColourRGB(apDescriptor, "F111"); break; case 'a': /* dark azure */ pCopyFrom = ColourRGB(apDescriptor, "F021"); break; case 'A': /* light Azure */ pCopyFrom = ColourRGB(apDescriptor, "F053"); break; case 'r': /* dark red */ pCopyFrom = ColourRGB(apDescriptor, "F200"); break; case 'R': /* light red */ pCopyFrom = ColourRGB(apDescriptor, "F500"); break; case 'g': /* dark green */ pCopyFrom = ColourRGB(apDescriptor, "F020"); break; case 'G': /* light green */ pCopyFrom = ColourRGB(apDescriptor, "F050"); break; case 'y': /* dark yellow */ pCopyFrom = ColourRGB(apDescriptor, "F330"); break; case 'Y': /* light yellow */ pCopyFrom = ColourRGB(apDescriptor, "F550"); break; case 'b': /* dark blue */ pCopyFrom = ColourRGB(apDescriptor, "F012"); break; case 'B': /* light blue */ pCopyFrom = ColourRGB(apDescriptor, "F025"); break; case 'm': /* dark magenta */ pCopyFrom = ColourRGB(apDescriptor, "F202"); break; case 'M': /* light magenta */ pCopyFrom = ColourRGB(apDescriptor, "F505"); break; case 'c': /* dark cyan */ pCopyFrom = ColourRGB(apDescriptor, "F022"); break; case 'C': /* light cyan */ pCopyFrom = ColourRGB(apDescriptor, "F055"); break; case 'w': /* dark white */ pCopyFrom = ColourRGB(apDescriptor, "F333"); break; case 'W': /* light white */ pCopyFrom = ColourRGB(apDescriptor, "F555"); break; case 'o': /* dark orange */ pCopyFrom = ColourRGB(apDescriptor, "F520"); break; case 'O': /* light orange */ pCopyFrom = ColourRGB(apDescriptor, "F530"); break; case 'p': /* dark pink */ pCopyFrom = ColourRGB(apDescriptor, "F301"); break; case 'P': /* light pink */ pCopyFrom = ColourRGB(apDescriptor, "F501"); break;

Please Log in or Create an account to join the conversation.

More
13 Oct 2013 17:46 #4407 by rudeboyrave
check screen.h

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.
The following user(s) said Thank You: dracmas

Please Log in or Create an account to join the conversation.

Time to create page: 0.196 seconds