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 ➜ The most newbie'ish thing somebody could ask about colors..

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

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


Posted by Kalmah   (17 posts)  Bio
Date Sat 25 Oct 2003 08:40 AM (UTC)
Message
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?
Top

Posted by USER007   (124 posts)  Bio
Date Reply #1 on Sat 25 Oct 2003 11:57 AM (UTC)
Message
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
Top

Posted by Kalmah   (17 posts)  Bio
Date Reply #2 on Sat 25 Oct 2003 07:52 PM (UTC)
Message
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.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Sat 25 Oct 2003 08:17 PM (UTC)
Message
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?

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

Posted by Kalmah   (17 posts)  Bio
Date Reply #4 on Sat 25 Oct 2003 09:36 PM (UTC)
Message
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.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #5 on Sun 26 Oct 2003 12:11 AM (UTC)
Message
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.

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

Posted by Kalmah   (17 posts)  Bio
Date Reply #6 on Sun 26 Oct 2003 01:04 AM (UTC)
Message
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.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #7 on Sun 26 Oct 2003 01:52 AM (UTC)
Message
Yes, in comm.c comment out the whole function. I think. If it doesn't work, post again.

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

Posted by Kalmah   (17 posts)  Bio
Date Reply #8 on Sun 26 Oct 2003 02:23 AM (UTC)

Amended on Sun 26 Oct 2003 02:25 AM (UTC) by Kalmah

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

Posted by Kalmah   (17 posts)  Bio
Date Reply #9 on Sun 26 Oct 2003 05:05 AM (UTC)
Message
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.
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.


32,503 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.