Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, DotBot

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » A little help? Working on set...
Forum Rules | Mark all | Recent Posts

A little help? Working on setting up new languages... still a newbie
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Nov 18, 2008, 4:04 pm
Go to the top of the page
Go to the bottom of the page

strider
Fledgling
GroupMembers
Posts13
JoinedNov 18, 2008

John@ellessar /cygdrive/d/MUD/mysmaugfuss/src
$ make
make -s smaug
Compiling o/act_comm.o....
act_comm.c: In function `int knows_language(CHAR_DATA*, int, CHAR_DATA*)':
act_comm.c:2693: error: `LANG_WESTRON' undeclared (first use this function)
act_comm.c:2693: error: (Each undeclared identifier is reported only once for ea
ch function it appears in.)
act_comm.c: At global scope:
act_comm.c:2759: error: `LANG_WESTRON' was not declared in this scope
act_comm.c:2759: error: `LANG_SINDARIN' was not declared in this scope
act_comm.c:2759: error: `LANG_KHUZDUL' was not declared in this scope
act_comm.c:2759: error: `LANG_VALARIN' was not declared in this scope
act_comm.c:2760: error: `LANG_ENTISH' was not declared in this scope
act_comm.c:2760: error: `LANG_BLACKSPEECH' was not declared in this scope
act_comm.c:2761: error: `LANG_QUENYA' was not declared in this scope
act_comm.c:2761: error: `LANG_ANDUNAIC' was not declared in this scope
act_comm.c:2761: error: `LANG_TELERIN' was not declared in this scope
act_comm.c:2762: error: `LANG_DRACONIC' was not declared in this scope
act_comm.c: In function `void do_languages(CHAR_DATA*, const char*)':
act_comm.c:2862: error: `LANG_WESTRON' undeclared (first use this function)
make[1]: *** [o/act_comm.o] Error 1
make: *** [all] Error 2

if( IS_SET( language, LANG_WESTRON ) )
return 100;
if( language & LANG_CLAN )
{
/*
* Clan = common for mobs.. snicker.. -- Altrag
*/
if( IS_NPC( ch ) || IS_NPC( cch ) )
return 100;
if( ch->pcdata->clan == cch->pcdata->clan && ch->pcdata->clan != NULL )
return 100;
}
if( !IS_NPC( ch ) )
{
int lang;

/*
* Racial languages for PCs
*/
if( IS_SET( race_table[ch->race]->language, language ) )
return 100;

for( lang = 0; lang_array[lang] != LANG_UNKNOWN; lang++ )
if( IS_SET( language, lang_array[lang] ) && IS_SET( ch->speaks, lang_array[lang] ) )
{
if( ( sn = skill_lookup( lang_names[lang] ) ) != -1 )
return ch->pcdata->learned[sn];
}
}
return 0;
}

bool can_learn_lang( CHAR_DATA * ch, int language )
{
if( language & LANG_CLAN )
return FALSE;
if( IS_NPC( ch ) || IS_IMMORTAL( ch ) )
return FALSE;
if( race_table[ch->race]->language & language )
return FALSE;
if( ch->speaks & language )
{
int lang;

for( lang = 0; lang_array[lang] != LANG_UNKNOWN; lang++ )
if( language & lang_array[lang] )
{
int sn;

if( !( VALID_LANGS & lang_array[lang] ) )
return FALSE;
if( ( sn = skill_lookup( lang_names[lang] ) ) < 0 )
{
bug( "Can_learn_lang: valid language without sn: %d", lang );
continue;
}
if( ch->pcdata->learned[sn] >= 99 )
return FALSE;
}
}
if( VALID_LANGS & language )
return TRUE;
return FALSE;
}

int const lang_array[] = {
LANG_WESTRON, LANG_SINDARIN, LANG_KHUZDUL, LANG_VALARIN,
LANG_ENTISH, LANG_ORCISH, LANG_TROLLISH, LANG_BLACKSPEECH,
LANG_QUENYA, LANG_ANDUNAIC, LANG_TELERIN,
LANG_DRACONIC, LANG_CLAN, LANG_UNKNOWN
};

const char *const lang_names[] = {
"Westron", "Sindarin", "Khuzdul", "Valarin",
"Entish", "Orcish", "Troll", "Black Speech",
"Quenya", "Andunaic", "Telerin",
"Draconic", "Clan", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "" /* pad to 32 for compat with flag_string */
};
       
