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, Gigablast, Yandex, Bing, Yahoo!

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
Evoru (32)
Related Links
» SmaugMuds.org » General » General Discussions » Odd color channel issues
Forum Rules | Mark all | Recent Posts

Odd color channel issues
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Sep 11, 2005, 5:39 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Because I feel that a channel being one color is too bland, I added some more colors. This is the lines for my chat channel:
        ch_printf( ch, "You %s &W'&w%s&W'&D\n\r", verb, argument );
        sprintf( buf, "$n %ss &W'&w$t&W'&D",     verb );


But if I type this, it appears like:
chat Testing^
You chat 'Testing^&w'



Anyone know how to fix this? It inserts the &w there without actually being the color.
       
Post is unread #2 Sep 11, 2005, 6:05 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Looks to me like it's tripping over the ^ symbol, which in Smaug is used to do background changes. It probably tried to parse it and saw the & there and ignored it, which then caused it to ignore the w as well.
       
Post is unread #3 Sep 11, 2005, 6:09 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Any suggestions? Like a different way to colorize the channels as it currently is?
       
Post is unread #4 Sep 11, 2005, 6:57 pm   Last edited Sep 11, 2005, 6:57 pm by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,868
JoinedJul 26, 2005

Ok, this ive worked on before also.
You pretty much have two choices you can take which ever you like better.
1) If you dont mind spaces do it like this.
        ch_printf( ch, "You %s &W'&w %s &D&W'&D\n\r", verb, argument );
        sprintf( buf, "$n %ss &W'&w $t &D&W'&D",     verb );

Notice I put in spaces as well as after the argument put it to set it back to normal color
Not doing this can allow color bleeding even with the &W there.
2) If you dont want spaces and all then you need to do it something like this
        ch_printf( ch, "You %s &W'&w%s%s&W'&D\n\r", verb, argument, ANSI_RESET );
        sprintf( buf, "$n %ss &W'&w$t%s&W'&D",  verb, ANSI_RESET );

It more or less does the same thing only it will go ahead and put the actual code in there
which will reset it and using some color code on the end shouldn't affect it.

Personaly I think I orginaly went with the top way but I think either should work fine.
       
Post is unread #5 Sep 12, 2005, 1:14 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Thanks. I went with the 2nd solution, works fine.
       
Pages:<< prev 1 next >>