[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]  do_who

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: do_who
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1  2  3 4  

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Fri 02 Apr 2004 11:09 PM (UTC)  quote  ]

Amended on Fri 02 Apr 2004 11:10 PM (UTC) by Nick Gammon

Message
Your posts are coming out half in italics because you have lines like this in them:

race->where_name[i]

If you are using forum codes on this forum, then you should "escape" things like [i] which indicate italics.

Thus it should be:

race->where_name\[i\]

A quick way of doing that is to use MUSHclient's notepad which has a "quote forum codes" feature. Failing that, use a text editor to change:

\ to \\
[ to \[
] to \]

... and you are done!


- Nick Gammon

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

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Fri 02 Apr 2004 02:58 AM (UTC)  quote  ]

Amended on Fri 02 Apr 2004 03:05 AM (UTC) by Ithildin

Message
you are the man! it works great now.

...now i gotta try and find out the class one. i might be back for some help on that. i'll try and figure it out first though.

thanks so much.


______________________________

Just got color in my who list...wo0t. you rock greven.
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Fri 02 Apr 2004 02:42 AM (UTC)  quote  ]
Message
Bah, I shouldn't try and help when I'm that tired, sorry. I guess you can try something like this:
bool load_race_file( char *fname )
{
    char buf[MAX_STRING_LENGTH];
    char *word;
    char *race_name = NULL;
    char *race_name_color = NULL;
    bool fMatch;
    struct race_type *race;
    int ra = -1;
    FILE *fp;
    int i, wear=0;

    sprintf( buf, "%s%s", RACEDIR, fname );
    if ( ( fp = fopen( buf, "r" ) ) == NULL )
    {
	perror( buf );
	return FALSE;
    }

    CREATE( race, struct race_type, 1 );
    for(i=0;i<MAX_WHERE_NAME;i++)
       race->where_name = where_name;

    for ( ; ; )
    {
	word   = feof( fp ) ? "End" : fread_word( fp );
	fMatch = FALSE;

	switch ( UPPER(word[0]) )
	{
	case '*':
	    fMatch = TRUE;
	    fread_to_eol( fp );
	    break;

	case 'A':
	    KEY( "Align",	race->alignment,		fread_number( fp )	);
	    KEY( "AC_Plus",	race->ac_plus,		fread_number( fp )	);
	    KEY( "Affected",	race->affected,		fread_bitvector( fp )	);
	    KEY( "Attacks",	race->attacks,		fread_bitvector( fp )	);
	    break;

	case 'C':
	    KEY( "Con_Plus",	race->con_plus,		fread_number( fp )	);
	    KEY( "Cha_Plus",	race->cha_plus,		fread_number( fp )	);
	    KEY( "Classes",	race->class_restriction,		fread_number( fp )	);
	    break;


	case 'D':
	    KEY( "Dex_Plus",	race->dex_plus,		fread_number( fp )	);
	    KEY( "Defenses",	race->defenses,		fread_bitvector( fp )	);
	    break;

	case 'E':
            if ( !str_cmp( word, "End" ) )
            {
                fclose( fp );
                if ( ra < 0 || ra >= MAX_RACE )
                {
                    bug( "Load_race_file: Race (%s) bad/not found (%d)",
                        race->race_name ? race->race_name : "name not found", ra );
			  if( race_name )
  				STRFREE( race_name );
			  if( race_name_color )
  				STRFREE( race_name_color );
                    DISPOSE( race );
                    return FALSE;
                }
                race_table[ra] = race;
		    if( race_name )
		      STRFREE( race_name );
		    if( race_name_color )
		      STRFREE( race_name_color );
                return TRUE;
            }

	    KEY( "Exp_Mult",	race->exp_multiplier,	fread_number( fp )	);

	    break;


	case 'I':
	    KEY( "Int_Plus",	race->int_plus,		fread_number( fp )	);
	    break;

	case 'H':
	    KEY( "Height",	race->height,		fread_number( fp )	);
	    KEY( "Hit",		race->hit,		fread_number( fp )	);
	    KEY( "HP_Regen",	race->hp_regen,		fread_number( fp )	);
	    KEY( "Hunger_Mod",	race->hunger_mod,	fread_number( fp )	);
	    break;

	case 'L':
	    KEY( "Language",	race->language,		fread_number( fp )	);
	    KEY( "Lck_Plus",	race->lck_plus,		fread_number( fp )	);
	    break;


	case 'M':
	    KEY( "Mana",	race->mana,		fread_number( fp )	);
	    KEY( "Mana_Regen",	race->mana_regen,	fread_number( fp )	);
	    KEY( "Min_Align",	race->minalign,		fread_number( fp )	);
            race->minalign = -1000;
	    KEY( "Max_Align",	race->maxalign,		fread_number( fp )	);
            race->maxalign = -1000;
	    break;

	case 'N':
	    KEY( "Name",	race_name,	fread_string( fp )	);
	    KEY( "Namecolor",	race_name_color,	fread_string( fp )	);
	    break;

	case 'R':
	    KEY( "Race",	ra,			fread_number( fp )	);
	    KEY( "Race_Recall",	race->race_recall,		fread_number( fp )	);
	    KEY( "Resist",	race->resist,		fread_number( fp )	);
	    
		break;

	case 'S':
	    KEY( "Str_Plus",	race->str_plus,		fread_number( fp )	);
	    KEY( "Suscept",	race->suscept,		fread_number( fp )	);
	    if ( !str_cmp( word, "Skill" ) )
	    {
		int sn, lev, adp;

		word = fread_word( fp );
		lev = fread_number( fp );
		adp = fread_number( fp );
		sn = skill_lookup( word );
		if ( ra < 0 || ra >= MAX_RACE )
		{
		    sprintf( buf, "load_race_file: Skill %s -- race bad/not found (%d)", word, ra );
		    bug( buf, 0 );
		}
		else
		if ( !IS_VALID_SN(sn) )
		{
		    sprintf( buf, "load_race_file: Skill %s unknown", word);
		    bug( buf, 0 );
		}
		else
		{
		    skill_table[sn]->race_level[ra] = lev;
		    skill_table[sn]->race_adept[ra] = adp;
		}
		fMatch = TRUE;
		break;
            }
	    break;

	case 'T':
	    KEY( "Thirst_Mod",	race->thirst_mod,	fread_number( fp )	);
	    break;

	case 'W':
	    KEY( "Weight",	race->weight,		fread_number( fp )	);
	    KEY( "Wis_Plus",	race->wis_plus,		fread_number( fp )	);
	    if ( !str_cmp( word, "WhereName" ) )
	    {
		if ( ra < 0 || ra >= MAX_RACE )
		{
		    char *tmp;

		    sprintf( buf, "load_race_file: Title -- race bad/not found (%d)", ra );
		    bug( buf, 0 );
		    tmp = fread_string_nohash( fp );
		    DISPOSE( tmp );
		    tmp = fread_string_nohash( fp );
		    DISPOSE( tmp );
		}
		else
		if ( wear < MAX_WHERE_NAME )
		{
		    race->where_name[wear] = fread_string_nohash( fp );
		    ++wear;
		}
		else
		    bug( "load_race_file: Too many where_names" );
		fMatch = TRUE;
		break;
	    }
	    break;
	}

        if ( race_name != NULL) 
             sprintf(race->race_name,"%-.16s",race_name);
        if ( race_name_color != NULL) 
             sprintf(race->race_name_color,"%-.16s",race_name_color);		

	if ( !fMatch )
	{
            sprintf( buf, "load_race_file: no match: %s", word );
	    bug( buf, 0 );
	}
    }
    return FALSE;
}

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Fri 02 Apr 2004 02:32 AM (UTC)  quote  ]
Message
when i try that, i get this error.