Post is unread #2 Nov 18, 2008, 4:20 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

You'll probably want to check mud.h I believe there's a set of bitvector defines in there for languages that need changed as well.
       
Post is unread #3 Nov 18, 2008, 4:29 pm
Go to the top of the page
Go to the bottom of the page

strider
Fledgling
GroupMembers
Posts13
JoinedNov 18, 2008

oh duh... I was actually in mud.h when I read this and still hadn't figured it out.

Thanks.
       
Post is unread #4 Nov 18, 2008, 5:05 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Np. That's what I'm here for. Well, aside from keeping the packages up to date, and you know, the site working and all... so much to do...
       
Post is unread #5 Nov 18, 2008, 6:09 pm
Go to the top of the page
Go to the bottom of the page

strider
Fledgling
GroupMembers
Posts13
JoinedNov 18, 2008

John@ellessar /cygdrive/d/mud/mysmaugfuss/src
$ make
make -s smaug
Compiling o/comm.o....
comm.c:2269: error: expected unqualified-id before '{' token
comm.c:2269: error: expected `,' or `;' before '{' token
make[1]: *** [o/comm.o] Error 1
make: *** [all] Error 2

void nanny_get_new_class( DESCRIPTOR_DATA * d, const char *argument )
{
CHAR_DATA *ch;
char buf[MAX_STRING_LENGTH];
char arg[MAX_STRING_LENGTH];
int iClass, iRace;

ch = d->character;
argument = one_argument( argument, arg );

if( !str_cmp( arg, "help" ) )
{

for( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
{
if( class_table[iClass]->who_name && class_table[iClass]->who_name[0] != '\0' )
{
if( toupper( argument[0] ) == toupper( class_table[iClass]->who_name[0] )
&& !str_prefix( argument, class_table[iClass]->who_name ) )
{
do_help( ch, argument );
write_to_buffer( d, "Please choose a class: ", 0 );
return;
}
}
}
write_to_buffer( d, "No such help topic. Please choose a class: ", 0 );
return;
}

for( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
{
if( class_table[iClass]->who_name && class_table[iClass]->who_name[0] != '\0' )
{
if( toupper( arg[0] ) == toupper( class_table[iClass]->who_name[0] )
&& !str_prefix( arg, class_table[iClass]->who_name ) )
{
ch->Class = iClass;
break;
}
}
}

if( iClass == MAX_PC_CLASS
|| !class_table[iClass]->who_name
|| class_table[iClass]->who_name[0] == '\0' || !str_cmp( class_table[iClass]->who_name, "unused" ) )
{
write_to_buffer( d, "That's not a class.\r\nWhat IS your class? ", 0 );
return;
}


if( check_bans( ch, BAN_CLASS ) )
{
write_to_buffer( d, "That class is not currently avaiable.\r\nWhat IS your class? ", 0 );
return;
}

write_to_buffer( d, "\r\nYou may choose from the following races, or type help [race] to learn more:\r\n[", 0 );
buf[0] = '\0';
for( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
{
/*if( iRace != RACE_VAMPIRE
&& race_table[iRace]->race_name && race_table[iRace]->race_name[0] != '\0'
&& !IS_SET( race_table[iRace]->class_restriction, 1 << ch->Class )
&& str_cmp( race_table[iRace]->race_name, "unused" ) )
{ */
if( iRace > 0 )
{
if( strlen( buf ) + strlen( race_table[iRace]->race_name ) > 77 )
{
mudstrlcat( buf, "\r\n", MAX_STRING_LENGTH );
write_to_buffer( d, buf, 0 );
buf[0] = '\0';
}
else
mudstrlcat( buf, " ", MAX_STRING_LENGTH );
}
mudstrlcat( buf, race_table[iRace]->race_name, MAX_STRING_LENGTH );
}
}
{ ----------------------------------------------------------- 2269

mudstrlcat( buf, "]\r\n: ", MAX_STRING_LENGTH );
write_to_buffer( d, buf, 0 );
d->connected = CON_GET_NEW_RACE;
}


Stumped again, but didn't want to start a new thread.

       
Post is unread #6 Nov 18, 2008, 6:28 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Remove that { on 2269. It's extra. Not sure where it came from.
       
Post is unread #7 Nov 18, 2008, 9:53 pm
Go to the top of the page
Go to the bottom of the page

strider
Fledgling
GroupMembers
Posts13
JoinedNov 18, 2008

John@ellessar /cygdrive/d/mud/mysmaugfuss/src
$ make
make -s smaug
Compiling o/comm.o....
comm.c: In function `void nanny_get_new_class(DESCRIPTOR_DATA*, const char*)':
comm.c:2278: error: expected init-declarator before "CHAR_DATA"
comm.c:2278: error: expected `,' or `;' before "CHAR_DATA"
comm.c:2279: error: redeclaration of `char arg[4096]'
comm.c:2192: error: `char arg[4096]' previously declared here
comm.c:2280: error: redeclaration of `int iRace'
comm.c:2193: error: `int iRace' previously declared here
comm.c: In function `void nanny(DESCRIPTOR_DATA*, char*)':
comm.c:2641: error: `nanny_get_new_race' undeclared (first use this function)
comm.c:2641: error: (Each undeclared identifier is reported only once for each f
unction it appears in.)
make[1]: *** [o/comm.o] Error 1
make: *** [all] Error 2


void nanny_get_new_race( DESCRIPTOR_DATA * d, const char *argument )

CHAR_DATA *ch;<---------------------------2278
char arg[MAX_STRING_LENGTH];<------------------------2279
int iRace;

ch = d->character;
argument = one_argument( argument, arg );
if( !str_cmp( arg, "help" ) )
{
for( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
{
if( toupper( argument[0] ) == toupper( race_table[iRace]->race_name[0] )
&& !str_prefix( argument, race_table[iRace]->race_name ) )
{
do_help( ch, argument );
write_to_buffer( d, "Please choose a race: ", 0 );
return;
}
}
write_to_buffer( d, "No help on that topic. Please choose a race: ", 0 );
return;
}


for( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
{
if( toupper( arg[0] ) == toupper( race_table[iRace]->race_name[0] )
&& !str_prefix( arg, race_table[iRace]->race_name ) )
{
ch->race = iRace;
break;
}
}

if( iRace == MAX_PC_RACE
|| !race_table[iRace]->race_name || race_table[iRace]->race_name[0] == '\0'
/*|| iRace == RACE_VAMPIRE */
|| IS_SET( race_table[iRace]->class_restriction, 1 << ch->Class )
|| !str_cmp( race_table[iRace]->race_name, "unused" ) )
{
write_to_buffer( d, "That's not a race.\r\nWhat IS your race? ", 0 );
return;
}

if( check_bans( ch, BAN_RACE ) )
{
write_to_buffer( d, "That race is not currently available.\r\nWhat is your race? ", 0 );
return;
}

write_to_buffer( d, "\r\nWould you like RIP, ANSI or no graphic/color support, (R/A/N)? ", 0 );
d->connected = CON_GET_WANT_RIPANSI;
}[b]


void nanny_get_new_class( DESCRIPTOR_DATA * d, const char *argument )
{
CHAR_DATA *ch;
char buf[MAX_STRING_LENGTH];
char arg[MAX_STRING_LENGTH]; <-----------------------2192
int iClass, iRace; <---------------2193

ch = d->character;
argument = one_argument( argument, arg );

if( !str_cmp( arg, "help" ) )
{

for( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
{
if( class_table[iClass]->who_name && class_table[iClass]->who_name[0] != '\0' )
{
if( toupper( argument[0] ) == toupper( class_table[iClass]->who_name[0] )
&& !str_prefix( argument, class_table[iClass]->who_name ) )
{
do_help( ch, argument );
write_to_buffer( d, "Please choose a class: ", 0 );
return;
}
}
}
write_to_buffer( d, "No such help topic. Please choose a class: ", 0 );
return;
}

for( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
{
if( class_table[iClass]->who_name && class_table[iClass]->who_name[0] != '\0' )
{
if( toupper( arg[0] ) == toupper( class_table[iClass]->who_name[0] )
&& !str_prefix( arg, class_table[iClass]->who_name ) )
{
ch->Class = iClass;
break;
}
}
}

if( iClass == MAX_PC_CLASS
|| !class_table[iClass]->who_name
|| class_table[iClass]->who_name[0] == '\0' || !str_cmp( class_table[iClass]->who_name, "unused" ) )
{
write_to_buffer( d, "That's not a class.\r\nWhat IS your class? ", 0 );
return;
}


if( check_bans( ch, BAN_CLASS ) )
{
write_to_buffer( d, "That class is not currently avaiable.\r\nWhat IS your class? ", 0 );
return;
}

write_to_buffer( d, "\r\nYou may choose from the following races, or type help [race] to learn more:\r\n[", 0 );
buf[0] = '\0';
for( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
{
if( iRace != RACE_CREATOR
&& race_table[iRace]->race_name && race_table[iRace]->race_name[0] != '\0'
&& !IS_SET( race_table[iRace]->class_restriction, 1 << ch->Class )
&& str_cmp( race_table[iRace]->race_name, "unused" ) )
{
if( iRace > 0 )
{
if( strlen( buf ) + strlen( race_table[iRace]->race_name ) > 77 )
{
mudstrlcat( buf, "\r\n", MAX_STRING_LENGTH );
write_to_buffer( d, buf, 0 );
buf[0] = '\0';
}
else
mudstrlcat( buf, " ", MAX_STRING_LENGTH );
}
mudstrlcat( buf, race_table[iRace]->race_name, MAX_STRING_LENGTH );
}
}
{

mudstrlcat( buf, "]\r\n: ", MAX_STRING_LENGTH );
write_to_buffer( d, buf, 0 );
d->connected = CON_GET_NEW_RACE;
}
       
Post is unread #8 Nov 18, 2008, 10:31 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

void nanny_get_new_race( DESCRIPTOR_DATA * d, const char *argument )
 
CHAR_DATA *ch;<---------------------------2278
  char arg[MAX_STRING_LENGTH];<------------------------2279


Should look like:

void nanny_get_new_race( DESCRIPTOR_DATA * d, const char *argument )
{
  CHAR_DATA *ch;<---------------------------2278
  char arg[MAX_STRING_LENGTH];<------------------------2279
       
Post is unread #9 Nov 18, 2008, 11:49 pm
Go to the top of the page
Go to the bottom of the page

strider
Fledgling
GroupMembers
Posts13
JoinedNov 18, 2008

So here is a new one.

John@ellessar /cygdrive/d/mud/mysmaugfuss/src
$ make
make -s smaug
Compiling o/act_wiz.o....
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: warning: au
to-importing has been activated without --enable-auto-import specified on the co
mmand line.
This should work unless it involves constant data structures referencing symbols
from auto-imported DLLs.o/act_wiz.o: In function `do_mstat':
/cygdrive/d/mud/mysmaugfuss/src/act_wiz.c:2028: undefined reference to `VAMP_AC(
char_data*)'
o/fight.o: In function `_Z7one_hitP9char_dataS0_i':
/cygdrive/d/mud/mysmaugfuss/src/fight.c:1119: undefined reference to `VAMP_AC(ch
ar_data*)'
o/fight.o: In function `_Z14projectile_hitP9char_dataS0_P8obj_dataS2_s':
/cygdrive/d/mud/mysmaugfuss/src/fight.c:1474: undefined reference to `VAMP_AC(ch
ar_data*)'
o/mud_comm.o: In function `do_mpstat':
/cygdrive/d/mud/mysmaugfuss/src/mud_comm.c:142: undefined reference to `VAMP_AC(
char_data*)'
o/player.o: In function `do_score':
/cygdrive/d/mud/mysmaugfuss/src/player.c:206: undefined reference to `VAMP_AC(ch
ar_data*)'
o/player.o:/cygdrive/d/mud/mysmaugfuss/src/player.c:208: more undefined referenc
es to `VAMP_AC(char_data*)' follow
Info: resolving __timezone by linking to __imp___timezone (auto-import)
collect2: ld returned 1 exit status
make[1]: *** [smaug] Error 1
make: *** [all] Error 2

John@ellessar /cygdrive/d/mud/mysmaugfuss/src
$

I manually went through all my files until it was in the process of making... then on weather.c it spat this out, i tried make clean and make and it spit it out again, this time on the first file.

Any ideas? I've looked at those lines of code, and none of them mention vamp_ac anymore.
       
Post is unread #10 Nov 18, 2008, 11:51 pm
Go to the top of the page
Go to the bottom of the page

strider
Fledgling
GroupMembers
Posts13
JoinedNov 18, 2008

it seems to be erroring on GET_AC... should I try to find where that is defined and see if it still mentions vamp_ac?
       
Post is unread #11 Nov 19, 2008, 12:23 am
Go to the top of the page
Go to the bottom of the page

strider
Fledgling
GroupMembers
Posts13
JoinedNov 18, 2008

It's like bailing water out of a sinking ship... lol

John@ellessar /cygdrive/d/mud/mysmaugfuss/src
$ make
make -s smaug
Compiling o/mud_comm.o....
mud_comm.c: In function `void do_mpstat(CHAR_DATA*, const char*)':
mud_comm.c:144: warning: right-hand operand of comma has no effect
mud_comm.c:144: error: expected `)' before ';' token
make[1]: *** [o/mud_comm.o] Error 1
make: *** [all] Error 2

void do_mpstat( CHAR_DATA* ch, const char* argument)
{
char arg[MAX_INPUT_LENGTH];
MPROG_DATA *mprg;
CHAR_DATA *victim;

one_argument( argument, arg );

if( arg[0] == '\0' )
{
send_to_char( "MProg stat whom?\r\n", ch );
return;
}

if( ( victim = get_char_world( ch, arg ) ) == NULL )
{
send_to_char( "They aren't here.\r\n", ch );
return;
}

if( !IS_NPC( victim ) )
{
send_to_char( "Only Mobiles can have MobPrograms!\r\n", ch );
return;
}
if( get_trust( ch ) < LEVEL_GREATER && xIS_SET( victim->act, ACT_STATSHIELD ) )
{
set_pager_color( AT_IMMORT, ch );
send_to_pager( "Their godly glow prevents you from getting a good look.\r\n", ch );
return;
}
if( xIS_EMPTY( victim->pIndexData->progtypes ) )
{
send_to_char( "That Mobile has no Programs set.\r\n", ch );
return;
}

ch_printf( ch, "Name: %s. Vnum: %d.\r\n", victim->name, victim->pIndexData->vnum );

ch_printf( ch, "Short description: %s.\r\nLong description: %s",
victim->short_descr, victim->long_descr[0] != '\0' ? victim->long_descr : "(none).\r\n" );

ch_printf( ch, "Hp: %d/%d. Mana: %d/%d. Move: %d/%d. \r\n",
victim->hit, victim->max_hit, victim->mana, victim->max_mana, victim->move, victim->max_move );

ch_printf( ch,
"Lv: %d. Class: %d. Align: %d. AC: %d. Gold: %d. Exp: %d.\r\n",
victim->level, victim->Class, victim->alignment, GET_AC( victim ), victim->gold, victim->exp ); <-------144

for( mprg = victim->pIndexData->mudprogs; mprg; mprg = mprg->next )
ch_printf( ch, "%s>%s %s\r\n%s\r\n", ( mprg->fileprog ? "(FILEPROG) " : "" ),
mprog_type_to_name( mprg->type ), mprg->arglist, mprg->comlist );
return;
}
       
Post is unread #12 Nov 19, 2008, 5:46 am
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

I don't really see anything wrong with that, so here, replace it with this one I know compiles, and if you still get that error we're going to have to look a little closer.

void do_mpstat( CHAR_DATA* ch, const char* argument)
{
   char arg[MAX_INPUT_LENGTH];
   MPROG_DATA *mprg;
   CHAR_DATA *victim;

   one_argument( argument, arg );

   if( arg[0] == '\0' )
   {
      send_to_char( "MProg stat whom?\r\n", ch );
      return;
   }

   if( ( victim = get_char_world( ch, arg ) ) == NULL )
   {
      send_to_char( "They aren't here.\r\n", ch );
      return;
   }

   if( !IS_NPC( victim ) )
   {
      send_to_char( "Only Mobiles can have MobPrograms!\r\n", ch );
      return;
   }
   if( get_trust( ch ) < LEVEL_GREATER && xIS_SET( victim->act, ACT_STATSHIELD ) )
   {
      set_pager_color( AT_IMMORT, ch );
      send_to_pager( "Their godly glow prevents you from getting a good look.\r\n", ch );
      return;
   }
   if( xIS_EMPTY( victim->pIndexData->progtypes ) )
   {
      send_to_char( "That Mobile has no Programs set.\r\n", ch );
      return;
   }

   ch_printf( ch, "Name: %s.  Vnum: %d.\r\n", victim->name, victim->pIndexData->vnum );

   ch_printf( ch, "Short description: %s.\r\nLong  description: %s",
              victim->short_descr, victim->long_descr[0] != '\0' ? victim->long_descr : "(none).\r\n" );

   ch_printf( ch, "Hp: %d/%d.  Mana: %d/%d.  Move: %d/%d. \r\n",
              victim->hit, victim->max_hit, victim->mana, victim->max_mana, victim->move, victim->max_move );

   ch_printf( ch,
              "Lv: %d.  Class: %d.  Align: %d.  AC: %d.  Gold: %d.  Exp: %d.\r\n",
              victim->level, victim->Class, victim->alignment, GET_AC( victim ), victim->gold, victim->exp );

   for( mprg = victim->pIndexData->mudprogs; mprg; mprg = mprg->next )
      ch_printf( ch, "%s>%s %s\r\n%s\r\n", ( mprg->fileprog ? "(FILEPROG) " : "" ),
                 mprog_type_to_name( mprg->type ), mprg->arglist, mprg->comlist );
   return;
}
       
Post is unread #13 Nov 19, 2008, 9:13 am
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Might be worth looking at the GET_AC macro.
       
Post is unread #14 Nov 19, 2008, 9:35 am
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

I don't see anything wrong with the distro, it should look like:

#define GET_AC(ch)		((ch)->armor				    \
				    + ( IS_AWAKE(ch)			    \
				    ? dex_app[get_curr_dex(ch)].defensive   \
				    : 0 )				    \
				    + VAMP_AC(ch))


Unless you've changed it. If you have, you need to make sure all the parenthesis are closed.
       
Post is unread #15 Nov 19, 2008, 1:55 pm
Go to the top of the page
Go to the bottom of the page

strider
Fledgling
GroupMembers
Posts13
JoinedNov 18, 2008

well i've removed all the vampire references in the code by commenting them out... except when i comment out the vamp_ac part it makes that error go off.
       
Post is unread #16 Nov 19, 2008, 2:04 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

You'll need to change it to:

#define GET_AC(ch)		((ch)->armor				    \
				    + ( IS_AWAKE(ch)			    \
				    ? dex_app[get_curr_dex(ch)].defensive   \
				    : 0 )				    \
				    /*+ VAMP_AC(ch)*/)


The error you're getting is a missing ) and if you didn't comment it out exactly like I just did, that's where you're missing one.
       
Post is unread #17 Nov 19, 2008, 2:10 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

This is one reason why macros are kind of dangerous. When I see a line with no apparent syntax error but with a macro, I usually think that chances are very high that the macro is at fault. :smile:
       
Post is unread #18 Nov 19, 2008, 2:30 pm   Last edited Nov 19, 2008, 2:32 pm by Kayle
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Yeah, I'm slowly moving away from macros as I convert more and more to C++. It's easier to do ch-> then scroll through till I see the function I want rather than try and remember them all. <3<3<3 Visual Studio and IntelliSense. :P

[Edit:] For stupid use of apostrophes. And again for retarded capitalization. -.-;
       
Post is unread #19 Nov 19, 2008, 10:15 pm
Go to the top of the page
Go to the bottom of the page

strider
Fledgling
GroupMembers
Posts13
JoinedNov 18, 2008

Thanks!

I'm so new to C programming, but I've always wanted to learn a language, so I'm using my nastalgic love of muds to fuel my interest. I still have so much to learn, so I appreciate you guys helping me out by clearly pointing out where I have erred.

Hope that my posts in the next few days don't get to redundant.
       
Post is unread #20 Nov 20, 2008, 12:26 am   Last edited Nov 20, 2008, 12:29 am by Kayle
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

If you're looking to avoid redundancy, the best suggestion I can give you is to always use the search function of the site, or the google custom search before posting. You honestly never know when you might find the answer in old posts. There's still a few things I've found solutions to recently by looking at the older posts.

[Edit:] Also, It helps a ton to use things like the bbcode tags for code when posting code. it's specially set up to use a fixed width font to make it easier to read, and a lot of times easier to spot problems. It's pretty easy, you can click the code button just above the post box, paste in your code, and then click it again to close it, or if you're a shortcuts fan, CTRL+I will insert the appropriate piece of code tag. If you hover over each of the buttons above the box each one tells you what the shortcut for it is. :)
       
Pages:<< prev 1 next >>