SmaugFUSS Practice.. Bug??

Posted by Sonolin on Sun 16 Mar 2008 10:30 AM — 14 posts, 51,615 views.

#0
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??
Amended on Sun 16 Mar 2008 10:31 AM by Sonolin
USA #1
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.
Amended on Sun 16 Mar 2008 07:51 PM by Zeno
Australia Forum Administrator #2
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.
#3
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
USA #4
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.)
Australia Forum Administrator #5
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.
USA #6
Oops. I meant that it prevents you from seeing skills above the trainer's level, not your own. Sorry. :)
Australia Forum Administrator #7
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).
USA #8
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.
USA #9
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)
Amended on Tue 18 Mar 2008 06:29 AM by Gohan_TheDragonball
#10
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.
Amended on Fri 28 Mar 2008 10:45 PM by Damzien
USA #11
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
USA #12
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.
#13
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