tables.c: In function `load_race_file':
tables.c:1777: error: incompatible types in assignment
tables.c:1676: warning: unused variable `race_name_color'



so my

char *race_name_color

is a warning because of that.

how do i make that compatible?
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Thu 01 Apr 2004 09:08 PM (UTC)  quote  ]
Message
The easiest way to be to change the N case to look like this:
	case 'N':
	    KEY( "Name",	race_name,	fread_string( fp )	);
		KEY( "Namecolor",	race->race_name_color,	fread_string( fp )	);
	    break;
Try that.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Thu 01 Apr 2004 05:54 PM (UTC)  quote  ]
Message
alrighty, here it is:



bool load_race_file( char *fname )
{
    char buf[MAX_STRING_LENGTH];
    char *word;
    char *race_name = NULL;
	char *race_name_color = NULL;
    bool fMatch;
    struct race_type *race;
    int ra = -1;
    FILE *fp;
    int i, wear=0;

    sprintf( buf, "%s%s", RACEDIR, fname );
    if ( ( fp = fopen( buf, "r" ) ) == NULL )
    {
	perror( buf );
	return FALSE;
    }

    CREATE( race, struct race_type, 1 );
    for(i=0;i<MAX_WHERE_NAME;i++)
       race->where_name = where_name;

    for ( ; ; )
    {
	word   = feof( fp ) ? "End" : fread_word( fp );
	fMatch = FALSE;

	switch ( UPPER(word[0]) )
	{
	case '*':
	    fMatch = TRUE;
	    fread_to_eol( fp );
	    break;

	case 'A':
	    KEY( "Align",	race->alignment,		fread_number( fp )	);
	    KEY( "AC_Plus",	race->ac_plus,		fread_number( fp )	);
	    KEY( "Affected",	race->affected,		fread_bitvector( fp )	);
	    KEY( "Attacks",	race->attacks,		fread_bitvector( fp )	);
	    break;

	case 'C':
	    KEY( "Con_Plus",	race->con_plus,		fread_number( fp )	);
	    KEY( "Cha_Plus",	race->cha_plus,		fread_number( fp )	);
	    KEY( "Classes",	race->class_restriction,		fread_number( fp )	);
	    break;


	case 'D':
	    KEY( "Dex_Plus",	race->dex_plus,		fread_number( fp )	);
	    KEY( "Defenses",	race->defenses,		fread_bitvector( fp )	);
	    break;

	case 'E':
            if ( !str_cmp( word, "End" ) )
            {
                fclose( fp );
                if ( ra < 0 || ra >= MAX_RACE )
                {
                    bug( "Load_race_file: Race (%s) bad/not found (%d)",
                        race->race_name ? race->race_name : "name not found", ra );
			  if( race_name )
  				STRFREE( race_name );
                    DISPOSE( race );
                    return FALSE;
                }
                race_table[ra] = race;
		    if( race_name )
		      STRFREE( race_name );
                return TRUE;
            }

	    KEY( "Exp_Mult",	race->exp_multiplier,	fread_number( fp )	);

	    break;


	case 'I':
	    KEY( "Int_Plus",	race->int_plus,		fread_number( fp )	);
	    break;

	case 'H':
	    KEY( "Height",	race->height,		fread_number( fp )	);
	    KEY( "Hit",		race->hit,		fread_number( fp )	);
	    KEY( "HP_Regen",	race->hp_regen,		fread_number( fp )	);
	    KEY( "Hunger_Mod",	race->hunger_mod,	fread_number( fp )	);
	    break;

	case 'L':
	    KEY( "Language",	race->language,		fread_number( fp )	);
	    KEY( "Lck_Plus",	race->lck_plus,		fread_number( fp )	);
	    break;


	case 'M':
	    KEY( "Mana",	race->mana,		fread_number( fp )	);
	    KEY( "Mana_Regen",	race->mana_regen,	fread_number( fp )	);
	    KEY( "Min_Align",	race->minalign,		fread_number( fp )	);
            race->minalign = -1000;
	    KEY( "Max_Align",	race->maxalign,		fread_number( fp )	);
            race->maxalign = -1000;
	    break;

	case 'N':
	    KEY( "Name",	race_name,	fread_string( fp )	);
		KEY( "Namecolor",	race_name_color,	fread_string( fp )	);
	    break;

	case 'R':
	    KEY( "Race",	ra,			fread_number( fp )	);
	    KEY( "Race_Recall",	race->race_recall,		fread_number( fp )	);
	    KEY( "Resist",	race->resist,		fread_number( fp )	);
	    
		break;

	case 'S':
	    KEY( "Str_Plus",	race->str_plus,		fread_number( fp )	);
	    KEY( "Suscept",	race->suscept,		fread_number( fp )	);
	    if ( !str_cmp( word, "Skill" ) )
	    {
		int sn, lev, adp;

		word = fread_word( fp );
		lev = fread_number( fp );
		adp = fread_number( fp );
		sn = skill_lookup( word );
		if ( ra < 0 || ra >= MAX_RACE )
		{
		    sprintf( buf, "load_race_file: Skill %s -- race bad/not found (%d)", word, ra );
		    bug( buf, 0 );
		}
		else
		if ( !IS_VALID_SN(sn) )
		{
		    sprintf( buf, "load_race_file: Skill %s unknown", word);
		    bug( buf, 0 );
		}
		else
		{
		    skill_table[sn]->race_level[ra] = lev;
		    skill_table[sn]->race_adept[ra] = adp;
		}
		fMatch = TRUE;
		break;
            }
	    break;

	case 'T':
	    KEY( "Thirst_Mod",	race->thirst_mod,	fread_number( fp )	);
	    break;

	case 'W':
	    KEY( "Weight",	race->weight,		fread_number( fp )	);
	    KEY( "Wis_Plus",	race->wis_plus,		fread_number( fp )	);
	    if ( !str_cmp( word, "WhereName" ) )
	    {
		if ( ra < 0 || ra >= MAX_RACE )
		{
		    char *tmp;

		    sprintf( buf, "load_race_file: Title -- race bad/not found (%d)", ra );
		    bug( buf, 0 );
		    tmp = fread_string_nohash( fp );
		    DISPOSE( tmp );
		    tmp = fread_string_nohash( fp );
		    DISPOSE( tmp );
		}
		else
		if ( wear < MAX_WHERE_NAME )
		{
		    race->where_name[wear] = fread_string_nohash( fp );
		    ++wear;
		}
		else
		    bug( "load_race_file: Too many where_names" );
		fMatch = TRUE;
		break;
	    }
	    break;
	}

        if ( race_name != NULL) 
             sprintf(race->race_name,"%-.16s",race_name);
		

	if ( !fMatch )
	{
            sprintf( buf, "load_race_file: no match: %s", word );
	    bug( buf, 0 );
	}
    }
    return FALSE;
}



