Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, Remcon

Members: 1
Guests: 12
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
614
BenitoVirg
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » Color Greeting in Smaug 1.4
Forum Rules | Mark all | Recent Posts

Color Greeting in Smaug 1.4
< Newer Topic :: Older Topic > stuck with color greeting smaug 1.4

Pages:<< prev 1 next >>
Post is unread #1 Mar 1, 2008, 1:34 pm
Go to the top of the page
Go to the bottom of the page

Zernon
Fledgling
GroupMembers
Posts14
JoinedMar 1, 2008

Hello all, I am new to coding in smaug, and well new to coding in general. I need to make my greeting colorized, and am stuck. I tried installing a rom snippet and failed miserably. Most of the code from the snippet converted easily, however some didnt. So I noticed I already have a send_to_desc_color, is there a way to use that in my greeting code? Well here is the code from comm.c

  /*
    * Send the greeting.
    */
   {
      extern char *help_greeting;
      if( help_greeting[0] == '.' )
         write_to_buffer( dnew, help_greeting + 1, 0 );
      else
         write_to_buffer( dnew, help_greeting, 0 );
   }


Thanks for your help.
       
Post is unread #2 Mar 1, 2008, 1:40 pm   Last edited Mar 1, 2008, 1:42 pm by tphegley
Go to the top of the page
Go to the bottom of the page

tphegley
Magician
GroupMembers
Posts176
JoinedMay 21, 2006

I would download SmaugFUSS1.9 if you just started with 1.4. It's much more stable and has many new features.

But check your help.are file. Search for Greeting and that'll be your Greeting for the mud. Colors can be used in the help greeting and it will show up as colored on your screen.
       
Post is unread #3 Mar 1, 2008, 4:16 pm
Go to the top of the page
Go to the bottom of the page

Zernon
Fledgling
GroupMembers
Posts14
JoinedMar 1, 2008

I put the colors in the greeting, the &y &Y ... and it doesnt show up, there are colors used in the code that I do not unterstand.
 
"\033[0;36m@-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\033[0;36m@\n\r"

there is a lil piece of the color code they use, I have tried to replicate it, but have failed misserably.
any help still is much apreciated.

here is the coloring for my greeting
&Y .-.   ..   .            .-. .-
&Y(  |-. .| .-| .-..-,.-.  | |-|-
&O `-' '-''-`-'-'  `'-' '  `-' '
&c  ___,                                _
&c /   |                               | |
&c|    |   ,_    __,   _  _        _|_ | |     _   ,_    __,
&G|    |  /  |  /  |  / |/ |  |   | |  |/ \   |/  /  |  /  |
&B \__/\_/   |_/\_/|_/  |  |_/ \_/|/|_/|   |_/|__/   |_/\_/|_/
&C                               /|
&C                               \|
&R
&wEldhaMUD Codebase V1.0a code by: &WRobert Powell (Tommi) with Altere.
Original SMAUG code by: Thoric (Derek Snider) with Altrag, Blodkai, Haus, Narn,
Scryn, Swordbearer, Tricops, Gorog, Rennard, Grishnakh, Fireblade and Nivek.
&wOriginal MERC 2.1 code by:&W Hatchet, Furey and Khan.
&wOriginal DikuMUD  code by: &WHans Staerfeldt, Katja Nyboe, Tom Madsen,
Michael Seifert & Sebastian Hammer.&D
Owners: &WZernon, Dargoth & Shayn.
Enter your character's name, or type new:&D


as you can see, the color codes are in it. but it shows the &R, and all the other color tags in the greeting /cry,
       
Post is unread #4 Mar 1, 2008, 4:35 pm
Go to the top of the page
Go to the bottom of the page

tphegley
Magician
GroupMembers
Posts176
JoinedMay 21, 2006


Zernon said:

I put the colors in the greeting, the &y &Y ... and it doesnt show up, there are colors used in the code that I do not unterstand.
 
"\033[0;36m@-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\033[0;36m@\n\r"

there is a lil piece of the color code they use, I have tried to replicate it, but have failed misserably.
any help still is much apreciated.


Those are hard coded colors. From Nick Gammons website:
What I mean is, throw out all your code changes relating to this problem, go back to standard code.

Then, edit help.are file (in the area directory), scroll down to the GREETING topic (line -1 GREETING~) and add the ANSI codes directly.

eg. I did this at line 4871:


SMAUG 1.4 written by ^[[31mThoric^[[36m (Derek Snider) with Altrag, Blodkai, Haus, Narn,
Scryn, Swordbearer, Tricops, Gorog, Rennard, Grishnakh, Fireblade and Nivek.



The ^[ character is an "escape" character that you can type in, in various ways. I used "vi" editor, so I pressed "i" to go into input mode, then Ctrl+V to quote the next character, and then typed the escape key.

You just need to look up the ANSI codes for various colours then, here are some examples:


Enter ESC [xm (Escape character, followed directly by [ followed by a number, followed by lower-case "m";).

The numbers can be:

Foreground colour

30 black
31 red
32 green
33 yellow
34 blue
35 magenta
36 cyan
37 white

Background colour

40 black
41 red
42 green
43 yellow
44 blue
45 magenta
46 cyan
47 white

Others

0 - reset to default
1 bold
3 blink
4 underline
7 inverse

22 not bold
23 not blink
24 not underline
27 not inverse


http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=2400
       
Post is unread #5 Mar 2, 2008, 7:52 am
Go to the top of the page
Go to the bottom of the page

Noplex
Apprentice
GroupMembers
Posts62
JoinedAug 30, 2005

I too would have to suggest downloading FUSS instead of using 1.4. But if you are dead set on using that I have a snippet that is on here you should be able to use. Mind you, that snippet is years old, and there might be some differences. Although if you're using a stock version of 1.4 then it should work fine.

http://www.smaugmuds.org/index.php?a=files&s=viewfile&fid=123
       
Post is unread #6 Mar 2, 2008, 5:30 pm
Go to the top of the page
Go to the bottom of the page

Zernon
Fledgling
GroupMembers
Posts14
JoinedMar 1, 2008

I took your advice, and am using smaugfuss,
Thanks again for the good advice.
       
Pages:<< prev 1 next >>