Learn Skills By Use 2.0

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 82
Nope, but I think I'm on to what's wrong. When doing a bolean, you can't have a #tag or space after it.

Edit: Nope, that doesn't seem to be it. Maybe when I copied and posted the code it came out wrong. I seem to have great difficulty copying and pasting the code from this site.
« Last Edit: February 03, 2011, 05:12:28 AM by ShortStar »

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Try toggling LSU_BUTTONSHOW. You never know.
it's like a metaphor or something i don't know

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
No. But I copied the script you gave into a new project and there was no syntax error anywhere. Try giving me the demo of the new project you created to test it. Just compress game data (don't encrypt it though) and attach it to a post. To attach, you have to be doing a regular reply (not quick) and go to additional options to find the place to add attachments. Otherwise, you could also do it via an uploading site like sendspace.

***
Rep:
Level 82
Its a new default project. Let me make a new default project and see if anything strange happens. Still same thing.

Anyway, I went through line by line and if I have a space in front of a #line then it would give me an error. So hope this helps someone else. Remove the spaces in front of #s.

Edit: Thank you both for your help and thank you Modern for making the script in the first place. I've used an older version, so I look forward to seeing what the upgrade brings.

***
Rep:
Level 82
On second thought it didn't fully work. Now there's a problem when I go into an actor's skill menu via the main menu or via the battle menu. It gets some kind of stack error. Le Sigh. Maybe it has to do with this?

#============================================================
#    Show Skill Count in Help
#      (Addon to Learn Skills By Use 1.0)
#    Version: 1.1
#    Author: modern algebra (rmrk.net)
#    Date: January 23, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
No, those are comments; there's no way that would cause an error, nor would it cause an error by having #s instead of # s. They aren't causing any errors. Like I said, give me a demo of the project and tell me how to recreate the error and I will try and fix it.

***
Rep:
Level 82
Well yes those were comments. Having spaces before the # did matter. This new problem seems to be something different, probably a script conflict with something else I'm using, because it this script works with my new default game that has no scripts.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Well, no; you are not correct. You may have inadvertently fixed whatever was wrong when you were going through the script, but I am 100% positive that wasn't the problem.

Anyway, it may very well be a script conflict, but again, I can't help you without seeing a demo with the error recreated.

**
Rep:
Level 70
Furry Et Al
The script is beautiful, simply beautiful! However,  is there any way to make it work with Gubid's Tactical Combat? I've been trying to think of how it might be made compatible with it.

***
Rep:
Level 74
I'm baaack!
Is it possible to make a menu option that calls Scene_Skill but when you open the menu it shows and experience bar where the description should be without much edits?

*
Rep: +0/-0Level 68
RMRK Junior
Hi, I tried to make this work but I just couldn't work it. I keep getting an error that says
"Script 'Learn Skills By Use' line 404: NoMethodError occurred.
undefined method '[]' for nil:NilClass"

I don't understand why it's not working. I hope it's not one of the other scripts i got
I need some help please and thank you.

**
Rep:
Level 83
Music Composer
This script is great, very usefull, my only question is...

Im using the skill learn by equipment, so i dont want to for example:

Ice Sword teaches = Ice Strike

I dont want that in the right corner of the skills screen at the menu appears the "used count" because there is NO upgrade for that movement, what can i do to delete the "used count" for the Ice Strike? i dont want to give fake expectations to the players... also i dont want all my skills be upgraded. Can anyone help me with that?

Do you want original music for your game? Take a look here! You may like it.
Visit my Youtube Channel to listen the newest tracks and subscribe if you like my work :)
Also I have my Soundcloud account:

**
Rep: +0/-0Level 71
RMRK Junior
hey, just wondering if someone could help me with this script. I've put it in below all the other scripts that i've got, and set all the tags, but when i go to test my game, it pops up with this error message
line 308 : NoMethodError occurred
undefined method 'ma_descendant_skills' for Nil:NilClass
i've got it set so the skills are learned on level up. Would be awesome if someone could give me a hand. Thanks in advance

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Hmm, well it sounds like maybe you said one of the root skills was either 0 or an ID exceeding the last skill in the database.

You can fix it by pasting the following line directly above line 308:

Code: [Select]
        next if $data_skills[d_id].nil?

