[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Color reference problem

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Color reference problem

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Pages: 1 2  

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Sat 05 Jul 2003 09:50 PM (UTC)  quote  ]
Message
After adding color to the entire game, colors are for some reason sometimes change the darker color, instead of what it should be, such as if I put &Ggreen in a room desc, it would show up as the darker green (&g). I think I have seen this question asked before, and I searched around for it, but could not find it. Could someone point me in the right direction, or help me?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sat 05 Jul 2003 11:02 PM (UTC)  quote  ]
Message
I think it came up recently in the context of mixing a colour with bold. Is that is what is happening here?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Reply #2 on Sun 06 Jul 2003 02:04 AM (UTC)  quote  ]

Amended on Sun 06 Jul 2003 02:09 AM (UTC) by Zeno

Message
I don't think so, I just use a normal &G and it then displays the darker green. No bold or anything else involved.

Although it doesn't happen all the time. For example, the MOTD has a few bright (&G &R) colors in it. When someone logs on and see's it, its all dark (&g &g) but when your on the mud, and read HELP MOTD, it displays the colors corretly.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Reply #3 on Sun 06 Jul 2003 04:41 AM (UTC)  quote  ]
Message
on smaug, colors like to bleed into other colors. try to put like &Y&Ggreen, that might make it the brightness, or end the line before it with &W or something of that nature.
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Reply #4 on Sun 06 Jul 2003 05:17 AM (UTC)  quote  ]

Amended on Sun 06 Jul 2003 05:20 AM (UTC) by Zeno

Message
They bleed into, if the next text isn't stated a color, but blending? I'm not sure, but I'll try it.

[EDIT] No, didn't work. &Y&Ggreen displayed the darker green, and the text before it ended with &W.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Sun 06 Jul 2003 05:41 AM (UTC)  quote  ]
Message
What client are you using? We need to establish if this is a server problem or a client problem.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Reply #6 on Sun 06 Jul 2003 05:49 AM (UTC)  quote  ]
Message
MUSHclient of course. :P

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Sun 06 Jul 2003 07:07 AM (UTC)  quote  ]
Message
I don't seem to be able to reproduce this. What version of MUSHclient are you using, and what version of SMAUG?

One possibility seems to be that it remembers what colour it last output, and if no change, doesn't send the same colour again. I see in new_descriptor is a line:

dnew->prevcolor = 0x07;


However it sounds in your case that you have somehow not got the bold version of green - for me dark green is unbold, whereas light green is bold green.

I suggest doing a packet debug. Quit your character, turn it on (edit menu) log on, see the MOTD, do your HELP MOTD, turn off packet debug, and compare the codes output.

I got this (amongst a heap of other stuff):

.[1;32m

The dot was the escape character. That represents bold green.

What we need to know is if you got that code. If you got it, and it isn't bold green on the screen it is a client problem. If you didn't it is a server problem.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Reply #8 on Sun 06 Jul 2003 06:44 PM (UTC)  quote  ]
Message
I'm using MUSHclient 3.32, Smaug 1.4a.
Although a question. What exactly is a bold text, is it with Smaug?

Logged on normally, MOTD darker color. Logged off, turned on debug packet, and logged on. I got stuff like .[m.[32m or ...[31m

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Sun 06 Jul 2003 09:01 PM (UTC)  quote  ]
Message
Bold (hilite really) is an ANSI code that says to use the stronger version of a colour. See:

http://www.gammon.com.au/scripts/doc.php?function=ansi

This lists common ANSI codes. You can see from that that bold is 1 and green is 32.

So, .[1;32m (where the dot is Escape) would be bold and green. It could also appear as: .[1m.[32m (ie bold and then green). However the fact that you got .[m.[32m is strange. It suggests the bold is not being sent. I think you would find that the first one (.[m) is just a "reset" to turn everything back to normal. That is, without a number it is assumed to be zero, and zero is reset.

The next test is to do "help motd" with packet debug and see if the code you get is different (ie. is the "1;" there?).

A bit of research shows that the MOTD shows up by simply doing a "help MOTD" like this:


        set_pager_color( AT_PLAIN, ch );
        if ( xIS_SET(ch->act, PLR_RIP) )
          send_rip_screen(ch);
        if ( xIS_SET(ch->act, PLR_ANSI) )
          send_to_pager( "\033[2J", ch );
        else
          send_to_pager( "\014", ch );
        if ( IS_IMMORTAL(ch) )
          do_help( ch, "imotd" );
        if ( ch->level == 50)
          do_help( ch, "amotd" );
        if ( ch->level < 50 && ch->level > 0 )
          do_help( ch, "motd" );
        if ( ch->level == 0 )
          do_help( ch, "nmotd" );
        send_to_pager( "\n\rPress [ENTER] ", ch );
        d->connected = CON_READ_MOTD;


The \033[2J is sending a "page clear" which will blank the page on ANSI emulators. After that it seems to be doing the same thing as HELP MOTD.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Reply #10 on Sun 06 Jul 2003 09:58 PM (UTC)  quote  ]
Message
Did the test and got things like
.[m.[1;32m
...[33m

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #11 on Sun 06 Jul 2003 11:08 PM (UTC)  quote  ]
Message
Strange. So in the initial login you don't get the "1;" but later on you do? Can you confirm that the message is indeed the MOTD one, and that your code in comm.c looks like the stuff I posted further up?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Reply #12 on Sun 06 Jul 2003 11:17 PM (UTC)  quote  ]

Amended on Sun 06 Jul 2003 11:18 PM (UTC) by Zeno

Message
If it matters, its actually the IMOTD. And the code isn't the same... I figured why bother with those ansi files, I just made a help file.

        set_pager_color( AT_PLAIN, ch );
        if ( xIS_SET(ch->act, PLR_RIP) )
         // send_rip_screen(ch);
        if ( xIS_SET(ch->act, PLR_ANSI) )
          do_help( ch, "_login_" );
          //send_to_pager( "\033[2J", ch );
        else
          send_to_pager( "\014", ch );
        if ( IS_IMMORTAL(ch) )
          do_help( ch, "imotd" );
        if ( ch->level == 50)
          do_help( ch, "motd" );
        if ( ch->level < 50 && ch->level > 0 )
          do_help( ch, "motd" );
        if ( ch->level == 0 )
          do_help( ch, "motd" );
        send_to_pager( "\n\rPress [ENTER] ", ch );
        d->connected = CON_READ_MOTD;

But it doesn't happen in IMOTD alone, it also happens in room desc's etc

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #13 on Mon 07 Jul 2003 07:01 AM (UTC)  quote  ]
Message
For a start, I'm a bit worried about these lines:

if ( xIS_SET(ch->act, PLR_RIP) )
// send_rip_screen(ch);

You have left the "if" in but taken out the line that it affects, this will change the logic.

However I don't think this is the problem, if it is affecting room descs as well you have some sort of problem in the way it translates colours.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Reply #14 on Mon 07 Jul 2003 07:57 PM (UTC)  quote  ]
Message
I'll provide an example of the room desc.
Room name- Test
Room desc-
&Rred
&Yyellow
&Ccyan
&Bblue
That would show up fine. But if I change...
Room name- &GTest
Room desc-
Same.

It would then convert all the room desc colors to the darker color.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] 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.


3,452 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]