Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Assign Skills with Items and Equipment, A script that's not here
Mr_E_Man
post Mar 8 2008, 10:58 PM
Post #1


Level 8
Group Icon

Group: Revolutionary
Posts: 124
Type: Event Designer
RM Skill: Skilled




I stumbled across this very excellent script a while ago. It's one of the few good resources that isn't on this site.

Just copy and paste this code into a new section under materials. Follow the instructions at the top of the code.

CODE
#=================================================================
#  Skill Teaching Equipment & Items
#  Version 1.0
#  Author: modern algebra (rmrk.net)
#  Date: January 27, 2008
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Instructions:
#     Insert this script just above Main. To configure your database, see the
#     Configuration Section at lines 29, 66, and 97 (by default; once you've
#     configured some of the data, this will change)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ** RPG
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Adds an additional stat, skill_id, to weapons, armors, and items
#=================================================================

module RPG
#=================================================================
# ** Item
#=================================================================

class Item
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Skill ID
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def skill_id
    learn_skill = 0
    case @id
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * CONFIGURATION
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    #  It is very easy to configure the database. All that you need to do
    #  is write:
    #
    #     when <item ID>
    #       learn_skill = <skill_id>
    #
    #  For every item that you want to teach skills. To discover what the
    #  ID of an item or a skill is, look at the number directly to the left
    #  of their names in the Database. There are two examples below. Feel
    #  free to delete them once you understand what you need to do.
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    when 1 # Potion
      learn_skill = 1 # Heal
    when 2 # High Potion
      learn_skill = 69 # Poison Edge
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * END CONFIGURATION
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    end
    return learn_skill
  end
end  

#================================================================
# ** Weapon
#================================================================

class Weapon
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Skill ID
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def skill_id
    learn_skill = 0
    case @id
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * CONFIGURATION
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    #
    #     when <weapon ID>
    #       learn_skill = <skill_id>
    #
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    when 1 # Bronze Sword
      learn_skill = 1 # Heal
    when 2 # Iron Sword
      learn_skill = 69 # Poison Edge
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * END CONFIGURATION
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    end
    return learn_skill
  end
end  

#=================================================================
# ** Armor
#=================================================================

class Armor
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Skill ID
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def skill_id
    learn_skill = 0
    case @id
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * CONFIGURATION
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    #
    #     when <armor ID>
    #       learn_skill = <skill_id>
    #
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    when 1 # Bronze Shield
      learn_skill = 1 # Heal
    when 2 # Iron Shield
      learn_skill = 69 # Poison Edge
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * END CONFIGURATION
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    end
    return learn_skill
  end
end
end

#==================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==================================================================

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)
    last_item = equips[equip_type]
    # Forget the skill from what was previously equipped
    unless test
      skill_id = last_item.nil? ? 0 : last_item.skill_id
      forget_skill (skill_id) if @unnatural_skills.include? (skill_id)
      @unnatural_skills.delete (skill_id)
    end
    # Run original method
    ma_skill_teaching_items_equipment_change (equip_type, item, test)
    unless test
      skill_id = item.nil? ? 0 : item.skill_id
      unless @skills.include? (skill_id) || skill_id == 0
        learn_skill (skill_id)
        @unnatural_skills.push (skill_id)
      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?
      skill_id = item.skill_id
      next if skill_id == 0 || @skills.include? (skill_id)
      @unnatural_skills.push (skill_id)
      learn_skill (skill_id)
    end
  end
end

#==============================================================================
# ** Game_Battler (Skill Teaching modification)
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass for the Game_Actor
#  and Game_Enemy classes.
#==============================================================================

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
      effective |= !@skills.include? (item.skill_id)
    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)
    if item.skill_id != 0 && self.class != Game_Enemy && !@skills.include? (item.skill_id)
      @unnatural_skills.delete (item.skill_id)
      learn_skill (item.skill_id)
    end
  end
end


