[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Giving skills to players.
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Giving skills to players.

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


Posted by Robert Powell   Australia  (367 posts)  [Biography] bio
Date Sun 27 Mar 2005 11:24 PM (UTC)
Message
Is there an easy way that i can give a skill to a player as an award. Sort of like bestow but for skills not commands.

Im working on a new remort system for my 1 class mud, i dont wish to go through the whole creation process to select a remort class as others have done, but still need a way that i can give the remorted players a few new skills.

Any ideas on how i might achieve this would be most welcome.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #1 on Mon 28 Mar 2005 12:15 AM (UTC)
Message
You could use sset:
sset <player> <skill> <percent>

But because of the way skills write, it may not save.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Robert Powell   Australia  (367 posts)  [Biography] bio
Date Reply #2 on Mon 28 Mar 2005 12:54 AM (UTC)
Message
What i have done is a bunch of if checks to determine what remort number the PC is, then give them the skill like this,
victim->pcdata->learned[gsn_backstab] = 1;
then saved the pfile.
When i open the pfile the skill is there with 1 as the learned value.
Skill 1 'backstab'

My trouble is now when the PC quits and logs back in they loose the skill, so im now trying to find where things are being changed.

If anyone has any ideas where i should look would be most welcomed, Thanks for now.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
[Go to top] top

Posted by Nick Cash   USA  (626 posts)  [Biography] bio
Date Reply #3 on Mon 28 Mar 2005 01:09 AM (UTC)
Message
Try looking over the do_teach function. I think that should outline anything you should need to know.

~Nick Cash
http://www.nick-cash.com
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #4 on Mon 28 Mar 2005 01:23 AM (UTC)
Message
To lay it out, skills will not save unless the player is the right class or race that the skill is under. What I see in do_teach doesn't seem to have a way around that.

         victim->pcdata->learned[sn] += int_app[get_curr_int( ch )].learn;
         sprintf( buf, "You teach %s $T.", victim->name );
         act( AT_ACTION, buf, ch, NULL, skill_table[sn]->name, TO_CHAR );
         sprintf( buf, "%s teaches you $T.", ch->name );
         act( AT_ACTION, buf, victim, NULL, skill_table[sn]->name, TO_CHAR );


My thought would be to add a new skill flag, OVERRIDE or the sort, and have it if a skill is flagged with that, then do not remove from a players skills.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Robert Powell   Australia  (367 posts)  [Biography] bio
Date Reply #5 on Mon 28 Mar 2005 01:57 AM (UTC)

Amended on Mon 28 Mar 2005 02:17 AM (UTC) by Robert Powell

Message
Ok where are the checks made to see if the PC can have a skill or not.

Im sort of gathering the pfile just holds skill practiced value and its the class file that determines if you can use the skill.

Hmmm and i thought this was going to be easy HEHEH.

I have seen do_teach/do_study working, but i guess they only allow you to learn skills that your race/class combination receives and not to gain extra skills not in the race/class files.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #6 on Mon 28 Mar 2005 02:05 AM (UTC)
Message
In save.c, look for these lines:
                    bug( "Fread_char: unknown skill.", 0 );
                  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_level( ch, sn) >= LEVEL_IMMORTAL )
                      {
                        ch->pcdata->learned[sn] = 0;
                        ch->practice++;
                      }


*points to the comment*

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Cash   USA  (626 posts)  [Biography] bio
Date Reply #7 on Mon 28 Mar 2005 02:42 AM (UTC)
Message
Heh, sorry if do_teach didn't help, I work with SWR in which skills are more or less available to everyone.

~Nick Cash
http://www.nick-cash.com
[Go to top] top

Posted by Robert Powell   Australia  (367 posts)  [Biography] bio
Date Reply #8 on Mon 28 Mar 2005 03:02 AM (UTC)
Message
Thanks, that now allows them to use the skills gained, do you have any idea how i can display them, i have been playing about with this in do_practice

  if ( ch->level < skill_table[sn]->skill_level[ch->class]
               || (!IS_IMMORTAL(ch) && skill_table[sn]->skill_level[ch->class] == 0) )
            continue;


i just cannot work out how to display the learned skills with the class skills,


if ( ch->pcdata->learned[sn] <= 0 )
            continue;


I can get it to show all learned or all class, just not both, any ideas on what to do.

Thanks for all the help so far

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
[Go to top] top

Posted by Robert Powell   Australia  (367 posts)  [Biography] bio
Date Reply #9 on Mon 28 Mar 2005 03:11 AM (UTC)
Message
So whats SWR do different to SmaugFUSS in relation to how skills are delt out. I would like to make skills and spells available to PC's without the restriction of Class and Race, Teach and Study were going to be at the heart of this, with some skills being received via remorting.

I sort of like those old ROM muds where if you remorted enought times and got enough practices you could GAIN every skill that was on offer.

All i need now is to make the gained skills viewable in practice and i think im close to having what i want.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #10 on Mon 28 Mar 2005 04:09 AM (UTC)
Message
There are no practice points in SWR. If you can find the teacher for the skill, you can practice it. All skills are available as long as you have the levels in that class.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by Robert Powell   Australia  (367 posts)  [Biography] bio
Date Reply #11 on Mon 28 Mar 2005 05:34 AM (UTC)

Amended on Mon 28 Mar 2005 05:35 AM (UTC) by Robert Powell

Message
Have been doing some trauling through the code and came accross the SECRETSKILL flag which i can use to hide skills, this is niffty, so what i have done is added a check to stop secret skills being practiced untill you study the spell or are taught the skill basics.

Not exactly what i had im mind when i started this but it will work how i wanted it to, even if its a bit messy.

I will do a simular thing for remort only skills, i will just have to add all the skills to the class file, something i didnt want to do.

One day if i get up the courage, i might rip out all that class file crap for skills and come up with a better system. Untill then, Anyone want to go throught and flag all the skill and spells for me, and add them to the class file? hehe,

What no takers, guess im the sucker then.

Thanks everyone, you have been a great help.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
[Go to top] 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.


7,534 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]