Main Menu
  • Welcome to The RPG Maker Resource Kit.

Skill Teaching Equipment & Items (VX Edition)

Started by modern algebra, January 28, 2008, 04:09:26 AM

0 Members and 1 Guest are viewing this topic.

Grafikal

Not easily. No. But with events yes. I made a system for it in the event database of VX.

modern algebra

@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.

Grafikal

._.   I read this incorrectly. I thought this was the Visually Changing Equipment. >_>

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

modern algebra


WeaponMaster Kaesar

#29
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 ;)
Why does nobody ever stab somebody with a gunblade, and then pull the trigger?


Which Final Fantasy Character Are You?
Final Fantasy 8

Felix Flywheel

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?

Sakani17

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

modern algebra

#32
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!

Sakani17


Thwarten

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!

modern algebra

#35
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.

ShortStar

This is very useful, I am thankful that you made it! Thank you!

ShortStar

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.

Countdown

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)?

modern algebra

What's the difference between forgotten and "cannot be seen"? You can have a skill forgotten when it's unequipped.

wsensor

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.)

kotchomet

Sorry for necroposting, but um. Where's the download link?



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

modern algebra

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.

protoman113

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!

Infinate X

I evented this before. Only took a few minutes :P

protoman113

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!

Adrien

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?

pacdiggity

That's intentional.
Quote from: modern algebra on January 28, 2008, 04:09:26 AM
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

Adrien

so its suppose to be like that? lose the skill when you unequipped the item?

pacdiggity

#49
Yes. But I'll post an add-on anyway. I'll edit it into this post.
#===============================================================================
#
# 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.
it's like a metaphor or something i don't know