Welcome to the Builder Academy

Question Races

More
21 Jun 2012 18:01 #145 by Papaya Pete
Replied by Papaya Pete on topic Re: Races
Yeah I did, right after #include "genobj.h" I put #include "races.h".

Now that I think about it, there was one addition I was making to the code as I was putting in this snippit: I added two additional races, but copied the same format as the standard three races you've coded in. Not sure if that would cause this problem though...

By tonight I'll try starting from scratch and just add in those standard three, if it still doesn't work.

Please Log in or Create an account to join the conversation.

More
21 Jun 2012 18:07 #146 by Liko
Replied by Liko on topic Re: Races

Papaya Pete wrote: Yeah I did, right after #include "genobj.h" I put #include "races.h".

Now that I think about it, there was one addition I was making to the code as I was putting in this snippit: I added two additional races, but copied the same format as the standard three races you've coded in. Not sure if that would cause this problem though...

By tonight I'll try starting from scratch and just add in those standard three, if it still doesn't work.


Those would not affect it. It's something small. Are you getting the same errors?

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

More
21 Jun 2012 18:11 - 21 Jun 2012 18:12 #147 by Papaya Pete
Replied by Papaya Pete on topic Re: Races

Those would not affect it. It's something small. Are you getting the same errors?


The same errors as mentioned earlier? Yeah, sure am.
Code:
gcc -g -O2 -Wall -Wno-char-subscripts -c -o dg_variables.o dg_variables.c dg_variables.c: In function ‘find_replacement’: dg_variables.c:972:13: warning: statement with no effect dg_variables.c:972:25: error: expected expression before ‘=’ token dg_variables.c:978:22: error: expected ‘)’ before ‘;’ token gg_variables.c:978:22: error: too few arguments to function ‘sprinttype’

Haha, you know, if it is small, if I walk away for a few hours and then take another look at it I'll probably find it. :P
Last edit: 21 Jun 2012 18:12 by Papaya Pete.

Please Log in or Create an account to join the conversation.

More
21 Jun 2012 18:18 #148 by Halenbane
Replied by Halenbane on topic Re: Races

Papaya Pete wrote:

Those would not affect it. It's something small. Are you getting the same errors?


The same errors as mentioned earlier? Yeah, sure am.
Code:
gcc -g -O2 -Wall -Wno-char-subscripts -c -o dg_variables.o dg_variables.c dg_variables.c: In function ‘find_replacement’: dg_variables.c:972:13: warning: statement with no effect dg_variables.c:972:25: error: expected expression before ‘=’ token dg_variables.c:978:22: error: expected ‘)’ before ‘;’ token gg_variables.c:978:22: error: too few arguments to function ‘sprinttype’

Haha, you know, if it is small, if I walk away for a few hours and then take another look at it I'll probably find it. :P


Can you post lines 900 - 1000 of your dg_variables.c?

Should make it easier to narrow down based on your errors.

Please Log in or Create an account to join the conversation.

More
21 Jun 2012 18:21 #149 by Papaya Pete
Replied by Papaya Pete on topic Re: Races
You got it.
Code:
else *str = '\0'; } break; case 'p': /* Thanks to Christian Ejlertsen for this idea And to Ken Ray for speeding the implementation up :)*/ if (!str_cmp(field, "pos")) { if (subfield && *subfield) { for (i = POS_SLEEPING; i <= POS_STANDING; i++) { /* allows : Sleeping, Resting, Sitting, Fighting, Standing */ if (!strn_cmp(subfield, position_types[i], strlen(subfield))) { GET_POS(c) = i; break; } } } snprintf(str, slen, "%s", position_types[GET_POS(c)]); } else if (!str_cmp(field, "prac")) { if (subfield && *subfield) { int addition = atoi(subfield); GET_PRACTICES(c) = MAX(0, GET_PRACTICES(c) + addition); } snprintf(str, slen, "%d", GET_PRACTICES(c)); } else if (!str_cmp(field, "pref")) { if (subfield && *subfield) { int pref = get_flag_by_name(preference_bits, subfield); if (!IS_NPC(c) && pref != NOFLAG && PRF_FLAGGED(c, pref)) strcpy(str, "1"); else strcpy(str, "0"); } else strcpy(str, "0"); } break; case 'q': if (!IS_NPC(c) && (!str_cmp(field, "questpoints") || !str_cmp(field, "qp") || !str_cmp(field, "qpnts"))) { if (subfield && *subfield) { int addition = atoi(subfield); GET_QUESTPOINTS(c) += addition; } snprintf(str, slen, "%d", GET_QUESTPOINTS(c)); } else if (!str_cmp(field, "quest")) { if (!IS_NPC(c) && (GET_QUEST(c) != NOTHING) && (real_quest(GET_QUEST(c)) != NOTHING)) snprintf(str, slen, "%d", GET_QUEST(c)); else strcpy(str, "0"); } else if (!str_cmp(field, "questdone")) { if (!IS_NPC(c) && subfield && *subfield) { int q_num = atoi(subfield); if (is_complete(c, q_num)) strcpy(str, "1"); else strcpy(str, "0"); } else strcpy(str, "0"); } break; case 'r': if (!str_cmp(field, "race")) { if (subfield && *subfield) { int ra = get_race_by_name(subfield); if (ra != -1) { GET_RACE(c) = ra; snprintf(str, slen, "1"); } else { snprintf(str, slen, "0"); } } else sprinttype(GET_RACE(c), pc_race_types, str, slen); } else if (!str_cmp(field, "room")) { /* in NOWHERE, return the void */ /* see note in dg_scripts.h */ #ifdef ACTOR_ROOM_IS_UID snprintf(str, slen, "%c%ld",UID_CHAR, (IN_ROOM(c)!= NOWHERE) ? (long) world[IN_ROOM(c)].number + ROOM_ID_BASE : ROOM_ID_BASE); #else snprintf(str, slen, "%d", (IN_ROOM(c)!= NOWHERE) ? world[IN_ROOM(c)].number : 0); #endif } break; case 's': if (!str_cmp(field, "saving_breath")) { if (subfield && *subfield) { int addition = atoi(subfield); GET_SAVE(c, SAVING_SPELL) += addition; } snprintf(str, slen, "%d", GET_SAVE(c, SAVING_BREATH)); } else if (!str_cmp(field, "saving_para")) { if (subfield && *subfield) { int addition = atoi(subfield);

Please Log in or Create an account to join the conversation.

More
21 Jun 2012 18:33 #152 by Liko
Replied by Liko on topic Re: Races

Halenbane wrote:

Papaya Pete wrote:

Those would not affect it. It's something small. Are you getting the same errors?


The same errors as mentioned earlier? Yeah, sure am.
Code:
gcc -g -O2 -Wall -Wno-char-subscripts -c -o dg_variables.o dg_variables.c dg_variables.c: In function ‘find_replacement’: dg_variables.c:972:13: warning: statement with no effect dg_variables.c:972:25: error: expected expression before ‘=’ token dg_variables.c:978:22: error: expected ‘)’ before ‘;’ token gg_variables.c:978:22: error: too few arguments to function ‘sprinttype’

Haha, you know, if it is small, if I walk away for a few hours and then take another look at it I'll probably find it. :P


Can you post lines 900 - 1000 of your dg_variables.c?

Should make it easier to narrow down based on your errors.


Now can you show lines 972 and 978.

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

Time to create page: 0.195 seconds