Greetings,
How would one do this? I have this writing to a file but it
prints garbage. Any help is appreciated. Everything but the spell_fun
writes to a file perfectly.
void save_skills (void)
{
FILE *fp;
char buf[MAX_STRING_LENGTH];
int i,x,y;
fclose (fpReserve);
if (!(fp = fopen (SKILL_FILE, "w")))
{
log_string("Cannot open skills.txt file!");
return;
}
for (i = 0; i < MAX_SKILL; i++)
{
fprintf (fp, "%s\n", skill_table[i].name);
for (x = 0; x < MAX_CLASS; x++)
{
fprintf (fp, "%d
",skill_table[i].skill_level[x]);
}
fprintf (fp, "\n");
for (y = 0; y < MAX_CLASS; y++)
{
fprintf (fp, "%d ",skill_table[i].rating[y]);
}
fprintf (fp, "\n");
fprintf(fp, "%s\n",skill_table[i].spell_fun);
fprintf(fp, "%d\n",skill_table[i].target);
fprintf(fp, "%d\n",skill_table[i].minimum_position);
fprintf(fp, "%s\n",skill_table[i].pgsn);
fprintf(fp, "%d\n",skill_table[i].slot);
fprintf(fp, "%d\n",skill_table[i].min_mana);
fprintf(fp, "%d\n",skill_table[i].beats);
fprintf(fp, "%s\n",skill_table[i].noun_damage);
fprintf(fp, "%s\n",skill_table[i].msg_off);
fprintf(fp, "%s\n",skill_table[i].msg_obj);
fprintf(fp, "%d\n",skill_table[i].cabal);
fprintf(fp, "%d\n",skill_table[i].race);
fprintf(fp, "%d\n",skill_table[i].align);
fprintf(fp, "%d\n",skill_table[i].group);
}
fclose (fp);
fpReserve = fopen( NULL_FILE, "r" );
}
Thanks in Advance for any advice :P
------------------------------------------------------------------------------------------------------------------
Transported to a surreal landscape, a young girl kills the first woman
she meets and then teams up with three complete strangers to kill again.
- Marin County newspaper's TV listing for The Wizard of Oz
I can bend minds with my spoon
NON OMNIS MORIAR
Keith Mervine
Raytheon ITSS -- Goddard Space Flight Center
NMS Developer/Resident Remedy Guru
301-286-0035
------------------------------------------------------------------------------------------------------------------