RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Skill Teaching Equipment & Items (VX Edition)

0 Members and 1 Guest are viewing this topic.

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Skill Teaching Equipment & Items
Version: 2.0b
Author: modern algebra
Date: February 20, 2010

Version History


  • <Version 2.0b> 02.20.2010 - Fixed error that, if a skill was learned through natural means while an equipped item already taught the skill, then the skill would disappear upon unequip.
  • <Version 2.0> 06.28.2008 - New configuration, as well as multiple skills per Item
  • <Version 1.0> 01.27.2008 - Original release

Description


This script allows you to assign skills to items, weapons and armors. When assigned to an item, it is possible to permanently learn the skill assigned when the item is used. For weapons and armors, you are able to learn the skill while the weapon or armor is equipped. Once the weapon or armor is unequipped, you will no longer have access to that skill.

Features

New in Version 2.0:

  • Configuration is done in the Notes Field of the respective items. See the instructions for details
  • One item, weapon, or armor can now teach more than one skill
  • You can now set a level requirement for the weapons, armors, or items to teach the skill. So, if you want a Long Sword to teach Fire, but you want the actor to be level 10 before he gets it, the script can now perform that task.

Original:

  • Allows items to teach actors skills permanently
  • Allows weapon and armor to teach the actor skills for as long as he has the respective equipment equipped
  • Very intuitive configuration; it is easy to set up

Screenshots

N/A for this type of script

Instructions


Insert this script just above Main.
To configure this script, merely go into the item, weapon, or armor in the database. In the Notes Field, put in this code:

        \ls[skill_id, level_min]

  where skill_id is the ID of the skill you want the item to teach and level_min is optional and makes it so that the skill the item teaches is only taught if the actor is at least that level. If it's left blank, it is assumed that there is no level requirement.
  
 You can put in as many of these as you like, so if, for example, an item has this in it's notes:

       \ls[5]
       \ls[8, 7]

 Then that item would teach skill 5 no matter what level the actor is, and once the actor reaches level 7 will teach skill 8. The script will take every instance of that code regardless of what else is in the Note Field

Script


Code: [Select]
#==============================================================================
#  Skill Teaching Equipment & Items
#  Version 2.0b
#  Author: modern algebra (rmrk.net)
#  Date: February 20, 2010
#~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Instructions:
#    Insert this script just above Main.
#
#    To configure this script, merely go into the item, weapon, or armor in the
#   database. In the Notes Field, put in this code:
#
#        \ls[skill_id, level_min]
#
#      where skill_id is the ID of the skill you want the item to teach and
#     level_min is optional and makes it so that the skill the item teaches
#     is only taught if the actor is at least that level. If it's left blank,
#     it is assumed that there is no level requirement.
#   
#    You can put in as many of these as you like, so if, for example, an item
#   has this in it's notes:
#
#       \ls[5]
#       \ls[8, 7]
#
#    Then that item would teach skill 5 no matter what level the actor is, and
#   once the actor reaches level 7 will teach skill 8. The script will take
#   every instance of that code regardless of what else is in the Note Field
#==============================================================================
# ** RPG::BaseItem
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#    Summary of Changes:
#      new method - skill_ids
#==============================================================================

class RPG::BaseItem
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Skill IDs
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def skill_ids
    # Only works for Item, Weapon, and Armor
    return if self.class == RPG::Skill
    learn_skills = []
    # Dissect Note
    text = self.note.dup
    while text[/\\ls\[(\w+),*\s*(\d*?)\]/i] != nil
      text.sub! (/\\ls\[(\w+),*\s*(\d*?)\]/i) { '' }
      learn_skills.push ([$1.to_i, $2.to_i])
    end
    return learn_skills
  end
end 

#==============================================================================
# ** Game_Actor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased methods - change_equip, setup, level_up
#==============================================================================

class Game_Actor < Game_Battler
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Change Equipment
  #     equip_type : type of equipment
  #     id    : weapon or armor ID (If 0, remove equipment)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_skill_teaching_items_equipment_change change_equip
  def change_equip (equip_type, item, test = false)
    unless test
      last_item = equips[equip_type]
      # Forget the skills from what was previously equipped
      skill_ids = last_item.nil? ? [] : last_item.skill_ids
      skill_ids.each { |skill_id|
        forget_skill (skill_id[0]) if @unnatural_skills.include? (skill_id[0])
        @unnatural_skills.delete (skill_id[0])
      }
    end
    # Run original method
    ma_skill_teaching_items_equipment_change (equip_type, item, test)
    unless test
      last_item = equips[equip_type]
      # Learn the skills from current_equipment
      skill_ids = last_item.nil? ? [] : last_item.skill_ids
      skill_ids.each { |skill_id|
        unless skill_learn? ($data_skills[skill_id[0]]) || self.level < skill_id[1]
          @unnatural_learning = true
          learn_skill (skill_id[0])
          @unnatural_learning = false
        end
      }
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Setup
  #     actor_id : actor ID
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_skill_teaching_items_actor_setup setup
  def setup (actor_id)
    @unnatural_skills = []
    # Run original method
    ma_skill_teaching_items_actor_setup (actor_id)
    for item in equips
      next if item.nil?
      item.skill_ids.each { |skill_id|
        next if skill_learn? ($data_skills[skill_id[0]]) || self.level < skill_id[1]
          @unnatural_learning = true
          learn_skill (skill_id[0])
          @unnatural_learning = false
      }
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Level Up
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_skl_teacher_equip_actor_lvlup level_up
  def level_up
    modalg_skl_teacher_equip_actor_lvlup
    # Check Equipment and learn skills if not already learned
    equips.each { |item|
      next if item == nil
      item.skill_ids.each { |skill_id|
        unless skill_learn? ($data_skills[skill_id[0]]) || self.level < skill_id[1]
          @unnatural_learning = true
          learn_skill (skill_id[0])
          @unnatural_learning = false
        end
      }
    }
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Learn Skill
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_lrnskll_eqpmnt_8ik2 learn_skill
  def learn_skill (skill_id, *args)
    if @unnatural_learning
      @unnatural_skills.push (skill_id) unless @unnatural_skills.include? (skill_id)
    elsif skill_learn? (skill_id)
      @unnatural_skills.delete (skill_id)
    end
    ma_lrnskll_eqpmnt_8ik2 (skill_id, *args)
  end
