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, DotBot, Bing

Members: 0
Guests: 15
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » just a simple color question ...
Forum Rules | Mark all | Recent Posts

just a simple color question :)
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Aug 14, 2006, 3:33 pm   Last edited Aug 14, 2006, 9:02 pm by Samson
Go to the top of the page
Go to the bottom of the page

jparkin

GroupMembers
Posts33
JoinedAug 11, 2006

hey everyone,

so i'm extremely new to running my own MUD. i'm trying to edit the do_score command in player.c - i want to change the colors. the problem i'm running into is when i put something like "&R" or "&B" before the part i want to change, i get this when i type score:

&RScore for Nos the Blood Student.

here is the code i have for that:

void do_score(CHAR_DATA * ch, char *argument)
{
    char            buf[MAX_STRING_LENGTH];
    AFFECT_DATA    *paf;
    int iLang;

    if (IS_NPC(ch))
    {
	do_oldscore(ch, argument);
	return;
    }
    set_pager_color(AT_SCORE, ch);

    pager_printf(ch, "\n\r&RScore for %s%s.\n\r", ch->name, ch->pcdata->title);
    if ( get_trust( ch ) != ch->level )
	pager_printf( ch, "You are trusted at level %d.\n\r", get_trust( ch ) );


however, this line of code does work and it does change the color:

send_to_pager_color("&R----------------------------------------------------------------------------\n\r", ch);

if any of this makes sense, can anyone please help me? :)

thanks!
-josh
       
Post is unread #2 Aug 14, 2006, 4:07 pm
Go to the top of the page
Go to the bottom of the page

jparkin

GroupMembers
Posts33
JoinedAug 11, 2006

bump!

nevermind.. i feel like an idiot. i figured it out :) lol

-josh
       
Post is unread #3 Aug 14, 2006, 7:45 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

Don't feel bad, it's not something every newbie to this would've figured out on thier own, in fact, as such, it wouldn't have hurt for you to, instead of posting:
jparkin said:

bump!

nevermind.. i feel like an idiot. i figured it out :) lol

-josh
to have posted something like:
Nevermind, I figured it out, I'd forgotten to change:
pager_printf(ch, "\n\r&RScore for %s%s.\n\r", ch->name, ch->pcdata->title);

to:
whatever worked for you... though, I'm not sure that I see why that line didn't work to begin with, Nos. Other than that your \n\r's should've been \r\n's, but that shouldn't have had any bearing on your colors.
       
Post is unread #4 Aug 14, 2006, 9:45 pm
Go to the top of the page
Go to the bottom of the page

mordecai

GroupMembers
Posts99
JoinedNov 17, 2005

Maybe his pager_printf doesn't handle colorcodes? Although I thought they did....
       
Post is unread #5 Aug 15, 2006, 3:24 am
Go to the top of the page
Go to the bottom of the page

jparkin

GroupMembers
Posts33
JoinedAug 11, 2006

oh sweetness! ok thanks. i'll keep that in mind for future reference :)

-Josh
       
Post is unread #6 Aug 15, 2006, 10:43 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,868
JoinedJul 26, 2005

jparkin is useing a non SmaugFUSS code. While in SmaugFUSS the pager_printf, ch_printf etc... handle color codes in earlier Smaug they didn't.
You will have to make use of pager_printf_color, send_to_pager_color, ch_printf_color, send_to_char_color.
       
Post is unread #7 Aug 15, 2006, 3:23 pm
Go to the top of the page
Go to the bottom of the page

mordecai

GroupMembers
Posts99
JoinedNov 17, 2005

remcon737 said:

jparkin is useing a non SmaugFUSS code. While in SmaugFUSS the pager_printf, ch_printf etc... handle color codes in earlier Smaug they didn't.
You will have to make use of pager_printf_color, send_to_pager_color, ch_printf_color, send_to_char_color.


Why would anyone not use FUSS? *gasp*

:lol:
       
Post is unread #8 Aug 15, 2006, 4:29 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,868
JoinedJul 26, 2005

Good question lol.
       
Post is unread #9 Aug 16, 2006, 12:46 am   Last edited Aug 16, 2006, 12:46 am by kiasyn
Go to the top of the page
Go to the bottom of the page

kiasyn
Magician
GroupMembers
Posts121
JoinedJun 30, 2006

i dont use fuss :), but my code barely resembles smaug now anyway
       
Post is unread #10 Aug 16, 2006, 3:07 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,868
JoinedJul 26, 2005

Well even in your case, you would have been better off starting with FUSS for lots of reasons. Even though you went through and ripped out alot of the code to start with had you used FUSS you wouldn't have had to go through all the fixes that had been done to FUSS to see which ones you needed. :)
       
Post is unread #11 Aug 16, 2006, 6:22 pm
Go to the top of the page
Go to the bottom of the page

kiasyn
Magician
GroupMembers
Posts121
JoinedJun 30, 2006

but its fun :)
       
Post is unread #12 Aug 16, 2006, 6:57 pm
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

I don't think JParkin's doing this becuase he's trying to have the pleasure of doing it all himself, but because he probably doesn't realize just how much extra work is involved to get Smaug 1.4a up to snuff and probably really doesn't know what he's doing yet well enough to realize just what he's missing out on. But of course, that's just my best guess.
       
Pages:<< prev 1 next >>