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 type

Skill type

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


Posted by Metsuro   USA  (389 posts)  Bio
Date Tue 04 Jul 2006 11:27 PM (UTC)

Amended on Tue 04 Jul 2006 11:47 PM (UTC) by Metsuro

Message
Alright I have added a new skill type, and I am kinda lost on how to do the fread for it...

            if( !strcmp( word, "Skill" ) )

            {
               int sn;
               int value;

               if( preload )
                  word = "End";
               else
               {
                  value = fread_number( fp );
                  if( file_ver < 3 )
                     sn = skill_lookup( fread_word( fp ) );
                  else
                     sn = bsearch_skill_exact( fread_word( fp ), gsn_first_skill, gsn_first_weapon - 1 );
                  if( sn < 0 )
                     bug( "%s", "Fread_char: unknown skill." );
                  else
                  {
                     ch->pcdata->learned[sn] = value;
                     /*
                      * Take care of people who have stuff they shouldn't     *
                      * * Assumes class and level were loaded before. -- Altrag *
                      * * Assumes practices are loaded first too now. -- Altrag
                      */
                     if( ch->level < LEVEL_IMMORTAL )
                     {
                        if( skill_table[sn]->skill_level[ch->Class] >= LEVEL_IMMORTAL )
                        {
                           ch->pcdata->learned[sn] = 0;
                           ch->practice++;
                        }
                     }
                  }
                  fMatch = TRUE;
                  break;
               }
            }


thats for just a normal skill, so... what I am lost at is... what I might have to change for the new skill type.

Everything turns around in the end
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #1 on Wed 05 Jul 2006 03:50 AM (UTC)
Message
Well I gave up on the new types... and I was just wondering how I might make practice display skill types in the order I choose them to be? so I can make like skills spells tongues then like weapons at the end?

Everything turns around in the end
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.


11,152 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.