end

#==============================================================================
# ** Game_Battler (Skill Teaching modification)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased methods - item_test, item_effect
#==============================================================================

class Game_Battler
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Item Test
  #      user : person using item
  #      item : the item being used
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_skill_teaching_items_test_item item_test
  def item_test (user, item)
    effective = ma_skill_teaching_items_test_item (user, item)
    if self.class != Game_Enemy
      item.skill_ids.each { |skill_id|
        effective |= !skill_learn? ($data_skills[skill_id[0]]) && self.level > skill_id[1]
      }
    end
    return effective
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Application of Item Effects
  #     item : item
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_skill_teaching_items_effect_item item_effect
  def item_effect (user, item)
    # Run original method
    ma_skill_teaching_items_effect_item (user, item)
    item.skill_ids.each { |skill_id|
      learn_skill (skill_id[0]) if self.class != Game_Enemy && self.level > skill_id[1]
    }
  end
end

Credit


  • modern algebra

Thanks

  • ryu009, for requesting the script

Support


Just post in this topic at rmrk for quick support

Known Compatibility Issues

Should be compatible with any script that does not perform the same function as this one. If any issues arise, I wwill be happy to fix them for you.

Demo


See attached.

Author's Notes


This script was requested by ryu009 (for weapons, at least: I decided to expand upon his request though).


Creative Commons License
This script by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.
« Last Edit: February 20, 2010, 06:44:59 PM by Modern Algebra »

**
Rep: +0/-0Level 86
Ryu is the best!
Awesome script thanks :) i bought RMVX on the first day it came out, I've been waiting for it forever.  It's finally here.

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Updated to Version 2.0

I have changed the way the script is configured. I think it is now easier to deal with. See the Instructions for details.
It is also now possible to have one item, weapon, or armor teach more than one skill.

You may think this wasn't worth an entire update to 2.0 - but the script is not very large, and so it was rather major in that regard.

**
Rep: +0/-0Level 85
Hey modernalgebra this is an awesome script!  2 questions though:

1.) Is there a way to make it so different items memorize skills at different rates?  If so could you tell me, if not, would there be possibly an easy bit of code I could paste into the script to accomplish this?

2.)  Is there a way to make it so items give skills to only certain characters?  Same thing as above, if there's an easy code I could paste in that would be awesome.  If it's a little more extensive than that I realize this is not the place to ask you to make complex code updates.

Thanks!

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
I don't really know what you are asking for.

If you mean have the item teach one skill at level 5 and then another at level 10, that's what the level_min argument is for.

**
Rep: +0/-0Level 85
Ah you know what I totally misread the script.  I was reading that items can permanently teach a skill to a character, and thought it applied to equipment as well.

An example of what I was thinking would be like:  Weapon Short Sword gives skill slash when equipped.  Every time character uses skill slash in battle it adds to an AP for that skill.  When the AP reaches whatever AP is needed to permanently memorize the skill, the skill is memorized and the equipment no longer needed.  I've been looking for a script like this that is compatible with the tentekai sideview battle script, but to no avail.  Your script is the closest though! 

