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 ➜ Coding skills [BEGINNER]

Coding skills [BEGINNER]

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


Posted by Helsing   (1 post)  Bio
Date Tue 10 Apr 2012 06:55 AM (UTC)
Message
Hello! We are a couple of friends learning as we go with the SmaugFUSS 1.9 codebase.
What we would like to do is remove the "Tongues" from the practice list (and the game), so that there is only one language. The first thing we have tried is going into the tables.c file, and we found this line:

const char *skill_tname[] = { "unknown", "Spell", "Skill", "Weapon", ["Tongues",] "Herb", "Racial", "Disease" };

(We deleted the word 'Tongues'.)

Now, the tongues are still there in the skill list, but the heading is "Herbs". While it was not completely unforeseen, the task of actually removing the Tongues from the game is daunting indeed...any help would be much appreciated, at the very least as to the true nature of the scope of this task. Actual coding help would be cool, too...like I said, this is a learning project. :)
Top

Posted by Fiendish   USA  (2,535 posts)  Bio   Global Moderator
Date Reply #1 on Tue 10 Apr 2012 01:13 PM (UTC)

Amended on Tue 10 Apr 2012 01:18 PM (UTC) by Fiendish

Message
It would be nice if you put a more relevant subject on this thread. Something like "Removing Tongues from game and practice list".

Quote:
(We deleted the word 'Tongues'.)

Now, the tongues are still there in the skill list, but the heading is "Herbs".


I'm curious what happens with Disease now. You can't usually just erase an item from an array like that. You'll index off the end and horrible things will happen.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Mopop   (115 posts)  Bio
Date Reply #2 on Wed 11 Apr 2012 02:45 AM (UTC)
Message
Where exactly would one go to just remove it from the prac list? Instead of just trying to eradicate it from code just having it so the player knows that it doesn't exist.

Im assuming I'll need to brush up on arrays since its been two years of not coding, oh boy.

On a scale of 1-10 how difficult would it be just to remove languages from the stock code (smaugfuss 1.9)
Top

Posted by Mopop   (115 posts)  Bio
Date Reply #3 on Wed 11 Apr 2012 06:15 AM (UTC)
Message
Okay I removed all the instances of find_tongue and skill_tongue. Now when I type prac It's set into the unknown section. I just want it removed from the prac list, it's not important but it's just an ascetic thing to get me back into the swing of coding.
Top

Posted by Aeri   (2 posts)  Bio
Date Reply #4 on Thu 15 Nov 2012 07:46 AM (UTC)
Message
Sounds like the player doing the command 'prac' still has the tongue as a skill.

if( skill->type != lasttype )
{
if( !cnt )
send_to_pager( " (none)\r\n", ch );
else if( col % 3 != 0 )
send_to_pager( "\r\n", ch );
set_pager_color( AT_MAGIC, ch );
pager_printf_color( ch,
" ----------------------------------&C%ss&B----------------------------------\r\n",
skill_tname[skill->type] );
col = cnt = 0;
}
lasttype = skill->type;


See, it looks for the lasttype which is assigned by skill->table. If you have a skill set to a character which type had been removed from the table (because you removed it), it not going to know how to view it, so it defaults to the first in the list, unknown. You can see this when it does a pager_printf_color.

Short answer fix: remove the tongues from the skills.dat.

If you want to keep the functionality but don't want them to be shown, incorporate an 'if' statement that checks skill->type against SKILL_TONGUE.

Hope this helps.
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.


16,786 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.