So that part would look like:
Code: [Select]
    @ma_root_skills.each { |path|
      path.each { |d_id, n, forget|
        next if $data_skills[d_id].nil?
        $data_skills[d_id].ma_descendant_skills = [] if $data_skills[d_id].ma_descendant_skills.nil?
        d_skills = $data_skills[d_id].ma_descendant_skills
        d_skills.push (self.id) unless d_skills.include? (self.id)
      }

But bear in mind that since the error is occuring, you likely have a tag set up wrong somewhere, so you should take a look at them.

**
Rep: +0/-0Level 71
RMRK Junior
found the problem. it was a wrong tag. everything works fine now. thanks heap for the help  ;D

***
Rep:
Level 69
RMRK Junior
Ok, this is what I'm trying to do.. 

I'm creating a "Spellsword" class, and I want the actor to learn the skills by use, right now I have it set up like this:

 The starting abilities you gain by leveling up are:

Fire Sword
Ice Sword
Lightning Sword
Earth Sword

I created 4 states one for each element, and 4 common events that look like this:

I have it set that when you use Fire Sword it triggers a common event:
Change Skills:[Valdraek], - Lightning Strike
Change Skills:[Valdraek], - Electroshock      (These get rid of all the skills of the opposite swords and then add the skills appropriate.)
Change Skills:[Valdraek], + Fire Charge
etc.

Now these common events work perfectly.. so when you use the sword elements it gets rid of skills that dontt apply to the elements as shown above.

My problem is that if I set conditional modifiers to make it so that he won't learn it to certain levels even when he levels it won't display the message that he actually learned it..

So this is my theory..

I wanted to use this script to make it so that when he uses "Fire Sword" or "Ice Sword, etc..  say like 50 times, or mre, or whatever.. he will learn the skill..  I read in some of the above comments that it only learns the skill at a level up, but i want it to be minimum level to learnn the skill, not necessarily only when the actor levels.. like:

If Fire Sword is used 50 times and actor is at least level 17.. learn "Fire Charge".

Now here is the big problem..  now when the character learns the skill.. it will be displayed as learned.. and appear in thhe menu.. which I don't want..  I only want the skills to be displayed when you use the appropriate Elemental Sword skill..  like I have it said in my common event..  I don't mean to be a pain in the ass but can this be done with your script? 

Oh.. also I tried to play around with this script and I'm getting an error:

Script 'Learn Skill By Use' line 185: TypeError occured.

undefined superclass 'Dialog'


Copied the code directly, what do you think the problem can be?





*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Oh.. also I tried to play around with this script and I'm getting an error:

Script 'Learn Skill By Use' line 185: TypeError occured.

undefined superclass 'Dialog'


Copied the code directly, what do you think the problem can be?
If using the Learn Skill immediately upon meeting requirements option, then you NEED to have Zeriab's Dialog System!
it's like a metaphor or something i don't know

***
Rep:
Level 69
RMRK Junior
Ok, I needed Zeriab's script to make it work, got that down.. now its just making it so that the skills dont show up when the proper elemental sword is not in use (this  is controlled by a state and a common event like I stated above.)

***
Rep:
Level 69
RMRK Junior
Bump.

Any ideas? This is really stumping me, I need this class to work right, its crucial for my game.  Understand the problem? Let me know please!

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
OK, well with the Dialog script which you now have and:

LSU_LEARN_IMMEDIATELY = true

then the skill is learned immediately.

As for the minimum level:

Quote from: Instructions in the Header of the Script
Code: [Select]
#    To set a minimum level for learning a skill through usage requirements,
#   put this code in the notebox of a skill:
#
#      \MIN_LEVEL[x]
#        x : an integer that is the minimum level. An actor cannot learn
#          the skill until his level is at least equal to x.

So, in the notebox of your "Fire Charge" skill, if you set it up so that you need to use the root skill of Fire Sword 50 times and then put:

Code: [Select]
\MIN_LEVEL[17]

then you would need to use Fire Sword 50 times and you would only learn Fire Charge if you were level 17 or higher.

Now I don't understand this part of your post at all:

Quote
Now here is the big problem..  now when the character learns the skill.. it will be displayed as learned.. and appear in thhe menu.. which I don't want..  I only want the skills to be displayed when you use the appropriate Elemental Sword skill..  like I have it said in my common event..  I don't mean to be a pain in the ass but can this be done with your script?

Namely, I don't understand how the character is learning the skill without using the appropriate Element Sword Skill. With my script, if you set it to require 50 uses of Fire Sword, it won't be learned until Fire Sword is used 50 times. As long as your event works and you remove Fire Sword when the right sword isn't equipped, then Fire Charge won't be learned when you use the other skills.

Furthermore, with this script, Fire Charge would only be learned directly after using Fire Sword the 50th time (or else upon levelling to the minimum level if Fire Sword had already been used 50 times prior to obtaining that level). So it wouldn't be learned when you used Electric Strike the 50th time, so ostensibly, it would only appear after having used the "appropriate Elemental Sword skill."

The only way that I understand that part of your post is if, in trying to set a minimum level, you are actually setting the character to learn Fire Charge at level 17 through the regular database way. That is incorrect unless you want the character to learn Fire Charge at level 17 whether he's used Fire Sword enough times or not. You should just get rid of it and go through the \min_level route described above.

I might have misunderstood that, so if I did, please clarify.

I hope that answers all your questions. Be sure to read the instructions of scripts from now on. They do have a purpose after all, and it's to help you use the script. In this case, as long as I have not misunderstood your problem, reading the Instructions would have solved both of your problems and a lot faster than it took to provoke a response from Pacman and I.

By the way, thanks for helping out Pacman.
« Last Edit: October 07, 2011, 09:06:02 PM by modern algebra »

***
Rep:
Level 69
RMRK Junior
Ok, here is the situation.  I'm able to make your script work perfectly. I think I need some kind of edit however.

I'm going to try to explain this as plainly as possible.... here goes!

I'm making a "Spellsword" class.

The way the I want the Spellsword to work is he learns skills the more he imbues his sword with elemental type magic... so he learns abilities such as Fire Sword and Ice Sword from normal leveling..  now I use your script so if he uses Fire Sword 20 times he learns "Flaming Charge"....


CONSIDER:

The Spellsword can only use the abilities from that type of element he casts on his sword.

EXAMPLE:

Valdraek casts Fire Sword!

Now in the skill menu it should now give him his abilities for that type of element:



Notice how when you use Fire Sword you have access to two abilities:
Flaming Charge, and Blazing Whirlwind

Now.... if you cast Ice Sword:



THe two fire abilities are removed and are replaced with the abilities of ice:
Freezing Rain, Glacial Blast


And this works fine with common eventing, every event just makes the actor forget the abilities, I even went as far as creating a state for the two element sword types.

DILEMMA:

Now that I have incorporated your awesome script.. 

I iearn the ability of Fire Sword, and it stays with you,  if I use Ice Sword the ability is forgotten like normal, however when I use Fire Sword again, it says "Valdraek has learned Fiery Charge"  which isn't necassarily a bad thing.. but the problem I'm having.. is using my common events to change between the element types.  It should be something like this:


*Using FireSword*
If Valdraek has used Fire Sword 20 times:  Learn Flaming Charge
If Valdraek has used Fire Sword 60 times:  Learn Blazing Whirlwind
Forget Ice Abilities  (And all other elemental types once I add them there will be 8 in all I think.)

The way I have this system is with a common event, but I don't know how to make it so that when you use the elemental sword type, it actually calls the learned abilities from the script..


So if Valdraek is Level 17.. and posesses Flaming Charge:  He would only learn flaming charge:
And not the other Fire abilities..

I don't know if I'm explaining this right.. but it is very important system for my game. The COmmon event system looks like this right now..

Trigger Common Event When Use of Fire Sword

Change Skills:[Valdraek], - Glacial Blast
Change Skills:[Valdraek], - Freezing Rain      (These get rid of all the skills of the opposite swords and then add the skills appropriate.)
Change Skills:[Valdraek], + Flaming Charge
Change Skills:[Valdraek], + Blazing Whirlwind
etc.

Now I think it should look like this but I don't know how to make it happen:
 
Trigger Common Event When Use of Fire Sword

Change Skills:[Valdraek], - Glacial Blast
Change Skills:[Valdraek], - Freezing Rain      (These get rid of all the skills of the opposite swords and then add the skills appropriate.)
Conditional Branch:  If Valdraek has used [Fire Sword] 20 times, and is at least level 17:
Change Skills:[Valdraek], + Flaming Charge
Conditional Branch:  If Valdraek has used [Fire Sword] 60 times, and is at least level 22:
Change Skills:[Valdraek], + Blazing Whirlwind
etc.


This I think would work perfectly and if you can, I would like you to make this an addon for your script, or at least tell me how to get it done.  I hope that this was a bit for clarifying for you, please let me know if you don't understnad a part of this.



*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Alright, thanks. That is a helpful clarification. All you would need to do is use the script field of conditional branch and input the following code:

Code: [Select]
actor.lsu_skill_requirements_met? (skill)

where:
    actor is a Game_Actor object
    skill is a RPG::Skill

So, that will require IDs of Valdraek and the skills, which I obviously don't know, but it will end up looking like this:

Code: [Select]
$game_actors[5].lsu_skill_requirements_met? ($data_skills[22])

where Valdraek is the actor with ID 5 and Flaming Charge is the skill with ID 22. So replace the 5 in the above code with the actual ID of Valdraek and the 22 with the actual ID of Flaming Charge and you'll be all set.

Overall, the event would look like this:

@>Conditional Branch: Script: $game_actors[5].lsu_skill_requirements_met? ($data_skills[22])
    @>Change Skills: [Valdraek], + [Flaming Charge]
    @>
 :  Branch End


etc. for each of the skills you add.
« Last Edit: October 08, 2011, 04:19:06 PM by modern algebra »

***
Rep:
Level 69
RMRK Junior
Thank you so much as always, MA. It works SUPERBLY. THANK YOU THANK YOU! :V

***
Rep:
Level 69
RMRK Junior
I reached a point in which Im stuck.. perhaps Im just not setting it up correctly. I want to make it that whenu you use fire sword and ice sword 8 times each you will learn Earth sword.. i have this in the note for earth sword:

\ROOT_SKILL[167, 8, <174>]
\ROOT_SKILL[174, 8, <167>]

What am I doing wrong?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
As long as 167 and 174 refer to Fire Sword and Ice Sword, then what you have seems right. In what way is it not working?