The most newbie'ish thing somebody could ask about colors..

Posted by Kalmah on Sat 25 Oct 2003 08:40 AM — 10 posts, 34,456 views.

#0
Heh, when writing room descriptions.. the & token is supose
to specify a color.. so If I type &B it would make the text
after that blue.. correct? Well it doesn't seem to work.
In the room description I see the color tokens, and the color stays the same. I also tried the '{' since some muds use that. Ansi is turned on. But the mud doesn't seem to recognize the '&' as a token to change the color. I'm running smaug 1.4a.

Anybody know what the deal is?
#1
Smaug 1.4a has lots of bugs theres a list of bugs on websites (search on google for "smaug 1.4a bug list") that you can get to fix them but you need a compiler and if you don't have one you'r screwed. :P
#2
Thanks for your reply. But I was unable to find anything
concerning colors in the mud.

I guess I could have been more specific too.
Colors work, I see all kinds of colors. (the ones that are
hard-coded in).. The '&' works fine when setting a characters prompt. My character has a very colorfull prompt. But when It comes to room descriptions, notes, and channels the '&' doesn't do anything.. You actaully see the '&' token typed into the text when you're reading it.

The reason I'm so concerned about it is that I'm working on a virtual map for an overworld area that uses color. It's not much of a map when It's all the same color and you can see the '&' tokens between every character on the map.

I know this shouldn't be so difficult...

I appreciate it.
USA #3
So you want to use hard coded colors such as &R? And when you try, it just displays as "&R"? Did you remember to define "send_to_pager" as "send_to_pager_color" etc, as it said in the documents?
#4
Yeah, I guess that's what I'm trying to do. Just want to add color to room descriptions.. (and that vmap which is also part of a room description)

I havn't made any changes in the .h files for color except for changing the do_score to add color to that.

So I'm going to have to make a change somewhere so that I can use '&' to change colors for room descriptions and channels? I figured that was something that would work without making changes. I've done alot of area building for other peoples muds and always did that.

Sorry, I'm a bit new to this. Could you tell me what file I have to make the changes in or what document that explains it?

Thanks, I appreciate it.
USA #5
The smaug documents explain it, but I'll post it here.

12b) Adding color to the entire game!
Open mud.h, and goto the very end of the file.  Add the two lines:

  #define send_to_char	send_to_char_color
  #define send_to_pager	send_to_pager_color

This well tell the compiler to use the color counterparts whenever either of
those two functions are called.  Then in comm.c, comment out the two functions
send_to_char() and send_to_pager() so that the compiler won't be trying to
compile two compies of the same function (the real one and the one that's
created when the #defines are convertted by the preprocessor).


That should get it to work.
#6
Thanks alot for the help. I'm having a bit of a problem which is probably quite simple.

When I compile I get an error that looks like this.

comm.c error: redefinition of send_to_char
send_to_char previously defined here

And it says the same thing with send_to_pager

When you said to comment those out did you mean just comment out the function or the function and everything inside of it? (all the way to the return;) Well, I tried both ways and still get the same error so I'm guessing the problem is with something else.. maybe?

I'm really a newbie.. (it was only about a week ago I made my 'hello world' program) hehehe

I also want to make sure their isn't a mis-understanding.
I DO get colors in the mud. room descriptions are green, mobs are yellow, items are blue.. It's just the '&' token to change colors in room descriptions and on channels doesn't work.

Thanks alot. I really appreciate it.
USA #7
Yes, in comm.c comment out the whole function. I think. If it doesn't work, post again.
#8
Thanks again for your reply.

I'm still getting errors. Here's a screenshot of it.

<img src="http://bellsouthpwp.net/d/e/deadnight213/errors.jpg">

This is what my comm.h looks like in those particular areas.

/* void send_to_char( const char *txt, CHAR_DATA *ch ) */
/*     {                                               */
/*     if ( !ch )                                      */
/*     {                                               */
/*      bug( "Send_to_char: NULL *ch" );               */
/*      return;                                        */
/*      }                                              */

And the other one..

/* void send_to_pager( const char *txt, CHAR_DATA *ch ) */
/* {                                                    */
/*  if ( !ch )                                          */
/*   {                                                  */
/*    bug( "Send_to_pager: NULL *ch" );                 */
/*    return;                                           */
/*  }                                                   */


I put what you said in mud.h. I didn't bother to post that here since it probably isn't a problem.

I appreciate it.
Amended on Sun 26 Oct 2003 02:25 AM by Kalmah
#9
Ahh, nevermind. I figured it out. I didn't notice the 'else' and was cutting it off too short. Everything seems to be working just like I wanted now.

Thanks for the help.