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 ➜ SmaugFUSS Practice.. Bug??

SmaugFUSS Practice.. Bug??

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


Posted by Sonolin   (6 posts)  Bio
Date Sun 16 Mar 2008 10:30 AM (UTC)

Amended on Sun 16 Mar 2008 10:31 AM (UTC) by Sonolin

Message
Hello

I just switched over to SmaugFUSS 1.9 from a previous Smaug 1.8b (official). Everything's working fine BUT when I type "practice" in a room with a trainer, it shows a generic list:


----------------------------------[Spells]----------------------------------
               float 100%          infravision 100%
 ----------------------------------Skills----------------------------------
                cook 100%                  dig 100%       standard style 100%
 ----------------------------------Weapons----------------------------------
           bludgeons 100%        flexible arms 100%          long blades 100%
            pugilism 100%         short blades 100%        talonous arms 100%
 ----------------------------------Tongues----------------------------------
              common 100%              dwarven 100%               elvish 100%
                gith 100%               goblin 100%             halfling 100%
                ogre 100%               orcish 100%                pixie 100%
            trollese 100%
You have 4 practice sessions left.


No matter what race/class I am, this list is shown. The skill levels do alter according to my percentage in them, but it doesn't show me the full practice list like I am supposed to see. If I go outside the room with the trainer, type practice, I see the list as normal.

The odd thing is, I tried commenting out these lines in act_info.c to see if it would help (mainly just playing around)

   for( mob = ch->in_room->first_person; mob; mob = mob->next_in_room )
      if( IS_NPC( mob ) && xIS_SET( mob->act, ACT_PRACTICE ) )
         break;


And it WORKS on my windows box... but NOT on my linux server. :( On the linux server it ends up showing EVERY AVAILABLE practice slot when you type practice.. no matter if you are by a trainer or not.

Any suggestions??
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Sun 16 Mar 2008 07:50 PM (UTC)

Amended on Sun 16 Mar 2008 07:51 PM (UTC) by Zeno

Message
In stock SmaugFUSS (latest version) it worked just fine for me. I sset myself with all skills and practice shows everything.

But since this involves SmaugFUSS, you are better off posting on the FUSS forums.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #2 on Sun 16 Mar 2008 09:01 PM (UTC)
Message
Quote:

The odd thing is, I tried commenting out these lines in act_info.c to see if it would help (mainly just playing around)


You are now relying on whatever is in the mob variable, which is not initialized. That is:


CHAR_DATA *mob;


If you changed it to:


CHAR_DATA *mob = NULL;


Then you would get consistent results.

I confirm I get the same results too.

I think it is something to do with these lines:


           if( skill->skill_level[mob->Class] > mob->level && skill->race_level[mob->race] > mob->level )
               continue;


That seems to be the test for whether or not you see the skill.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Sonolin   (6 posts)  Bio
Date Reply #3 on Sun 16 Mar 2008 09:48 PM (UTC)
Message
You sir are awesome =)

Replaced


         if( mob )
         {
            if( skill->skill_level[mob->Class] > mob->level && skill->race_level[mob->race] > mob->level )
               continue;
         }
         else
         {
            is_ok = FALSE;

            if( ch->level >= skill->skill_level[ch->Class] )
               is_ok = TRUE;
            if( ch->level >= skill->race_level[ch->race] )
               is_ok = TRUE;

            if( !is_ok )
               continue;
         }


with


         /*if( mob )
         {
            if( skill->skill_level[mob->Class] > mob->level && skill->race_level[mob->race] > mob->level )
               continue;
         }
         else
         {*/
            is_ok = FALSE;

            if( ch->level >= skill->skill_level[ch->Class] )
               is_ok = TRUE;
            if( ch->level >= skill->race_level[ch->race] )
               is_ok = TRUE;

            if( !is_ok )
               continue;
         //}


And it is working perfectly.

Now I'm just wondering.. what is the point of the line:


if( skill->skill_level[mob->Class] > mob->level && skill->race_level[mob->race] > mob->level ) continue;


Just hoping I didn't just erase something important out of the MUD


Thank you
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #4 on Sun 16 Mar 2008 10:29 PM (UTC)
Message
if( skill->skill_level[mob->Class] > mob->level && skill->race_level[mob->race] > mob->level ) continue;

Let's break it apart...

if:

(1) the class level of the skill for the mob's class is greater than the mob's level

and

(2) the race level of the skill for the mob's race is greater than the mob's level

then:
skip to the next skill.

In other words this prevents you from seeing skills that are above your level.

(I'm not sure why it's a conjunction and not a disjunction, though. Perhaps the presumption is that if you meet the level criterion for either skill or race, not necessarily both, you can use the skill.)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #5 on Mon 17 Mar 2008 12:11 AM (UTC)
Message
Quote:

In other words this prevents you from seeing skills that are above your level.


If this is the case, why is the test against the mob's level and not your level?

Do you mean, this prevents you from seeing skills above the mob's level? That is, a level 10 mob can't teach a level 20 skill? Not that I am sure this makes sense.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #6 on Mon 17 Mar 2008 12:22 AM (UTC)
Message
Oops. I meant that it prevents you from seeing skills above the trainer's level, not your own. Sorry. :)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #7 on Mon 17 Mar 2008 04:43 AM (UTC)
Message
I am vaguely skeptical about this check. What does the trainer's level have to do with it?

You know in Real Life (tm) there are trainers who coach their pupils to be above their level (eg. a tennis coach whose prodigy plays better than s/he does).

Also, I thought that "level" in general was a measure of experience, mainly from battle, and thus it wouldn't be ridiculous for a level 5 character (who is not a good fighter) to be an excellent cook.

