Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Skill Table issues: Mixed up skill and spell abilities

Skill Table issues: Mixed up skill and spell abilities

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1 2  

Posted by Dralnu   USA  (277 posts)  Bio
Date Sun 15 May 2005 11:11 PM (UTC)
Message
Did an addition recently, to add in a new config in which I has to alter to get_eq_char bit, and I think it works, now I have a more serious issue: Meditate and Knee.

I had a problem to start with that Knee has messed up and incorporated the following Meditate code into itself (don't ask how). I deleted both from the skills.dat and went into the MUD to make them again. I rebuilt knee, and it works as well as I could hope, but the problem now falls under meditate. It now adds in mistform, the following code. I have no clue why it would do this, and would appreciate some help.
Top

Posted by Robert Powell   Australia  (367 posts)  Bio
Date Reply #1 on Tue 17 May 2005 12:08 AM (UTC)

Amended on Tue 17 May 2005 12:10 AM (UTC) by Robert Powell

Message
I beleive what your saying is that when you sset a skill into the game that it gets set to the wrong code. So that knee now has Code do_meditate as its code entry in skills.dat rather than having spell_smaug or do_knee if there is such a beast.

Now the only place i can think of what you might need to look is in tables.c and check what you return values are, somewhere along the way its returning the wrong code for the skill in question.

I have had this happen to me then i have been rushing and cut and paste but only changed the first do_blaa and not the return.

Another thing tht might be hellpfull is to add the enteries into skills.dat by hand rather than sseting them in, i find this its quicker, it wont fix sloppy tables.c enteries or my bad spelling but one cannot ask for everything.

Hope i have been of some help.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #2 on Tue 17 May 2005 11:25 PM (UTC)
Message
Not exactly what I'm having issues with. The code bit works, but with like meditate and mistwalk, it gets the mistwalk effects mixed with the meditate, and in skills.dat, I don't see the problem. Everything looks to be the right everywhere, but I'll look into tables.c to see if there is an issue there
Top

Posted by Gatewaysysop2   USA  (146 posts)  Bio
Date Reply #3 on Thu 19 May 2005 03:59 PM (UTC)
Message
Sounds like somehow your affects got jumbled up. Have you changed any of the relevant code that might throw these out of order, so that when it tries to apply one affect to a character, it might actually be applying the wrong one? That's one thing I can think of.

Beyond that, what else have you changed? What you talked about recently changing should have had no impact on this what so ever. Maybe you changed something else though and only noticed the problem now? It could be right?

"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #4 on Thu 19 May 2005 05:51 PM (UTC)
Message
Besides adding a new config, I don't know. I think what is happening is that they are just being read wrong somehow, because some of the hitvic and missvic messages are getting crossed without me touching them. I think it might just be a bug that fixed itself, but I don't know really
Top

Posted by Gatewaysysop2   USA  (146 posts)  Bio
Date Reply #5 on Thu 19 May 2005 09:13 PM (UTC)
Message
IMHO a bug that fixes itself is not really fixed and you should really figure it out if you can. You may find out that more is corrupted / not working properly than you thought and this may not be the only "bug" you have now.

Just something to think about.


"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #6 on Fri 20 May 2005 01:39 AM (UTC)
Message
I'll keep that in mind, thanks
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #7 on Sun 22 May 2005 02:09 AM (UTC)
Message
This is the skills I'm having issues with now:

#SKILL
Name meditate~
Type Skill
Info 0
Flags 0
Target 3
Minpos 108
Rounds 32
Code spell_smaug
Dammsg ~
Hitvict You meditate peacefully, gathering mana from the space about you
Missvict You attempt to meditate peacefully, but fail to gather much more then a stiff neck
Affect '' 12 'l*2' -1
Minlevel 1
End

#SKILL
Name mistform~
Type Skill
Info 0
Flags 0
Target 3
Minpos 106
Mana 40
Rounds 6
Code spell_smaug
Dammsg ~
Wearoff Your form becomes once again solid.~
Hitvict You assume a lucent form...~
Hitroom $N's form grows lucent...~
Affect 'l*5' 26 'pass_door' 20
Minlevel 18
End

I don't see a problem, but they seem to be mixing names. I hope that can help someone tell me what the problem might be. I still don't know the codebase that well, and the only change I've made was adding a variable (E and e) to allow a skill to take player weight into account on skills.
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #8 on Wed 25 May 2005 05:26 PM (UTC)

Amended on Wed 25 May 2005 05:30 PM (UTC) by Dralnu

Message
Looked through tables.c, and the returns are good, its just not reading the file right from what I can figure. Meditate doesn't have its own code, as it is spell_smaug. Mistform doesn't have its own code, either, so I'm pretty much stumped on what is going on...

Edit #1:
Wed May 25 12:26:39 2005 :: [****] BUG: load_class_file: Skill mistform unknown

Wed May 25 12:26:39 :: [****] BUG: fread_word: EOF encountered on read.

Wed May 25 12:26:39 :: [****] BUG: load_race_file: no match: Endy


Those are the only bugs I get when starting up the MUD
Top

Posted by Txzeenath   USA  (54 posts)  Bio
Date Reply #9 on Wed 25 May 2005 07:47 PM (UTC)
Message
I can see one thing... Endy should be End..

Darkness comes along thy path, searching, wanting, calling wrath,
shadows awaken, release the light, one and only.. here to fight,
challenge the darkness, the shadows they call, hunting the living,
more and all. Roaring thunder, full of hate, a single bound, seals
your fate.

-Txzeenath

telnet://divineright.org:8088
Alumuble Arda -
*Player owned shops, clans, and housing
*Multiclass & Stat training
*Random mob name generation implemented and Overland mapping.
*Realistic equipment statistics
*Interactive enviroment(weather/sectors)
*Weapon sheaths(scabbards), Throwing weapons
*Automatic crash recovery, saving, and reporting without disconnecting
*Fully customizeable color, Automapper, "Smart" mobiles, Hiscore tables, and more!

Currently running AGE v1.9.6(Originated and modified from Smaug 1.4a)
Top

Posted by Gatewaysysop2   USA  (146 posts)  Bio
Date Reply #10 on Wed 25 May 2005 07:47 PM (UTC)
Message
Well, here's what I see in tables.c, function load_class_file:



		if ( !IS_VALID_SN(sn) )
		{
		    sprintf( buf, "load_class_file: Skill %s unknown", word);
		    bug( buf, 0 );
		}


Apparently you're tripping the "!IS_VALID_SN()" part of this, resulting in the first error message you got.

If you check mud.h for the IS_VALID_SN macro, you find this:


#define IS_VALID_SN(sn)		( (sn) >=0 && (sn) < MAX_SKILL		     \
				&& skill_table[(sn)]			     \
				&& skill_table[(sn)]->name )


