KEquippedSkills XP

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
287
Reaction score
71
First Language
English
Primarily Uses
RMXP
KEquippedSkills XP

by Kyonides Arkanthes


Introduction

It's a scriptlet that allows you to equip skills aka temporarily learn a skill if a piece of equipment like a weapon or an accessory is currently equipped.

There was another scriptlet out there but it sucked :p for it used an iterator when I noticed it gotta be simpler. And yes, I was right about that! Take a look for yourselves!

Code:
# * KEquippedSkills XP
#   Scripter : Kyonides Arkanthes
#   2020-08-12 - v1.0.2

module KEquip
  WEAPONS = {}
  ARMORS = {}
  # WEAPONS[WeaponID] = Skill ID to be learned
  # ARMORS[ArmorID] = Skill ID to be learned
  # ARMORS[ArmorID] = [Skill ID1, Skill ID2, etc.]
  ARMORS[43] = 162
end

class Game_Actor
  alias :kyon_ekuip_skills_gm_actor_init :initialize
  alias :kyon_ekuip_skills_gm_actor_sklr? :skill_learn?
  alias :kyon_ekuip_skills_gm_actor_equip :equip
  def initialize(actor_id)
    @equip_skills = Array.new(5, nil)
    kyon_ekuip_skills_gm_actor_init(actor_id)
    update_equip_skills
  end

  def skill_learn?(skill_id)
    return true if self.equip_skills.include?(skill_id)
    kyon_ekuip_skills_gm_actor_sklr?(skill_id)
  end

  def update_equip_skills
    @equip_skills[0] = KEquip::WEAPONS[@weapon_id]
    @equip_skills[1] = KEquip::ARMORS[@armor1_id]
    @equip_skills[2] = KEquip::ARMORS[@armor2_id]
    @equip_skills[3] = KEquip::ARMORS[@armor3_id]
    @equip_skills[4] = KEquip::ARMORS[@armor4_id]
  end

  def equip(equip_type, id)
    kyon_ekuip_skills_gm_actor_equip(equip_type, id)
    update_equip_skills
  end
  def equip_skills() @equip_skills.flatten.compact end
  def skills() @skills | self.equip_skills end
end
Terms & Conditions

Free for use in any game.
Include my nickname in your game credits.
Mention this forum as well.
Give me a free copy of your completed game if you include at least 2 of my scripts! :p
 
Last edited:

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
287
Reaction score
71
First Language
English
Primarily Uses
RMXP
Curious Update

This time I added the possibility of equipping more than a single skill per equipment slot. What makes it a great thing is that you still can equip a single skill on any other slot!
This script now starts looking like a simple version of a Materia script to me.
 

ButterChin

Warper
Member
Joined
Sep 27, 2020
Messages
1
Reaction score
0
First Language
Portuguese (BR)
Primarily Uses
RMXP
1601235360684.png
1601235384681.png


I just added one thing and it gave an error
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
258
Reaction score
95
First Language
English
Primarily Uses
RMXP
Don't do 009. Just do 9.
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
287
Reaction score
71
First Language
English
Primarily Uses
RMXP
Yeah, even 009 should have worked but it's totally unnecessary so follow his recommendation, @ButterChin. The actual reason why it failed was that one of the characters seems to be an O as in Omaha or Otter or OK. :D
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Yesterday I made my first step towards eating more healthily.
I saw candy on discount and did not buy it.
"They yearn for what they fear for."
I always told my DA fans how much I hate slot machines. They're fine in games as a risk-and-reward system. But when you're spending REAL MONEY in a Vegas casino to try and hit the jackpot (which very, very few people will), it can really hurt your budget. Gambling is a bad habit, and I don't like wasting my money on a slim chance. Go to Vegas for the experience, not the jackpot.
Took the kids to a corn maze. They gave us a map and had lights at certain points in the maze. Not overwhelming... or underwhelming... just... whelming.

Forum statistics

Threads
104,399
Messages
1,006,108
Members
135,929
Latest member
raffle
Top