Race based skills, guidance/help needed. (long)

Posted by Krypt on Fri 17 Feb 2006 12:28 AM — 5 posts, 24,598 views.

#0
I know this was asked quite a bit on the ROM mailing list years back but I wasnt able to find much help rooting through the old digests other than the tail end of various discussions. Bascially what I want to do is take the skills I list in const.c in the race table *ie elves sneak/hide, giants bash etc* and not just have it class specific. So an elf that is a mage still gets sneak etc. Or a giant mage still gets bash if someone decided to pick such a combo. LOL. I still want them though to have to practice these skills, they just get them free like was intended in stock as far as classes are concerned and still start with 1% proficiency just like anyone else..perhaps 40% like the weapon of choice which was what i tried...

I know from what I read I need to insert something in the nanny in comm.c and add another field or check to the various tables in const.c. Race and/or skills/spells table/s.
But from there on I'm not much having any success.
_______________________________________________


what I have already tried with no success, from what Ive read on the old ROM digest list
in the nanny function under,
for ( i = 0; i < 5; i++ )
{
if ( pc_race_table[race].skills[i] == NULL )
break;
group_add( ch, pc_race_table[race].skills[i], FALSE );

I added,

}
for ( i = 0; i < 5; i++ )
{
if ( pc_race_table[race].skills[i] == NULL )
break;
skill_add( ch, pc_race_table[race].skills[i] );
}
group_add( ch, "rom basics", FALSE );
sprintf( buf, "Your Faerie Godmother waves her wand and {BPOOF{x! You turn into a %s.\n\r", pc_race_table[race].name );
send_to_char( buf, ch );

(i kept the faerie godmother bit just for giggles)

and in skill.c added
void skill_add( CHAR_DATA *ch, const char *name )
{
int sn;

sn = skill_lookup(name);

if (ch->pcdata->learned[sn] == 1)
{
ch->pcdata->learned[sn] = 40;
}
return;
}
and then modified my skill/spell tables with a FALSE, before the SLOT() and replaced this FALSE with a TRUE for those skills I wanted to be given to a certain race regardless of class. using stock, something like

{
"sneak", { 53, 53, 4, 10 }, { 0, 0, 4, 6},
spell_null, TAR_IGNORE, POS_STANDING,
&gsn_sneak, TRUE, SLOT( 0), 0, 12,
"", "You no longer feel stealthy.", "",
"$n no longer looks stealthy."
},

Anyhow be appreciated if someone could steer me in the right direction. Side note it did compile although skills didnt get applied and mana costs were in the 500 plus range now for spells LOL. I'm pretty sure I need the extra entry in the tables, that much i feel Ive done right LOL but definitely willing to go about it any other way as well whichever is easiest.
#1
I gave up on this not long after i posted for help.
That said I recently downloaded rom 2.4b6 again and modified it some, added a lot of races/class, area's, spell's, skills etc, colour and olc, note system, for the kids to play with on the home network. Great way to help them work on reading without them knowing thats what they are doing :)yeah i know sneaky :)

anyhow I'm trying to again make skills that carry over to a given race regardless of class. I saw on a different forum
someone mentioned the nanny function,


for (i = 0; i < 5; i++)	{	    
                    if (pc_race_table[race].skills[i] == NULL)	 	
                            break;	    
                    group_add(ch,pc_race_table[race].skills[i],FALSE);	
         }



and to replace the group_add to


ch->pcdata->learned[skill_table[skill_lookup(pc_race_table[race].skills[i])]]= 75;



which i did, unfortunately when i try to compile i get an error, pointing to that specific line.
Was wondering if anyone has a somewhat simple way for me to do this? or could walk me through (Racial skills)

Amended on Mon 18 Apr 2011 04:07 AM by Nick Gammon
Australia Forum Administrator #2
What error?
#3
array subscript is not an integer
Australia Forum Administrator #4
I don't understand that replacement code. There are about 3 subscripts there. You need to break that up a bit and work out which one it is referring to.

For example,


skill_lookup(pc_race_table[race].skills[i])


is a subscript, so does that return an integer?