Looks to me that you're coming up with an invalid SN for one of the reasons checked here. You might check to ensure that you've not goofed something with these, or mucked with MAX_SKILL perhaps.

Just some ideas, off the top of my head anyway.


"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #11 on Wed 25 May 2005 08:18 PM (UTC)
Message
Looking in skills.dat, I cann't see an issue with that, nor with tables.c or mud.h. Is someone could give me a little more info on what might be happening, I'd appreciate it, as of this time I cann't tell what could be causing what.

case 'S':
if( !str_cmp( word, "Skill" ) )
{
int sn, lev, adp;

word = fread_word( fp );
lev = fread_number( fp );
adp = fread_number( fp );
sn = skill_lookup( word );
if( cl < 0 || cl >= MAX_CLASS )
{
sprintf( buf, "load_class_file: Skill %s -- class bad/not found (%d)", word, cl );
bug( buf, 0 );
}
else if( !IS_VALID_SN( sn ) )
{
sprintf( buf, "load_class_file: Skill %s unknown", word );
bug( buf, 0 );
}
else
{
skill_table[sn]->skill_level[cl] = lev;
skill_table[sn]->skill_adept[cl] = adp;
}
fMatch = TRUE;
break;



#define IS_VALID_SN(sn) ( (sn) >=0 && (sn) < MAX_SKILL \
&& skill_table[(sn)] \
&& skill_table[(sn)]->name )




#SKILL
Name meditate~
Type Skill
Info 0
Flags 0
Target 3
Minpos 108
Rounds 32
Code spell_smaug
Dammsg ~
Hitvict You meditate peacefully, gathering mana from the space about you
Missvict You attempt to meditate peacefully, but fail to gather much more then a stiff neck
Affect '' 12 'l*2' -1
Minlevel 1
End

#SKILL
Name mistform~
Type Skill
Info 0
Flags 0
Target 3
Minpos 106
Mana 40
Rounds 6
Code spell_smaug
Dammsg ~
Wearoff Your form becomes once again solid.~
Hitvict You assume a lucent form...~
Hitroom $N's form grows lucent...~
Affect 'l*5' 26 'pass_door' 20
Minlevel 1
End
Top

Posted by Gatewaysysop2   USA  (146 posts)  Bio
Date Reply #12 on Wed 25 May 2005 11:39 PM (UTC)
Message
Well there's probably something wrong with your skills.dat, perhaps corrupted somehow. Notice the mention of you having an "Endy" instead of "end" in there somewhere. That's one thing you should take another look at. It could be that you're not reading things in wrong but writing them wrong to the file instead. Hard to say without more information.

Have you tried replacing with a stock skills.dat maybe and seeing if your problems go away? That'd be a good indication of whether or not it was just some kind of corruption.

Just an idea.


"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence
Top

Posted by Dralnu   USA  (277 posts)  Bio
Date Reply #13 on Thu 26 May 2005 01:05 AM (UTC)
Message
I'm about to check the stock skills.dat, and as for the endy, the Y has some marks over it (don't remember the term for them), and used find, and didn't find and endy in anything, so that might just be something in Cygwin, but I'm not sure.
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #14 on Thu 26 May 2005 01:07 AM (UTC)
Message
The "Endy" issue is actually fairly simple and usually ignorable. Usually just an indication that the "End" line in a file didn't get a \n behind it.

The other issue might be because you're missing tildes at the end of the Hitvict and Missvict lines in that mediate skill. without them, fread_string will keep reading until it hits another one, which in this case shows up after the word "mistform" in the next skill below it. This could be why you have values being jumbled up.

It looks to me like you saved once and for some reason the tildes didn't get written on that skill. I would guess if you had any further damage to the file that it would simply have been unreadable and the code would probably have stopped the bootup.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


52,126 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.