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 ➜ Color reference problem

Color reference problem

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


Pages: 1 2  

Posted by Zeno   USA  (2,871 posts)  Bio
Date Sat 05 Jul 2003 09:50 PM (UTC)
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
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 05 Jul 2003 11:02 PM (UTC)
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
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #2 on Sun 06 Jul 2003 02:04 AM (UTC)

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
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #3 on Sun 06 Jul 2003 04:41 AM (UTC)
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.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #4 on Sun 06 Jul 2003 05:17 AM (UTC)

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
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #5 on Sun 06 Jul 2003 05:41 AM (UTC)
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
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #6 on Sun 06 Jul 2003 05:49 AM (UTC)
Message
MUSHclient of course. :P

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

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #7 on Sun 06 Jul 2003 07:07 AM (UTC)
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
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #8 on Sun 06 Jul 2003 06:44 PM (UTC)
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
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #9 on Sun 06 Jul 2003 09:01 PM (UTC)
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
Top

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

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

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #11 on Sun 06 Jul 2003 11:08 PM (UTC)
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
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #12 on Sun 06 Jul 2003 11:17 PM (UTC)

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
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #13 on Mon 07 Jul 2003 07:01 AM (UTC)
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
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #14 on Mon 07 Jul 2003 07:57 PM (UTC)
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
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.


63,220 views.

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

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.