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 Posts

Latest Profile Posts

We are truly intellectuals.
Without using violence without weapons
Our group has as many as 1.3 million people and more than 1 hundred thousand talks.
We gathered in an hour, more than 4.5 Half a hundred thousand



I got a Sword.
I got an Axe.
I got two Swords.
Nothing to see here, just walking with my dog.
I haven’t worked on my game in a while. Tomorrow might be the day.
*squeals* :kaoblush:


I've been experimenting with improved memory management again, which allowed me to include items to increase player path length. These are both 44 grid spaces long, and stable. :LZSexcite:
I FINALLY DID IT! 5 years making my very first game and I just officially released it on STEAM..... OMG..... I can say I finished a game! The feelings!!!!!

Forum statistics

Threads
104,462
Messages
1,006,464
Members
135,970
Latest member
Robb_dog14
Top