[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Thu 01 Apr 2004 05:50 PM (UTC)  quote  ]
Message
Sorry, I'm not sure of the actual name of the funtion, I was refering to the one that reads in the data, where you have this:
case 'N':
	    KEY( "Name",	race_name,	fread_string( fp )	);
		KEY( "Namecolor",	race_name_color,	fread_string( fp )	);
	    break;
load_race, possibly?

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Thu 01 Apr 2004 05:47 PM (UTC)  quote  ]
Message
i did a search for fread_race and didn't find anything. here's this. i think this might be what you are talkinga bout:


void write_race_file( int ra )
{
    FILE *fpout;
    char buf[MAX_STRING_LENGTH];
    char filename[MAX_INPUT_LENGTH];
    struct race_type *race = race_table[ra];
    int i;
    int x,y;

    if( !race->race_name)
    {
	sprintf( buf, "Race %d has null name, not writing .race file.", ra );
	bug( buf, 0 );
	return;
    }

    sprintf( filename, "%s%s.race", RACEDIR, race->race_name );
    if ( (fpout=fopen(filename, "w+")) == NULL )
    {
	sprintf( buf, "Cannot open: %s for writing", filename );
	bug( buf, 0 );
	return;
    }

    fprintf( fpout, "Name        %s~\n",	race->race_name	    );
	fprintf( fpout, "Namecolor   %s~\n",	race->race_name_color		);
    fprintf( fpout, "Race        %d\n",		ra  			);
    fprintf( fpout, "Classes     %d\n",		race->class_restriction );
    fprintf( fpout, "Str_Plus    %d\n",		race->str_plus		);
    fprintf( fpout, "Dex_Plus    %d\n",		race->dex_plus		);
    fprintf( fpout, "Wis_Plus    %d\n",		race->wis_plus		);
    fprintf( fpout, "Int_Plus    %d\n",		race->int_plus		);
    fprintf( fpout, "Con_Plus    %d\n",		race->con_plus		);
    fprintf( fpout, "Cha_Plus    %d\n",		race->cha_plus		);
    fprintf( fpout, "Lck_Plus    %d\n",		race->lck_plus		);
    fprintf( fpout, "Hit         %d\n",		race->hit		);
    fprintf( fpout, "Mana        %d\n",		race->mana		);
    fprintf( fpout, "Affected    %s\n",		print_bitvector(&race->affected)	);
    fprintf( fpout, "Resist      %d\n",		race->resist		);
    fprintf( fpout, "Suscept     %d\n",		race->suscept		);
    fprintf( fpout, "Language    %d\n",		race->language		);
    fprintf( fpout, "Align       %d\n",		race->alignment		);
    fprintf( fpout, "Min_Align  %d\n",		race->minalign		);
    fprintf( fpout, "Max_Align	%d\n",		race->maxalign		);
    fprintf( fpout, "AC_Plus    %d\n",		race->ac_plus		);
    fprintf( fpout, "Exp_Mult   %d\n",		race->exp_multiplier	); 
    fprintf( fpout, "Attacks    %s\n",		print_bitvector(&race->attacks)	);
    fprintf( fpout, "Defenses   %s\n",		print_bitvector(&race->defenses) );
    fprintf( fpout, "Height     %d\n",		race->height		);
    fprintf( fpout, "Weight     %d\n",		race->weight		);
    fprintf( fpout, "Hunger_Mod  %d\n",		race->hunger_mod	);
    fprintf( fpout, "Thirst_mod  %d\n",		race->thirst_mod	);
    fprintf( fpout, "Mana_Regen  %d\n",		race->mana_regen	);
    fprintf( fpout, "HP_Regen    %d\n",		race->hp_regen		);
    fprintf( fpout, "Race_Recall %d\n",		race->race_recall	);
    for ( i = 0; i < MAX_WHERE_NAME; i++ )
	fprintf( fpout, "WhereName  %s~\n",
		race->where_name );

    for ( x = 0; x < top_sn; x++ )
    {
	if ( !skill_table[x]->name || skill_table[x]->name[0] == '\0' )
	   break;
	if ( (y=skill_table[x]->race_level[ra]) < LEVEL_IMMORTAL )
	  fprintf( fpout, "Skill '%s' %d %d\n",
		skill_table[x]->name, y, skill_table[x]->race_adept[ra] );
    }
    fprintf( fpout, "End\n" );
    fclose( fpout );
}