If only I were smart I could maybe come up with something on my own. :(

On that same note though, is there still a way to restrict who can learn skills?  For instance:  If i have as magic scroll, I only want mage actors to be able to learn it.  Can I prevent warriors from using the item?  Same goes for equipment.  Can I have a sword give a skill to a Barbarian character, but no skill or even a different skill to a Paladin?

My guess is no from what I'm reading in your description of the script, but maybe you're expert skills in scripting know of a little fix I could add into my script to get any of these above features to work?
« Last Edit: July 22, 2008, 04:46:52 AM by gabiot »

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
Hmm. I actually was wondering the same thing. If you're familiar with the way Abilities are learned in FFIX, that is what I was specifically wondering.

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
@gabiot - this script does not, but you can use this script in conjunction with Equipment Requirements and it can restrict who uses what.

As for the permanence thing, I'll think about it.
« Last Edit: July 22, 2008, 12:32:13 PM by modern algebra »

**
Rep:
Level 85
Great script! I like it alot, and will be using it if you don't mind. Don't worry; you will be accredited.
yes!

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
I'm glad you like it. :P

And of course I don't mind - that's what it's here for.

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
Any thought on including to learn skills permanently over time with the equipped gear?  :P

--Edit--
I totally found a script that is exactly like learning abilities in FFIX. Difference being is that it doesn't use items to teach skills.
« Last Edit: August 01, 2008, 01:03:15 AM by grafikal007 »

**
Rep:
Level 84
I want to know the script that is like FFIX. could you please let me know where it is

********
Hungry
Rep:
Level 96
Mawbeast
2013 Best ArtistParticipant - GIAW 11Secret Santa 2013 ParticipantFor the great victory in the Breakfast War.2012 Best Game Creator (Non-RM Programs)~Bronze - GIAW 9Project of the Month winner for August 2008Project of the Month winner for December 20092011 Best Game Creator (Non RM)Gold - GIAW Halloween
it shouldn't be too hard to modify this to make it an EQ-AP system.

If modern is alright with it I may be able to mod this into the FFIX system.

FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
grafikal said that he had found one. I don't know if it's the same or not, though.

********
Hungry
Rep:
Level 96
Mawbeast
2013 Best ArtistParticipant - GIAW 11Secret Santa 2013 ParticipantFor the great victory in the Breakfast War.2012 Best Game Creator (Non-RM Programs)~Bronze - GIAW 9Project of the Month winner for August 2008Project of the Month winner for December 20092011 Best Game Creator (Non RM)Gold - GIAW Halloween
grafikal said that he had found one. I don't know if it's the same or not, though.

if he had posted a link I wouldn't have offered
Cloud 2010 is also looking for the same thing.

FCF3a A+ C- D H- M P+ R T W- Z- Sf RLCT a cmn+++ d++ e++ f h+++ iw+++ j+ p sf+
Follow my project: MBlok | Find me on: Bandcamp | Twitter | Patreon

**
Rep: +0/-0Level 84


**
Rep: +0/-0Level 84
Hm. I´m getting an error at line 74:

forget_skill (skill_id[0]) if @unnatural_skills.include? (skill_id[0])


Error:

NoMethodError occured
undefined method `include?´for nil:NilClass

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
That's strange. Are you using any other scripts?

**
Rep: +0/-0Level 84
Yep. I few. Several KGC scripts, your advanced areas and quest script, plus Neo Message System, Face Battlers, Skill Shop and GoodVSEvil...

On of the KGC scripts is Passive Skills (wich also gives an error here: "if last_effects [:two_swords_style] != nil &&"... I solved that by taking
out the []... that is probably not a good idea, but the game works)...

When I remove Passive Skills, your script is giving an error at line 87 instead.

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
What is the error given at line 87?

Actually, can you just upload your scripts.rvdata? I'll put it in a project.


*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, I've taken a look. I was not able to get an error, but I did play around a bit and there are some pretty weird things going on.

For instance, try unequipping Ralph's shield and re-equipping.

I deleted this script, and both KGC Equipment scripts and it was still happening so I don't know what script is doing that.

**
Rep: +0/-0Level 84
Okay, thanks for your support and efforts anyway!

I guess I´ll have to fiddle around with them some more. Great script by the way, I´d love to get it to work!

**
Rep: +0/-0Level 84
Not to sound disrespectful but couldn't this be done pretty easily with events?

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
Not easily. No. But with events yes. I made a system for it in the event database of VX.

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
@grafikal - I don't remember seeing one  ???

It's not very efficient to do with events. It would involve checking the equipment for each actor a number of times uselessly - meaning that at least those 20 conditional branches would be run however many frames you choose (10 would probably be safe) and then having to make a conditional branch to make sure that any items you unequipped would lose the skill and that any items you just equip would give the skill. And most of these checks would happen when the player isn't even equipping or unequipping things. It's a lot more efficient to do it with a script, as it only checks for one piece of equipment when it is equipped, rather than all equipment all the time. There's too much going on in eventing to gunk it up with an event system like this would be, which has a lot more overhead than it's worth.

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
._.   I read this incorrectly. I thought this was the Visually Changing Equipment. >_>

I was thinking about the Visual Change Equipment tutorial I made.

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, it's pretty much the same I suppose :)

**
Rep: +0/-0Level 84
The sigil of ice keeps me at bay...
I've been using the script, and I've found that my characters don't forget the skills when I switch weapons

**EDIT**

Nevermind, I figured it out. Not a script problem, it's on my end ;)
« Last Edit: February 28, 2009, 11:05:01 PM by WeaponMaster Kaesar »
Why does nobody ever stab somebody with a gunblade, and then pull the trigger?


Which Final Fantasy Character Are You?
Final Fantasy 8

**
Rep: +0/-0Level 82
Dude, is there something extra to add to where it won't teach the skill unless you're a specific class?  Yeah, I'm remaking the NES version of FF3 and in that game, you buy magic and give it to characters to learn... but only certain classes can learn stuff... so yeah... any help?

**
Rep: +0/-0Level 82
For some reason when I try to teach a skill using a item it says I have a error in line 162. I've put \ls[2] in the note of it but it isn't working. Any idea why? I don't have any other script like this in the scripts I'm using.
--------
Script's I'm using
---------
KGC_ExtraDropItem
Multi Slot by DerVVulfman
And Disc Changer VX by omegazion

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Well, what does the error say?

My best bet, not knowing what the error says, is that you are getting a nil error, as @unnatural_skills is undefined. That would be the case if any of the scripts you are using (probably Multi-Slot if it does what it name suggests) overwrite the setup method of Game_Actor and Skill Teaching Equipment & Items is above it in the Script Editor.

So, try putting the Skill Teaching Equipment & Items script below all of the custom scripts you are using in the Script Editor (but still above Main), so put it below the scripts you just mentioned.


EDIT::

Though, thank you for calling my attention to this script - I realized there was a pretty serious error when an actor learns a new skill that he currently has through equipment. Updated the script to 2.0b!
« Last Edit: February 20, 2010, 06:46:09 PM by Modern Algebra »

**
Rep: +0/-0Level 82
Well it works now thanks.

**
Rep: +0/-0Level 82
I've been playing with version 1 of your script, and when I found the second version of your script I was hoping you had added text pop-ups in it, but you haven't. Is there a quick and simple way to create a pop up when you use an item and teach a player a skill?

Example: I'm creating Tombs, such as "Tomb of Flame" which will teach one character one skill (in this case "Flame"). All I want it to say when I use it is "[Player] learned [skill]!"

Thanks a ton!

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Do you want that message to appear in the menu as well, or only in battle like skills? If you want it to appear in the menu as well, where would you want it to appear and how big would you want the window to be? Would you simply want it to temporarily replace the help window or would you want it to be a popup near the character's profile on the targetting screen?

Also, I think you mean tome, not tomb. A tome is a book; a tomb is a place where you stuff dead people.
« Last Edit: March 12, 2010, 05:08:30 PM by modern algebra »

***
Rep:
Level 82
This is very useful, I am thankful that you made it! Thank you!

***
Rep:
Level 82
It crashes saved games that already have everything equipped. When you try to unequip them it gives a line 74 error...

forget_skill (skill_id[0]) if @unnatural_skills.include? (skill_id[0])

Only with saved games. New games are fine.

****
Rep:
Level 84
3...2...1...
Not meaning to resurrect a topic, but is it possible to assign a skill to a weapon (or weapon type such as a sword or a spear), but only have that skill learned while you have that weapon (or weapon type) equipped? And if you un-equip that item, you won't forget the skill, but it is unusable (or cannot be seen)?

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
What's the difference between forgotten and "cannot be seen"? You can have a skill forgotten when it's unequipped.

**
Rep:
Level 84
Umm actually thats basically what this script does. Only it does not really give you the skill.

IE:
Weapon
Fly Swatter
Gives skill with the \ls command.
Now when you unequip this weapon you TECHNICALLY loose that skill since you did not actually have it in the first place.
However using the \ls command you can give different weapons different skills.
This script does not actually teach you these skills to be kept forever.

For weapon types just use the \ls command and give that skill to each weapon. You can use the command lots of times per weapon/armor.
I think theres another script somewhere here (I forget which one I did not bother to use it lol) that can hide skills or at least disable them if you don't have a specific weapon equipped (IE: meleee slashing stuff like that set up.)

**
Rep: +0/-0Level 83
Sorry for necroposting, but um. Where's the download link?



... I really hope I didn't just read over it.

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
It doesn't have a demo - you just copy the script from the code box in the first post and paste it into your game.

**
Rep: +0/-0Level 66
RMRK Junior
Ummm....I really like this script but I can't get it to work. I can never get the skills to show up OR get added to the character's skill roster. HELP!

***
Rep:
Level 74
I'm baaack!
I evented this before. Only took a few minutes :P

**
Rep: +0/-0Level 66
RMRK Junior
Using the script is a lot easier than eventing this in my case: I'm making a Persona game and the amount of eventing needed would be astronomical!

***
Rep:
Level 84
---> LOL <---
I didn't see this and I might be blind - sorry for the necro post - I noticed that if a dagger teaches fire, you equip the dagger you use fire, then you equip a rod that teaches ice, you no longer have the skill fire, you just have ice. (I assumed this was similar to that of FF9). Maybe its a script incompatibility or maybe its the way you designed it, either way is this suppose to happen?

*****
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
That's intentional.
Once the weapon or armor is unequipped, you will no longer have access to that skill.
MA, could a write an add-on of sorts so that you can keep skills if desired?
it's like a metaphor or something i don't know

***
Rep:
Level 84
---> LOL <---
so its suppose to be like that? lose the skill when you unequipped the item?

*****
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
Yes. But I'll post an add-on anyway. I'll edit it into this post.
Code: [Select]
#===============================================================================
#
# This add-on must go directly beneath Modern Algebra's Skill Teaching Equipment
# & Items script. To make it so that the actor will not forget the skills once
# the item is unequipped, put the tag:
#   \keep_skills
# in the notebox of the item, armor or weapon.
# By Pacman, 21/12/2011
# ~! REQUIRES AND MUST BE PLACED BELOW MODERN ALGEBRA'S SKILL TEACHING EQUIPMENT
# AND ITEMS SCRIPT !~
#
# This requires no editing.
#
#===============================================================================

class RPG::BaseItem
  def keep_skills?
    return if self.class == RPG::Skill
    return @keep_skills if !@keep_skills.nil?
    @keep_skills = false
    self.note.split(/[\r\n]+/).each { |line|
      case line
      when /\\KEEP_SKILLS/i
        @keep_skills = true
      end
    }
    return @keep_skills
  end
end

class Game_Actor < Game_Battler
  def change_equip (equip_type, item, test = false)
    unless test
      last_item = equips[equip_type]
      unless last_item.keep_skills?
        # Forget the skills from what was previously equipped
        skill_ids = last_item.nil? ? [] : last_item.skill_ids
        skill_ids.each { |skill_id|
          forget_skill (skill_id[0]) if @unnatural_skills.include? (skill_id[0])
          @unnatural_skills.delete (skill_id[0])
        }
      end
    end
    # Run original method
    ma_skill_teaching_items_equipment_change (equip_type, item, test)
    unless test
      last_item = equips[equip_type]
      # Learn the skills from current_equipment
      skill_ids = last_item.nil? ? [] : last_item.skill_ids
      skill_ids.each { |skill_id|
        unless skill_learn? ($data_skills[skill_id[0]]) || self.level < skill_id[1]
          @unnatural_learning = true
          learn_skill (skill_id[0])
          @unnatural_learning = false
        end
      }
    end
  end
end
Make sure it's below this script.
« Last Edit: December 21, 2011, 10:11:15 AM by Pacman »
it's like a metaphor or something i don't know

***
Rep:
Level 84
---> LOL <---
I don't want to sound picky and I'm great Ful for this addon, how would you use both these scripts in such that a player isn't equipping, unequiping just to learn a skill?

***
Rep:
Level 84
---> LOL <---
Also: Undefined Method for: unless last_item.keep_skills? (line 35) thrown upon start up and yes this script is BELLOW modern algebras skill teaching script

The following scripts cause this issue:

MA's: Item/Equipment/Skill Conditions (modern algebra & Tsunokiette) -- this one could be really useful to make it compatible with. especially for my "how do you stop players from equipping and then unequipping weapons and armor just to learn a skill"
and Yems: Yanfly Engine Zealous - Equipment Overhaul

Not that i need it but in the future its best to make these things compatible (especially for the Yem on)
« Last Edit: December 21, 2011, 06:56:12 PM by Adrien. »

*****
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
I don't want to sound picky and I'm great Ful for this addon, how would you use both these scripts in such that a player isn't equipping, unequiping just to learn a skill?
... what?

And I don't get that error at all. It's definitely your other scripts. Although it would be easier if you posted the whole error.
it's like a metaphor or something i don't know

***
Rep:
Level 84
---> LOL <---
Let me explain in simple terms for you:

Your script does not prevent players from equipping then un-equipping just to learn a skill - It would be interesting to see if you could implement some kind of AP system. With Yanfly's Engine Zelous Equipment Overhaul script. And/or MA's: Item/Equipment/Skill Conditions (modern algebra & Tsunokiette) script (with either of those scripts) I get the following error:

-- See attached image --

So do you have a fix for these, if you have either of the script I listed you get this error. (This also applies, obviously, if you have both scripts). It does not matter if they are above or bellow your add on, they throw the error you see in the attached image.

Can you please fix the Item/Equipment/Skill Conditions incompatibility which can be seen here:

Code: [Select]
#==============================================================================
# ** Item/Equipment/Skill Conditions (modern algebra & Tsunokiette)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  This script allows you to set stats and/or level requirements for weapons
#  and armor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Instructions:
#    Place above Main and below Materials
#
#    To configure this script, you have to place codes in the Notes Field of
#   the respective items. These codes are:
#     
#     \LVLR[<level_requirement>]           *Actor must be at least this level
#     \HPR[<hp_requirement>]               *Actor must have this much HP
#     \MPR[<mp_requirement>]               *Actor must have this much MP
#     \ATKR[<attack_requirement>]          *Actor must have this much Attack
#     \DEFR[<defense_requirement>]         *Actor must have this much Defense
#     \SPIR[<spirit_requirement>]          *Actor must have this much Spirit
#     \AGIR[<agility_requirement>]         *Actor must have this much Agility
#     \WPNR[<weapon_id>]                   *Weapon must be equipped
#     \ARMR[<armor_id>]                    *Armor must be equipped
#     \ITMR[<item_id>, <n>]                *At least n of item_id in possession
#     \ITMR[<item_id>, <n>]C               *As above and consumed upon use.
#     \PWPNR[<possession_weapon_id>, <n>]  *At least n of weapon_id in possession
#     \PWPNR[<possession_weapon_id>, <n>]C *As above and consumed upon use.
#     \PARMR[<possession_armor_id>, <n>]   *At least n of armor_id in possession
#     \PARMR[<possession_armor_id>, <n>]C  *As above and consumed upon use.
#     \SKLR[<skill_id>]                    *Skill must be learned
#     \STER[<state_id>]                    *State must be added
#
#    After any of them that make sense, you can also add these restrictions:
#      >= - greater than or equal to - default
#      <= - less than or equal to
#      >  - strictly greater than
#      <  - strictly less than
#      =  - strictly equal to
#
#    You can leave out any or all or none of them and the script will only
#   restrict the attributes you set
#
#   EXAMPLE:
#     If Club has a Notes Field like this:
#
#       \LVLR[6]<
#       \ATKR[37]
#       \AGIR[27]>
#
#      then an actor could only use that club if he was less than level 6, had
#     an Attack of at least 37 and an Agility of at least 28.
#==============================================================================
# ** RPG::BaseItem
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes
#    new method - requirements_field
#==============================================================================

class RPG::BaseItem
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Requirement Field
  #--------------------------------------------------------------------------
  #  This method returns an array of restrictions on using each item
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def requirement_field
    r_field = []
    # Dissect Note
    text = self.note.dup
    text.sub! (/\\lvlr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # HP Requirement
    text.sub! (/\\hpr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # MP Requirement
    text.sub! (/\\mpr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # Attack Requirement
    text.sub! (/\\atkr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # Defense Requirement
    text.sub! (/\\defr\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # Spirit Requirement
    text.sub! (/\\spir\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    # Agility Requirement
    text.sub! (/\\agir\[(\d+?)\](<*>*=*)/i) { '' }
    r_field.push ([$1.to_i, $2.to_s])
    r_field.push ([], [], [], [], [], [], [], [], [], [])
    # Weapon Requirement
    r_field[7].push ($1.to_i) while text.sub! (/\\wpnr\[(\d+?)\]/i) {''} != nil
    # Armor Requirement
    r_field[8].push ($1.to_i) while text.sub! (/\\armr\[(\d+?)\]/i) {''} != nil
    # Item Possession Requirement
    while text.sub! (/\\itmr\[(\d+),*\s*(\d*)\](C*)(<*>*=*)/i) { '' } != nil
      r_field[9].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s])
      # Consumable items
      r_field[14].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s]) if $3 != ""
    end
    # Weapon Possession Requirement
    while text.sub! (/pwpnr\[(\d+),*\s*(\d*)\](C*)(<*>*=*)/i) {''} != nil
      r_field[10].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s])
      # Consumable weapons
      r_field[15].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s]) if $3 != nil
    end
    # Armor Possession Requirement
    while text.sub! (/parmr\[(\d+),*\s*(\d*)\](C*)(<*>*=*)/i) {''} != nil
      r_field[11].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s])
      # Consumable Armors\
      r_field[16].push ([$1.to_i, [$2.to_i, 1].max, $4.to_s]) if $3 != nil
    end
    # Skill Requirement
    r_field[12].push ($1.to_i) while text.sub! (/\\sklr\[(\d+?)\]/i) {''} != nil
    # State Requirement
    r_field[13].push ($1.to_i) while text.sub! (/\\ster\[(\d+?)\]/i) {''} != nil
    return r_field
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Check requirements
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def check_reqs (user)
    actor_stats = [user.level, user.maxhp, user.maxmp, user.atk, user.def, user.spi, user.agi]
    reqs = self.requirement_field
    # Stats
    for i in 0...7
      case reqs[i][1]
      when "" # Assume Greater than or Equal to
        return false unless actor_stats[i] >= reqs[i][0]
      else # Other
        begin
          eval ("return false unless actor_stats[i] #{reqs[i][1]} reqs[i][0]")
        rescue
        end
      end
    end
    data = [$data_items, $data_weapons, $data_armors]
    # Weapons and Armor equips
    for i in 7...9
      reqs[i].each { |j|
        return false unless user.equips.include? (data[i-6][j])
      }
    end
    # Items, Weapons, Armors in possession
    for i in 9...12
      reqs[i].each { |j|
        case j[2]
        when ""
          return false unless $game_party.item_number (data[i-9][j[0]]) >= j[1]
        else
          begin
            eval ("return false unless $game_party.item_number (data[i-9][j[0]]) #{j[2]} j[1]")
          rescue
          end
        end
      }
    end
    # Skills learned
    self.requirement_field[12].each { |i| return false unless user.skill_learn? ($data_skills[i]) }
    # States
    self.requirement_field[13].each { |i| return false unless user.state? (i) }
    return true
  end
end
 
#==============================================================================
# ** Game_Actor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    new method - check_reqs, consume_reagants
#    aliased_methods - equippable?, setup, level_down, maxhp=, maxmp=, atk=,
#                      def=, spi=, agi=
#    modified super - skill_effect, item_effect, skill_can_use?, item_effective?
#==============================================================================

class Game_Actor < Game_Battler
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Setup
  #     actor_id : actor ID
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_equip_required_actor_stp_7ht1 setup
  def setup (actor_id)
    # Run Original Method
    modalg_equip_required_actor_stp_7ht1 (actor_id)
    # Make sure all starting items are allowed to be on the hero
    check_equip_reqs
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Determine if Equippable
  #     item : item
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_eqp_reqs_actor_check_equip_5js9 equippable?
  def equippable?(item)
    return false if item == nil
    return modalg_eqp_reqs_actor_check_equip_5js9 (item) & item.check_reqs (self)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Determine Usable Skills
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def skill_can_use? (skill)
    test = super (skill)
    return skill.check_reqs (self) if test
    return test
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Determine if an Item can be Used
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def item_effective?(user, item)
    return super (user, item) if user.is_a? (Game_Enemy)
    return super (user, item) & item.check_reqs (user)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Apply Item Effects
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def item_effect(user, item)
    super (user, item)
    # Consume reagants if consumable
    consume_reagants (item)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Apply Skill Effects
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def skill_effect(user, skill)
    super (user, skill)
    # Consume reagants if consumable
    consume_reagants (skill)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Check Equipment Requirements
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def check_equip_reqs
    @checking_equipment = true
    equip_array = equips.dup
    for i in 0...5
      # Unequip everything
      change_equip (i, nil, true)
      test = equippable? (equip_array[i])
      change_equip (i, equip_array[i], true)
      # Unequip item for real if requirements not met
      change_equip (i, nil) unless test
    end
    @checking_equipment = false
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Consume Reagants
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def consume_reagants (item)
    unless @skipped || @missed || @evaded
      # Remove items, weapons, and armors
      item.requirement_field[14].each { |i| $game_party.lose_item ($data_items[i[0]], i[1]) }
      item.requirement_field[15].each { |i| $game_party.lose_item ($data_weapons[i[0]], i[1]) }
      item.requirement_field[16].each { |i| $game_party.lose_item ($data_armors[i[0]], i[1]) }
    end
  end
  #--------------------------------------------------------------------------
  # * Make sure requirements still met if stats decrease in any way
  #--------------------------------------------------------------------------
  alias modalg_eqpreqs_lvlup_check_9dn4 level_up
  def level_up
    modalg_eqpreqs_lvlup_check_9dn4
    check_equip_reqs
  end
 
  alias modalg_equip_reqs_changelvl_check_5hy2 level_down
  def level_down
    modalg_equip_reqs_changelvl_check_5hy2
    check_equip_reqs
  end
 
  alias modalg_equip_reqs_changemaxhp_check_h83d maxhp=
  def maxhp=(new_maxhp)
    modalg_equip_reqs_changemaxhp_check_h83d (new_maxhp)
    check_equip_reqs
  end
 
  alias modalg_equip_reqs_changemxmp_check_8fjq maxmp=
  def maxmp=(new_maxmp)
    modalg_equip_reqs_changemxmp_check_8fjq (new_maxmp)
    check_equip_reqs
  end
 
  alias modalg_equip_reqs_change_atk_94nd atk=
  def atk=(new_atk)
    modalg_equip_reqs_change_atk_94nd (new_atk)
    check_equip_reqs
  end
 
  alias modernalg_chck_reqs_def_73ij def=
  def def=(new_def)
    modernalg_chck_reqs_def_73ij (new_def)
    check_equip_reqs
  end
 
  alias modalgebra_reqs_chck_sprit_8dsn spi=
  def spi=(new_spi)
    modalgebra_reqs_chck_sprit_8dsn (new_spi)
    check_equip_reqs
  end
 
  alias modalgebra_requirements_equipment_agi_6hdt agi=
  def agi=(new_agi)
    modalgebra_requirements_equipment_agi_6hdt (new_agi)
    check_equip_reqs
  end
 
  alias ma_chck_eqp_reqs_chnge_equip_7fn change_equip
  def change_equip (equip_type, item, test = false)
    ma_chck_eqp_reqs_chnge_equip_7fn (equip_type, item, test)
    check_equip_reqs if @checking_equipment == nil || !@checking_equipment && !test
  end
 
  alias ma_frgt_skill_check_eqp_reqs_8her forget_skill
  def forget_skill (skill_id)
    ma_frgt_skill_check_eqp_reqs_8her (skill_id)
    check_equip_reqs if @checking_equipment == nil || !@checking_equipment
  end
end

#==============================================================================
# ** Game_Party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased methods - item_can_use?
#==============================================================================

class Game_Party
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Item Can Use?
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_req_itm_party_use_9m43 item_can_use?
  def item_can_use? (item)
    # Run Original Method
    test = modalg_req_itm_party_use_9m43 (item)
    return false unless test
    if $game_temp.in_battle
      return test & item.check_reqs ($scene.active_battler)
    else
      $game_party.members.each { |i| return test if item.check_reqs (i) }
      return false
    end
  end
end

#==============================================================================
# ** Scene_Battle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    makes public - active_battler
#==============================================================================

class Scene_Battle < Scene_Base
  attr_reader :active_battler
end

#==============================================================================
# ** Scene_Item
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased method - use_item_nontarget
#==============================================================================

class Scene_Item < Scene_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Use Item (apply effects to non-ally targets)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_eqp_reqs_consume_regnts_refresh_rn4 use_item_nontarget
  def use_item_nontarget
    # Run Original Method
    modalg_eqp_reqs_consume_regnts_refresh_rn4
    # Refresh Item Window
    @item_window.refresh
  end
end


Has this all been made clear enough or .....


in theory if you fix the incompatibility for one you'll fix it for the other.

*****
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
If you're asking for help from someone, it's a good idea not to be condescending to them. Especially if the error is on your end and you haven't provided enough information of it. I don't have to do any of this for you, you should be grateful anyone does anything for you here considering the way you act, the things you do and your lack of contribution on this forum. Anyway,
Your script does not prevent players from equipping then un-equipping just to learn a skill
That's because that's what you told me what to do. That is exactly what you told me to do.

I fixed the MA/Tsunokiette incompatibility. Against my better judgement, I'm not going to ask you for a good reason to post it, you can just be grateful for once. Replace my add-on with this.
Code: [Select]
#===============================================================================
#
# This add-on must go directly beneath Modern Algebra's Skill Teaching Equipment
# & Items script. To make it so that the actor will not forget the skills once
# the item is unequipped, put the tag:
#   \keep_skills
# in the notebox of the item, armor or weapon.
# By Pacman, 21/12/2011
# ~! REQUIRES AND MUST BE PLACED BELOW MODERN ALGEBRA'S SKILL TEACHING EQUIPMENT
# AND ITEMS SCRIPT !~
#
# This requires no editing.
#
#===============================================================================

class RPG::BaseItem
  def keep_skills?
    return if self.class == RPG::Skill
    return @keep_skills if !@keep_skills.nil?
    @keep_skills = false
    self.note.split(/[\r\n]+/).each { |line|
      case line
      when /\\KEEP_SKILLS/i
        @keep_skills = true
      end
    }
    return @keep_skills
  end
end

class Game_Actor < Game_Battler
  def change_equip (equip_type, item, test = false)
    unless test
      last_item = equips[equip_type]
      unless last_item.nil?
        unless last_item.keep_skills?
          # Forget the skills from what was previously equipped
          skill_ids = last_item.nil? ? [] : last_item.skill_ids
          skill_ids.each { |skill_id|
            forget_skill (skill_id[0]) if @unnatural_skills.include? (skill_id[0])
            @unnatural_skills.delete (skill_id[0])
          }
        end
      end
    end
    # Run original method
    ma_skill_teaching_items_equipment_change (equip_type, item, test)
    unless test
      last_item = equips[equip_type]
      # Learn the skills from current_equipment
      skill_ids = last_item.nil? ? [] : last_item.skill_ids
      skill_ids.each { |skill_id|
        unless skill_learn? ($data_skills[skill_id[0]]) || self.level < skill_id[1]
          @unnatural_learning = true
          learn_skill (skill_id[0])
          @unnatural_learning = false
        end
      }
    end
  end
end
it's like a metaphor or something i don't know

***
Rep:
Level 84
---> LOL <---
Thank you for fixing it. Thank you for posting it. I am grateful and I apologize to you for any offense I created. I have no right to ask but I am going to either way: Can you make or extend your add on to include ap points so that:

  • If a player equips a sword that teaches ice, they need x amount of AP to learn it
  • AP should be able to be gien by enemies in random battles (enemy note tag) or through NPC's (event driven scripts)
  • Once the player has x number of AP points they should be alerted some how, either after battle or in a dialogue (depending on how they received the AP) that they have "mastered" said skill

If you do this, ill be for ever in your debt. I am assuming your familiar with FF9?

Again thank you for fixing this issue.

*****
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
That system seems a bit too much to tackle right now. Sorry about that. It is a good idea, but I'm not really up to something that complex right now.
it's like a metaphor or something i don't know

***
Rep:
Level 84
---> LOL <---
That system seems a bit too much to tackle right now. Sorry about that. It is a good idea, but I'm not really up to something that complex right now.

that's ok with your fixed patch I can work around it by assigning weapons only at specific levels. thus avoiding the whole "equip to learn then unequip" issue. Now if you want some holy spell you have to be level x.

When and if War of the Souls updates for this forum, youll be specially thanked. If your on RRR you'll be specially thanked.

*
Rep: +0/-0Level 55
I'm very sorry about the necropost, but I didn't think it was necessary to start a whole new topic. Let me know if I should, though.

I've been running into a problem when starting up the playtest. The error reads: "Script ' ' line 61: TypeError occurred. Undefined superclass 'Game_Battler'".

I assume it has to do with my other scripts since no one has brought it up before. The only one that I can think of being incomatible with this is the KGC Rate Damage script, the other three don't have Game_Battler anywhere. KGC Rate Damage is above this script

I don't know anything about scripting, though, and I apologize if this is a simple fix.
"Wise men choose death before war.
Wiser men choose not to be born." - Angelus

*
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 Veteran2011 Favourite Staff Member2011 Most Mature Member2011 Best RPG Maker User (Scripting)2011 Best Use of Avatar and Signature Space2010 Most Mature Member2010 Favourite Staff Member
Where are you placing this script in the script order?

If you are placing it above Main and below Materials, then I think I might need to see a demo with the error recreated. It might just be something elementary of which I have not thought, but the only thing I can think of blind is that you are accidentally putting the script above Game_Battler.
« Last Edit: August 13, 2012, 08:23:56 PM by modern algebra »

*
Rep: +0/-0Level 55
Ah, I've been messing around a bit more, and I finally decided to just delete your script and try playtesting again. The problem was within the KGC script and it appears to be solved. I've replaced this script and it's still working. Oddly enough, the error in the other script (to me at least) appears to have nothing to do with Game_Battler, it was just an out of place line of asterisks.

Thank you so much, for the script and support!
"Wise men choose death before war.
Wiser men choose not to be born." - Angelus