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

Is there anyone need help with anything except art and music?
is Gotcha Gotcha Games Inc. = KADOKAWA CORPORATION? I haven't found this topic yet, Want to know for credits on my game. Thanks.
If you get everything you want, when you want it, it kills your creativity. If you never get anything you want, you're forced to be creative with what you have.
Old chiptune loops free for use.
I think I've got my hero designs pretty much finialised ( still got some tweaks. ) In the end it'll be the four outfit colour variants with four different skintones.

Forum statistics

Threads
104,299
Messages
1,005,378
Members
135,818
Latest member
Hennet91
Top