if not i'll post some more.
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Thu 01 Apr 2004 05:47 PM (UTC)  quote  ]
Message
i did a search for fread_race and didn't find anything. here's this. i think this might be what you are talkinga bout:


void write_race_file( int ra )
{
    FILE *fpout;
    char buf[MAX_STRING_LENGTH];
    char filename[MAX_INPUT_LENGTH];
    struct race_type *race = race_table[ra];
    int i;
    int x,y;

    if( !race->race_name)
    {
	sprintf( buf, "Race %d has null name, not writing .race file.", ra );
	bug( buf, 0 );
	return;
    }

    sprintf( filename, "%s%s.race", RACEDIR, race->race_name );
    if ( (fpout=fopen(filename, "w+")) == NULL )
    {
	sprintf( buf, "Cannot open: %s for writing", filename );
	bug( buf, 0 );
	return;
    }

    fprintf( fpout, "Name        %s~\n",	race->race_name	    );
	fprintf( fpout, "Namecolor   %s~\n",	race->race_name_color		);
    fprintf( fpout, "Race        %d\n",		ra  			);
    fprintf( fpout, "Classes     %d\n",		race->class_restriction );
    fprintf( fpout, "Str_Plus    %d\n",		race->str_plus		);
    fprintf( fpout, "Dex_Plus    %d\n",		race->dex_plus		);
    fprintf( fpout, "Wis_Plus    %d\n",		race->wis_plus		);
    fprintf( fpout, "Int_Plus    %d\n",		race->int_plus		);
    fprintf( fpout, "Con_Plus    %d\n",		race->con_plus		);
    fprintf( fpout, "Cha_Plus    %d\n",		race->cha_plus		);
    fprintf( fpout, "Lck_Plus    %d\n",		race->lck_plus		);
    fprintf( fpout, "Hit         %d\n",		race->hit		);
    fprintf( fpout, "Mana        %d\n",		race->mana		);
    fprintf( fpout, "Affected    %s\n",		print_bitvector(&race->affected)	);
    fprintf( fpout, "Resist      %d\n",		race->resist		);
    fprintf( fpout, "Suscept     %d\n",		race->suscept		);
    fprintf( fpout, "Language    %d\n",		race->language		);
    fprintf( fpout, "Align       %d\n",		race->alignment		);
    fprintf( fpout, "Min_Align  %d\n",		race->minalign		);
    fprintf( fpout, "Max_Align	%d\n",		race->maxalign		);
    fprintf( fpout, "AC_Plus    %d\n",		race->ac_plus		);
    fprintf( fpout, "Exp_Mult   %d\n",		race->exp_multiplier	); 
    fprintf( fpout, "Attacks    %s\n",		print_bitvector(&race->attacks)	);
    fprintf( fpout, "Defenses   %s\n",		print_bitvector(&race->defenses) );
    fprintf( fpout, "Height     %d\n",		race->height		);
    fprintf( fpout, "Weight     %d\n",		race->weight		);
    fprintf( fpout, "Hunger_Mod  %d\n",		race->hunger_mod	);
    fprintf( fpout, "Thirst_mod  %d\n",		race->thirst_mod	);
    fprintf( fpout, "Mana_Regen  %d\n",		race->mana_regen	);
    fprintf( fpout, "HP_Regen    %d\n",		race->hp_regen		);
    fprintf( fpout, "Race_Recall %d\n",		race->race_recall	);
    for ( i = 0; i < MAX_WHERE_NAME; i++ )
	fprintf( fpout, "WhereName  %s~\n",
		race->where_name );

    for ( x = 0; x < top_sn; x++ )
    {
	if ( !skill_table[x]->name || skill_table[x]->name[0] == '\0' )
	   break;
	if ( (y=skill_table[x]->race_level[ra]) < LEVEL_IMMORTAL )
	  fprintf( fpout, "Skill '%s' %d %d\n",
		skill_table[x]->name, y, skill_table[x]->race_adept[ra] );
    }
    fprintf( fpout, "End\n" );
    fclose( fpout );
}


