Ok, so I know this may sound... vague, but I was compiling and in my syslog I got this:
Sat Jan 27 14:17:56 2007 :: [*****] BUG: Slot_lookup: bad slot 10.
Where should I look to find the problem? Just beforehand I was coding in comm.c... I had edited the player struct to support WIS again (Head Coder, whom we fired took it out...) and everything compiled fine... just won't boot.
Not sure I could tell you what exactly your problem is there, but the bug it's generating on you is coming from magic.c here:
int slot_lookup( int slot )
{
extern bool fBootDb;
int sn;
if( slot <= 0 )
return -1;
for( sn = 0; sn < top_sn; sn++ )
if( slot == skill_table[sn]->slot )
return sn;
if( fBootDb )
{
bug( "Slot_lookup: bad slot %d.", slot );
abort( );
}
return -1;
}
Ok, I found out exactly what went wrong. While I was editing mud.h the fatal error occurred. I add in an apply-type, the one used for applying affects to objects. This offset my list so that when one of my 4 areas (still trying to get the code on its feet, so they are stock) tried to address the old apply type for constitution it read back APPLY_WIS, which... evidently points nowhere.
So! Question time: How do I make it so that APPLY_WIS affects the phantom stat WIS. I added it into all the character creation stuff in comm.c, I added it to the player struct, all of that crazy stuff, but evidently it doesn't actually GO anywhere yet... So I guess I'm asking how do I add a stat?
The version I'm using has only four stats and I'd like to add Wisdom in there. Perhaps I could call it something else (side question: How hard, meaning where would I have to look to change the name of the stats so they are what I want, instead of stock?).
I'm not sure that I know, off-hand, how to answer your first question, but for what the stats are called, from the player perspective you'd only have to change what's displayed in do_score, do_oldscore, do_newscore and possibly the way extra affects display in the identify spell.
I think adding stats is as easy as adding a new data member to the structure. Then you just refer to it wherever you need it; add a get_stat function in handler.c (like for get_str, get_current_str, etc.). And finally you add it to the score display.
As for changing the name: what Conner said.
See... it is that easy, that adds the stat, the problem is, that things like mset don't identify it, even though I put the apply-type in the apply structure (APPLY_CON, APPLY_INT, APPLY_KICK, etc.) but it just doesn't register with the MUD that the stat exists.
Eureka! I haven't solved my problem, nay, but I did find the source. My apply types and affects types, all that stuff has been thrown off.
I added in new affect types, because, well... we had new skills, etc, etc. Anyways, now when I set an affect type, like say... Truesight, it gives me something WAY off, like Detect Evil. How can I set my affect/apply types right?
Make sure that you add it to the matching array in build.c in the same order as you've added it to mud.h.