Well! Yeah you can't load the gsn pointers from a file.
The only thing I can think of is set up a second table that has the
gsns, like...
{"backstab", &gsn_backstab},
{"haggle", &gsn_haggle},
etc...
{NULL, NULL}
Then after you load the skill/spell data on bootup, go through that
table and fill in the gsns.
for (i = 0; gsn_table[i].name != NULL; i++)
{
int skill;
if ((skill = skill_lookup(gsn_table[i].name)) != -1)
skill_table[skill].gsn = gsn_table[i].gsn;
}
or something like that.
--Palrich.
On Thu, 31 Mar 2005 12:24:22 -0700, omar miisa <[EMAIL PROTECTED]> wrote:
> what im trying to do is make an online skill/spell editor. ive come across a
> little snag tho, which is gsn's. i dont know how to load a gsn from a file
> and assign it to the gsn_xx integer. so as a result, none of my skills ever
> work, they may as well be set to 0% instead of 100%.
>
> i made a little function to turn a spell/skill name into a gsn, and
> accordingly they all match the ones in db.c and merc.h, however i just dont
> have a clue how i can load backstab, and do this:
>
> else if ( !str_cmp( field, "GSN" ) )
> *skill_table[i].pgsn = fread_word( fp );
>
> u see the dilemma, obviously since pgsn is "sh_int *pgsn" it doesnt like
> fread_word...or *fread_word(fp) or anything...i suspect this is probably
> either impossible or really easy lol.
>
> i hope this post makes sense
>
> -omar