12-30-2021, 04:34 AM
(This post was last modified: 12-27-2023, 03:31 AM by kyonides.
Edit Reason: FixedArray Now Required
)
KPartyActors XP
by Kyonides
Introduction
Usually RMXP lets you upgrade your heroes by leveling them up. This script completely changes that reality by introducing a party level handicap of sorts. You can't keep leveling up if the party as a whole doesn't do the same.
It also sports the custom skills and battle skills features. Now your heroes can only use their preselected battle skills during those tough battles!
I guess that adds some level of complexity and promotes the development of strategies and tactics in game.
Warning!
I have overwritten a few default methods so please read the embedded comments first.
The FixedArray script is now required by the script posted below.
The FixedArray script is now required by the script posted below.
The Script
Code:
# * KPartyActors XP
# Scripter : Kyonides Arkanthes
# 2022-01-01
# Requires: FixedArray
# Leveling up an actor will depend on your current party's level.
# EXP does not affect an actor's level so it can be used as a
# secondary ingame currency now.
# This script also features the kustom_skills and battle_skills!
# kustom_skills are skills the player have purchased that were not supposed
# to be learned by a given actor.
# battle_skills are a subset of all of the skills learned by any actor.
# * Overwritten Methods * #
# - Game_Actor class
# exp= level= skills skill_learn?
# - Window_Skill class
# refresh
# * Script Calls * #
# - Change current Party's Level
# $game_party.level = NewLevel
# $game_party.level += Levels
# $game_party.level -= Levels
# - Change Party's Maximum Level
# $game_party.level_max = NewLevelMax
# $game_party.level_max += MoreLevels
# $game_party.level_max -= LessLevels
# - Toggle Freezing of Level Up feature
# Default Value: false
# $game_party.freeze_level_up = true or false
# - Get a Party Member - Prerequisite
# actor = $game_party.actors[Index]
# - Get Current Maximum Number of Kustom Skills or Battle Skills
# actor.kustom_skills_max
# actor.battle_skills_max
# - Set New Maximum Number of Kustom Skills or Battle Skills
# actor.kustom_skills.maxsize = +Number
# actor.battle_skills.maxsize = +Number
# - Add New Kustom Skill or Battle Skill
# Returns either a new array or the old one if it remained the same.
# actor.add_kustom_skill(SkillID)
# actor.add_battle_skill(SkillID)
module KParty
LEVEL_MAX = 20
LVLS_PER_PARTY_LVL = 3
KUSTOM_SKILL_MAX = 1
BATTLE_SKILL_MAX = 5
end
class Game_Party
alias :kyon_party_lvl_gm_pty_init :initialize
def initialize
kyon_party_lvl_gm_pty_init
@freeze_level_up = false
@level_max = KParty::LEVEL_MAX
@level = 0
end
def level=(n)
return @level if @freeze_level_up and @level < n
@level = [[0, @level].max, @level_max].min
end
def actor_level_max() KParty::LVLS_PER_PARTY_LVL * (@level + 1) end
attr_reader :level
attr_accessor :level_max, :freeze_level_up
end
class Game_Actor
alias :kyon_party_lvl_gm_actor_setup :setup
def setup(actor_id)
@kustom_skills = FixedArray.new(KParty::KUSTOM_SKILL_MAX)
@battle_skills = FixedArray.new(KParty::BATTLE_SKILL_MAX)
kyon_party_lvl_gm_actor_setup(actor_id)
end
def level=(n)
n = [[n, db_actor.final_level].min, 1].max
@level = $game_party.actor_level_max < n ? @level : n
end
def db_actor() $data_actors[@actor_id] end
def exp=(n) @exp = [n, 0].max end
def skills() @skills + @kustom_skills end
def skillset() $game_temp.in_battle ? @battle_skills : self.skills end
def skill_learn?(skill_id) self.skills.include?(skill_id) end
def add_kustom_skill(skill_id) @kustom_skills << skill_id end
def add_battle_skill(skill_id) @battle_skills << skill_id end
def kustom_skills_max() @kustom_skills.maxsize end
def battle_skills_max() @battle_skills.maxsize end
def class_learnings() $data_classes[@class_id].learnings end
attr_reader :kustom_skills, :battle_skills
end
class Window_Skill
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
@actor.skillset.each{|s| @data << $data_skills[s] }
@data = @data.compact
@item_max = @data.size
return if @item_max == 0
self.contents = Bitmap.new(width - 32, row_max * 32)
@item_max.each{|i| draw_item(i) }
end
end
FAQ
This script does not include any full fledged custom menu of my own.
Terms & Conditions
Include me in your game credits.
Send me a copy of your complete game if you include two or more of my scripts.
Free for non commercial games. Contact me if you want to go commercial.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE