Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Majestic-12, Yahoo!, Google

Members: 0
Guests: 18
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Smaug Snippets » Study Snippet
Forum Rules | Mark all | Recent Posts

Study Snippet
< Newer Topic :: Older Topic > Problem on essentially stock SMAUG

Pages:<< prev 1 next >>
Post is unread #1 Oct 2, 2005, 2:01 am
Go to the top of the page
Go to the bottom of the page

Cernunnos

GroupMembers
Posts5
JoinedOct 2, 2005

I recently installed the 'study' skill from the snippet in the downloads section, and am having a slight problem with it.

Using my test mort, I gave study to a class and had him try to study a spell from a wand. Everything appeared to work perfectly, as far as visuals go - all the right messages appeared, and there were no bugs.

The problem is that the skill he studied (create spring in this case, wanted to start simple) didn't show up on his skill list, and when trying to cast it said 'You can't do that'.

The wierd thing about this is that when I changed his class to one that had 'create spring', he did indeed posess the spell at 1%, just the way the study skill is supposed to give it to him.

I'm at a complete loss, and have searched several forums for any clue or reference to this happening to others. Unfortunately I've had no luck, which is why I'm posting. Any help would be appreciated.

I'm running a stock SMAUG 1.4 a with a few modifications in the form of snippets and the like, nothing that should/could affect this, however.
       
Post is unread #2 Oct 2, 2005, 10:51 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

This sort of thing is why alot of Smaug muds don't use the study snippet. To make it work properly would mean having to hack up the entire skill/magic system to allow using skills and spells outside of your class. The study skill is a wonderfully great idea but doesn't play nice with the existing system.
       
Post is unread #3 Oct 2, 2005, 9:54 pm
Go to the top of the page
Go to the bottom of the page

Cernunnos

GroupMembers
Posts5
JoinedOct 2, 2005

I was thinking it would be something along those lines, but hoping it would be more of a 'remove this ifcheck in xxx.c' type of hack-up. Ah well.

Thanks for the reply :)
       
Post is unread #4 Oct 4, 2005, 4:24 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,868
JoinedJul 26, 2005

It's really not to hard.
In save.c find and remove the spots that have something like this.
		    if ( ch->level < LEVEL_IMMORTAL )
		    { 
		      if ( skill_table[sn]->skill_level[ch->class] >= LEVEL_IMMORTAL )
		      {
		        ch->pcdata->learned[sn] = 0;
		        ch->practice++;
		      }
		    }

That changes it to 0 when a char is loaded up, if their class doesn't get that skill/spell/etc...

In magic.c do_cast function
change
	/* Regular mortal spell casting */
	if ( get_trust(ch) < LEVEL_GOD )
	{
	    if ( ( sn = find_spell( ch, arg1, TRUE ) ) < 0
	    || ( !IS_NPC(ch) && ch->level < skill_table[sn]->skill_level[ch->class] ) )
	    {
		send_to_char( "You can't do that.\n\r", ch );
		return;
	    }
	    if ( (skill=get_skilltype(sn)) == NULL )
	    {
		send_to_char( "You can't do that right now...\n\r", ch );
		return;
	    }
	}

to something like this
	/* Regular mortal spell casting */
	if ( get_trust(ch) < LEVEL_GOD )
	{
	    if ( ( sn = find_spell( ch, arg1, TRUE ) ) < 0
	    || ( !IS_NPC(ch) && !can_use_skill(ch, 0, sn ) ) )
	    {
		send_to_char( "You can't do that.\n\r", ch );
		return;
	    }
	    if ( (skill=get_skilltype(sn)) == NULL )
	    {
		send_to_char( "You can't do that right now...\n\r", ch );
		return;
	    }
	}

That should allow them to cast spells fine once they have learned them.
There might be more of them, but if you take care of the 5 spots in save.c and the one in magic.c your that much closer to having it set right.
       
Post is unread #5 Oct 4, 2005, 4:34 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

            if ( ch->level < LEVEL_IMMORTAL )
            { 
              if ( skill_table[sn]->skill_level[ch->class] >= LEVEL_IMMORTAL )
              {
                ch->pcdata->learned[sn] = 0;
                ch->practice++;
              }
            }


Removing the above bit of code isn't the best idea for this. That is partly a protection against people still being able to use skills the admins have decided to disable access to. A proper solution would involve flagging a studied skill as such so that people could cast/use those. But like I said, there's more to it besides that.
       
Post is unread #6 Oct 4, 2005, 2:46 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,868
JoinedJul 26, 2005

Removing those will allow others to keep the skills. While it may not be the best way of doing it, it does fix the issue of it removing it etc... Of course you would need another way of restricting access etc... but it was just to explain on how to allow them to keep it without doing a full rewrite for doing so.
       
Post is unread #7 Oct 4, 2005, 4:45 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Well I don't really like the idea of advocating an improper fix to the issue. Especially one that deliberately circumvents something designed to protect from letting people keep disabled skills.
       
Post is unread #8 Oct 4, 2005, 8:03 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,868
JoinedJul 26, 2005

I didn't say it was to fix an issue, it was to allow people to keep their skills gained by using the study skill.
Normaly when people make skills they dont give them to any mortals till they are ready anyways. And if they arent given to mortals by that method they have to be sset on to them so I don't really see it as that big of an issue. But as always its up to the one installing the snippet and what kind of affect they are looking for. I just simply offered the easiest way to allow it all.
       
Post is unread #9 Nov 8, 2005, 3:52 pm   Last edited Nov 8, 2005, 3:52 pm by arrowhen
Go to the top of the page
Go to the bottom of the page

arrowhen

GroupMembers
Posts4
JoinedOct 6, 2005

What if you implemented a "hidden" dual-class system to allow access to skills outside of one's class? I haven't given Aurora's dual-class snippet more than a cursory glance yet, but this seems feasable:

Create a meta-class which has access to every skill you want studyable. Start each character with a level in this meta-class, and then dual-class them into the class of their choice. As long as you don't put any meta-class trainers into the game, characters won't be able to practice skills outside their class list, but should they acquire such a skill in some other way (by studying, or maybe by being granted a certain skill as a quest reward) they'll be able to improve it through use.

Would that work?
       
Pages:<< prev 1 next >>