Serious props go to modern algebra for this script. I owe you a drink or a lunch, bro.


__________________________
We exist within all things and all things exist within us... it's very crowded.
Go to the top of the page
 
+Quote Post
   
Mech-Ah
post Mar 8 2008, 11:17 PM
Post #2


Level 2
Group Icon

Group: Member
Posts: 25
Type: None
RM Skill: Undisclosed




Nice, and I think many people waited for this. I know one for sure.
Go to the top of the page
 
+Quote Post
   
aevonhaldy
post Mar 9 2008, 06:30 PM
Post #3


Level 4
Group Icon

Group: Member
Posts: 58
Type: Developer
RM Skill: Beginner




Can someone post this script as a txt so that it doesn't lose formatting when copy and paste?

Thanks!


__________________________
[Show/Hide] VX Project

Story - 85%
Database - 55%
Scripts - 90%
Maps - 8%
Graphics - 38%
Original Music - 20%
Go to the top of the page
 
+Quote Post
   
neclords
post Mar 10 2008, 02:59 AM
Post #4


Love me! I wanna you to love me!
Group Icon

Group: Revolutionary
Posts: 196
Type: Event Designer
RM Skill: Beginner




This is the txt file
Attached File  Skill_Teaching.txt ( 6.84K ) Number of downloads: 272


__________________________

~Time To sWallow tHe Pain and VaniSH OuR HuRt~
Go to the top of the page
 
+Quote Post
   
Mr_E_Man
post Mar 10 2008, 01:50 PM
Post #5


Level 8
Group Icon

Group: Revolutionary
Posts: 124
Type: Event Designer
RM Skill: Skilled




@neclords

Thanks for posting the .txt file. I was lazy and didn't check back to the forum regularly.


__________________________
We exist within all things and all things exist within us... it's very crowded.
Go to the top of the page
 
+Quote Post
   
Tamashii7
post Mar 12 2008, 10:41 PM
Post #6


Level 5
Group Icon

Group: Member
Posts: 71
Type: Writer
RM Skill: Advanced




I don't quite understand the game actor section of the script. I got my items in the armor slot, but now its telling me to configure the game actors.

This post has been edited by Tamashii7: Mar 15 2008, 02:59 PM
Go to the top of the page
 
+Quote Post
   
itsukii
post Apr 23 2008, 09:59 PM
Post #7


Level 1
Group Icon

Group: Member
Posts: 7
Type: None
RM Skill: Beginner




Is there any way to modify this script so that certain abilities on weapons or armour have a level requirement as well?

For example; a Sword that can teach Flame Strike and Ice Strike. But you have to be Lv10 for Flame Strike and Lv15 for Ice Strike
Go to the top of the page
 
+Quote Post
   
MBii
post Jun 23 2008, 10:10 AM
Post #8


Level 5
Group Icon

Group: Member
Posts: 62
Type: Event Designer
RM Skill: Skilled




Another question :

If the item isn't equiped anymore, does the actor still 'know' the skill.

If so, it would be very usefull.


Second question :

How doe you set 2 skills to one armor ?

This post has been edited by MBii: Jun 23 2008, 01:33 PM


__________________________
Calvin for president !


Go to the top of the page
 
+Quote Post
   
Blank2
post Jun 23 2008, 11:18 PM
Post #9



Group Icon

Group: Member
Posts: 2
Type: Event Designer
RM Skill: Skilled




And the Author is: INSERT HERE
Go to the top of the page
 
+Quote Post
   
YanXie
post Jun 23 2008, 11:26 PM
Post #10


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




QUOTE
And the Author is: INSERT HERE


Did you seriously read the post after all? :/

Look :

QUOTE
Serious props go to modern algebra for this script. I owe you a drink or a lunch, bro.


And there is also mentioned author name in the script.


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   
MBii
post Jun 24 2008, 06:03 AM
Post #11


Level 5
Group Icon

Group: Member
Posts: 62
Type: Event Designer
RM Skill: Skilled