It would seem more logical for an independent variable. For example a cooking trainer who could train up to a certain level of expertise in cooking, regardless of the trainer level (or the player level for that matter).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #8 on Mon 17 Mar 2008 04:47 AM (UTC)
Message
Well, I don't pretend to understand or agree with all of the design choices that go into SMAUG. I think that in this particular case, the idea is that if a trainer isn't of sufficient level to even know a skill -- that's what the skill class and race fields are for -- there's no way the trainer would know it in the first place.

I think that there is no way to have a mob "know" a skill without using this mechanism, because skill levels are stored in pcdata -- which mobs don't have. So this is the only way to note that a mob has a skill.

I agree though that it does seem a little roundabout. It would make more sense to me to assign skills to the mob, and then just check if the mob knew the skill in order to train it.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Gohan_TheDragonball   USA  (183 posts)  Bio
Date Reply #9 on Tue 18 Mar 2008 06:26 AM (UTC)

Amended on Tue 18 Mar 2008 06:29 AM (UTC) by Gohan_TheDragonball

Message
Quote:
You know in Real Life (tm) there are trainers who coach their pupils to be above their level (eg. a tennis coach whose prodigy plays better than s/he does).


this is a true point, but that is not what is meant by this check, since skills themselves do not have levels, they merely have level requirements. so the coach is not training the player's skill of tennis up to level 30 even though it only knows it himself at lets say 15. but maybe at level 15 it can teach the player how to spin the tennis ball properly, because up until that point the player did not possess a high enough knowledge of the fundamentals. (sorry kind of took your analogy and ran with it)
Top

Posted by Damzien   (6 posts)  Bio
Date Reply #10 on Fri 28 Mar 2008 10:24 PM (UTC)

Amended on Fri 28 Mar 2008 10:45 PM (UTC) by Damzien

Message
Rather then make another topic, I was having the same problem using the same codebase. I also tried the suggested fixes, and it corrected the display issue. However when you type practice '<skill name>' it gives these messages:

Domick tells you, 'I've taught you everything I can about aid.'
Domick tells you, 'You'll have to practice it on your own now...'

except that it doesn't actually practice the skill. It's still at 0% in both the practice display and slist.

It's not writing anything to the individuals pfile.

Here's the lines of code I'm looking at but not seeing any problem.

adept = ( int )( class_table[ch->Class]->skill_adept * 0.2 );

if( ch->pcdata->learned[sn] >= adept )
{
snprintf( buf, MAX_STRING_LENGTH, "$n tells you, 'I've taught you everything I can about %s.'",
skill_table[sn]->name );
act( AT_TELL, buf, mob, NULL, ch, TO_VICT );
act( AT_TELL, "$n tells you, 'You'll have to practice it on your own now...'", mob, NULL, ch, TO_VICT );
}
else
{
ch->practice--;
ch->pcdata->learned[sn] += int_app[get_curr_int( ch )].learn;
act( AT_ACTION, "You practice $T.", ch, NULL, skill_table[sn]->name, TO_CHAR );
act( AT_ACTION, "$n practices $T.", ch, NULL, skill_table[sn]->name, TO_ROOM );
if( ch->pcdata->learned[sn] >= adept )
{
ch->pcdata->learned[sn] = adept;
act( AT_TELL, "$n tells you. 'You'll have to practice it on your own now...'", mob, NULL, ch, TO_VICT );
}
}
}
return;
}

Any ideas? Let me know if you need anything else.


Nevermind, I was able to figure this one out. One of my friends added a class, and forgot to set a few things for it, including the skilladept. Sorry for a pointless post, I should've thought to have checked the file out first rather then diving into code.

Well... heh, I guess that is the point.
Top

Posted by Gohan_TheDragonball   USA  (183 posts)  Bio
Date Reply #11 on Fri 28 Mar 2008 10:58 PM (UTC)
Message
id guess that adept is 0. check that for your class the skill adept for that skill is not at 0. if its not 0 do this:


if( ch->pcdata->learned[sn] >= adept )
{
snprintf( buf, MAX_STRING_LENGTH, "$n tells you, 'I've taught you everything I can about %s. Adept = %d'",
skill_table[sn]->name, adept );
act( AT_TELL, buf, mob, NULL, ch, TO_VICT );
act( AT_TELL, "$n tells you, 'You'll have to practice it on your own now...'", mob, NULL, ch, TO_VICT );
}


and see what adept is
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #12 on Sun 30 Mar 2008 08:47 PM (UTC)
Message
Quote:
I think that in this particular case, the idea is that if a trainer isn't of sufficient level to even know a skill -- that's what the skill class and race fields are for -- there's no way the trainer would know it in the first place.


This was always my interpretation of it and it makes perfect sense to me when you look at the game mechanics. You can't know a skill at level 10 if the class level its set for is 50. Neither can the trainer if he's the same class, which he should be if a mage is practicing mage skills, etc.
Top

Posted by Vandius   (11 posts)  Bio
Date Reply #13 on Mon 28 Apr 2008 08:39 AM (UTC)

Amended on Mon 28 Apr 2008 08:44 AM (UTC) by Vandius

Message
I have run into this same problem with my fuss download, and have come to this conclusion.

Domick starts out as a 1st level human vampire.

so the only skills or spells he can teach are those of the first level human vapire.

changing his level to 50 showed me every spell and skill for vampire up to level 50.

so to fix this you would need to have a way to change his class to all classes and to level 50 and make the PC's only see the ones for their level and class.

i don't know code at all and i use the internal build system. is there a way to change this all in the game, from online.

please help me im a noob :)



PS: nevermind about the makeing him all classes, figured a way around that one, but i still need the part about Pc's seeing only there level and down skills and spells only.

not so much a noob maybe
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.


37,968 views.

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.