if not i'll post some more. Thanks for your Help man
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Thu 01 Apr 2004 05:40 PM (UTC)  quote  ]
Message
Possible problem: can you paste fread_race? What I can see, its reading it into a variable called race_name_color, but is this variable ever being assigned into the structure? Why not read it directly into race_table[x]->race_name_color? That might be why it seems empty.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Thu 01 Apr 2004 05:34 PM (UTC)  quote  ]
Message
well my first intentions were to do classes and races. we got switched up somewhere along the lines, so i just went with races, and then i would figure out the class from what i did with the races. and yes, i do have get_race_name_color(wch) in my do_who function.

i set the showrace to race_name_color, but it doesn't show anything. here is my output:


<   > showrace
Syntax: showrace  
 0>             1>             2>             3>             4>            
 5>             6>             7>             8>             9>            
10>            11>            12>            13>            14>            
15>            16>            17>            18>            19>            
 


so for some reason i'm still not getting anything. i have in my .race files all the namecolor's. so i'm just missing something somewhere.
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Thu 01 Apr 2004 05:08 PM (UTC)  quote  ]
Message
Quote:
when i use both i get a clean compile, but here is my output:

[ 66 Cleric ] Gomer the great ()
Since we can't see the colors, I'm assuming that it is supposed to be in the ()? Earlier, you were talking about coloring class names, not races, so why you were adding race... I beleive things got confused somewhere, likely on my part. This should be the code your using?
if ( xIS_SET(wch->act, PLR_WIZINVIS) )
	  sprintf( invis_str, "(%d) ", wch->pcdata->wizinvis );
	else
	  invis_str[0] = '\0';
	sprintf( buf, "&w[&W%*s%-15s&w] %s%s%s%s%s%s%s%s.%s%s%s &w(&W%s&w)\n\r",
	  (fGroup ? whogr->indent : 0), "",
	  class,
	  invis_str,
          (wch->desc && wch->desc->connected) ? "" : "",
	  xIS_SET(wch->act, PLR_AFK) ? "" : "",
	  xIS_SET(wch->act, PLR_ATTACKER) ? "" : "",
	  xIS_SET(wch->act, PLR_KILLER) ? "" : "",
	  xIS_SET(wch->act, PLR_THIEF)  ? ""  : "",
	  char_name,
	  	  wch->pcdata->title,
          extra_title,
	  clan_name,
	  council_name,
	  get_race_name_color(wch));