puppeto could you say how to assign 2 (or more) skills to one piece of armor ? Please, or is this impossible ?


__________________________
Calvin for president !


Go to the top of the page
 
+Quote Post
   
YanXie
post Jun 25 2008, 05:12 AM
Post #12


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




Yeah, it is impossible with the current version, since this script doesn't use array for the skill ID...

It will need a lot of edit to add this feature


cheers, puppeto4. smile.gif


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   
MBii
post Jun 26 2008, 12:33 AM
Post #13


Level 5
Group Icon

Group: Member
Posts: 62
Type: Event Designer
RM Skill: Skilled




Uhu, but I was able to assign multiple skills to armors, weapons, items with an event (see tutorials). I still use the script for the cursed items ...

Edit : Tutorial

This post has been edited by MBii: Jun 26 2008, 07:01 AM


__________________________
Calvin for president !


Go to the top of the page
 
+Quote Post
   
YanXie
post Jun 26 2008, 12:53 AM
Post #14


Because Tomorrow Will Surely Come...
Group Icon

Group: Revolutionary
Posts: 1,137
Type: None
RM Skill: Skilled




Well yeah, currently the script is using integer for the skill ID assigning, so you can't have 2 integers for that. Look like you'll need to use eventing if you intend to do that.

cheers, puppeto4. smile.gif


__________________________
how make teleport to graveyard then your character die?

AWAY FOR VACATION.
NOT HERE UNTIL JAN/FEB 2010 -w-/
Go to the top of the page
 
+Quote Post
   
zen03y
post Jul 5 2008, 11:52 AM
Post #15


Level 4
Group Icon

Group: Member
Posts: 52
Type: None
RM Skill: Skilled




Um...how does this work? Where do I type the stuff like this:

when 1 # Bronze Sword
learn_skill = 1 # Heal
when 2 # Iron Sword
learn_skill = 69 # Poison Edge

?
Go to the top of the page
 
+Quote Post
   
Bredd
post Jul 5 2008, 12:44 PM
Post #16


Level 3
Group Icon

Group: Member
Posts: 33
Type: Developer
RM Skill: Skilled




He has a better version of this on rmrk.net that takes use of the notes box. It's easier to configure and works just the same.
Go to the top of the page
 
+Quote Post
   
andani
post Nov 2 2008, 03:35 AM
Post #17


Level 4
Group Icon

Group: Member
Posts: 47
Type: Event Designer
RM Skill: Skilled




Oh thanks so very much for showing us the script you found! It has helped me immensely!


__________________________





My name's Andani. I am a very blunt person who says what they feel. I usually do not reveal my thoughts except when I feel obliged.

-Andani Yunatta Kappenluthe
Go to the top of the page
 
+Quote Post
   
conmaster3
post Nov 3 2008, 02:29 PM
Post #18


Level 5
Group Icon

Group: Member
Posts: 71
Type: Scripter
RM Skill: Advanced




Hey nice script.. i definitely gonna use it in one of my projects but i have an idea of an extra option... maybe you could add an bar of exp of some sort that if you used the item long enough to let the skill permanently add to ur skill for example:

when 1 # Dark Dagger
earn_skill = 1 # Darkness
#Add the option for the timer (or whatever you gonna call it)
#If the Dark Dagger has 100 AP (Ability Points) Darkness is available when the Dark Dagger isn't equipped

Its only an idea maybe its not possible but its a nice script anyway..

greetzz,

Cell(Conmaster3)


__________________________

Current Game(s):

[Show/Hide] Fantasy Tail
Fantasy Tail

Story line 15%
Game 15%
Monsters 0%
Characters 0%
Weapons 80%
Armor 80%
Skills 0%
Spells 0%

Total game script 60%

Downloaded 0% (In use)
A lot has been downloaded but all scripts has been replaced or removed
Own Created 40% (In use)
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 23rd May 2013 - 04:28 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker