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 ➜ Difference between Skills & Commands in SWR

Difference between Skills & Commands in SWR

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


Posted by Marowi   (65 posts)  Bio
Date Sun 11 Apr 2004 01:15 PM (UTC)
Message
I have no idea of the difference between a skill and a command. I THOUGHT that commands showed up when you typed 'commands' (do_commands) and skills showed up with 'prac' or 'slist', and that commands were defined in tables.c and mud.h, and skills were only in the skills.dat file... it would seem not, however.

Just a few skills found in tables.c are:

if ( skill == do_jail ) return "do_jail";
but no 'do_kick'
if ( skill == do_makespice ) return "do_makespice";

Now when you cedit these...

cedit jail
Command not found.

cedit kick
Command not found.

Command: makespice
Level: 1
Position: 5
Log: 0
Code: do_makespice

And on 'prac'...

jail 100%
kick 100%
but no makespice

And on 'commands'...

[ 1] makespice
but no kick
and no jail

And on 'slookup'...

slookup makespice
No such skill, spell, proficiency or tongue.

Sn: 104 Slot: 0 Skill: 'kick '
Saves: none
Type: Skill Target: offensive Minpos: 7 Mana: 0 Beats: 8
Flags: 0 Guild: 0 Code: do_kick
Dammsg: kick
Wearoff: !Kick!
Teachers: 32012 32011 412
guild: Combat Align: 0 lvl: 6

Sn: 103 Slot: 0 Skill: 'jail '
Saves: none
Type: Skill Target: ignore Minpos: 8 Mana: 0 Beats: 12
Flags: 0 Guild: 6 Code: do_jail
Dammsg:
Wearoff: !!
Teachers: 408
guild: Leadership Align: 0 lvl: 25


Makespice and jail have a table listing, but kick doesn't.
Makespice has a cedit, but jail and kick don't.
Jail and kick are on 'prac', but makespice isn't.
Makespice are on 'commands', but jail and kick aren't.
Jail and kick have an slookup, but makespice doesn't.

I'm really quite confused, as I thought all three were definately skills. Where's the differences?

Thanks, in advance.
Marowi
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 11 Apr 2004 11:26 PM (UTC)
Message
You must have a different version to me, I have do_kick:


    if ( skill == do_kick )             return "do_kick";
    if ( skill == do_kill )             return "do_kill";
    if ( skill == do_languages )        return "do_languages";


- Nick Gammon

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

Posted by Marowi   (65 posts)  Bio
Date Reply #2 on Wed 14 Apr 2004 06:10 PM (UTC)
Message
Umm.. yeah.. just checked and kick IS in tables.c - still doesn't explain the rest of it.. Anyone else got any ideas?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 14 Apr 2004 10:47 PM (UTC)
Message
I can't find makespice either, so it is a bit hard to answer these questions. However the brief answer would be that skills are in skills.dat file and commands in commands.dat file (in the system folder).

Both skills and commands would normally have a "command handler" in the source code, eg.


void do_kick( CHAR_DATA *ch, char *argument )
  {
  // blah blah - code for kicking
  }

void do_look( CHAR_DATA *ch, char *argument )
  {
  // code for looking
  }


- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


12,108 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.