Heh, so in all this I think you were trying to color class names, but we ended up coloring races, which is not what you wanted, yes? as to why the () has nothinh between then... I dunno? Can you confirm that race_name_color is being read in properly, I don't know the command, but... showrace? If it is, then there is something else wrong, but it makes it easier to narrow down.

As to the colored classes, I guess we have to start over again with that.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Thu 01 Apr 2004 03:34 PM (UTC)  quote  ]

Amended on Thu 01 Apr 2004 03:42 PM (UTC) by Ithildin

Message
yep,

Name Dwarf~
Namecolor &ODwarf~
Race 2

that is in my .race file.


but i had modified that myself. i just went into the file and edited it.
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Thu 01 Apr 2004 03:04 PM (UTC)  quote  ]
Message
I have meant, do you have the value of the field set differently? Like, did you modify setrace(?) so that you can make the race_name_color fiend different than that of race_name? Cause if its defaulting to the same one, that might be the problem.

For example, you can check your racial files, does it look like this?

Name Human~
Namecolor &RHuman&D~

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by Ithildin   USA  (262 posts)  [Biography] bio
Date Thu 01 Apr 2004 12:52 PM (UTC)  quote  ]
Message
what i have in my code, is what i have. is there somewhere i else i need to put it?
[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.


9,036 views.

This is page 3, subject is 4 pages long:  [Previous page]  1  2  3 4  [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]