KActorSkill XP
#2
KActorSkill XP Menu Script

I can't say it's ready for deployment but you can get a picture of how it would look like when finished.
You may report issues or make minor feature requests.

Code:
# * KActorSkill XP Menu
#   Scripter : Kyonides Arkanthes
#   2020-06-04

# $scene = KActorSkillMenu.new(ActorIndex)
# ActorIndex's default value: 0 (Aluxes)
# (ActorIndex) can be omitted if you start with the team leader.

module KActorSkill
 PLACE_GOLD_SYMBOL = :first
 ACTOR_NAME_AS_TITLE = true
 PENDING_SKILLS_LABEL = "%s's Pending Skills"
 SKILL_NAME_LABEL = "Learn %s"
 NO_LEARNING = "No skill found!"
end

class KActorSkillWindow < Window_Selectable
 def initialize
   super(0, 64, 320, 192)
   self.contents = Bitmap.new(width - 32, height - 32)
 end

 def list=(new_list)
   @list = new_list
   refresh
 end

 def refresh
   contents.clear
   if @list.empty?
     contents.draw_text(0, 0, width - 32, 28, KActorSkill::NO_LEARNING, 1)
     return
   end
   @label = KActorSkill::SKILL_NAME_LABEL
   @symbol_first = KActorSkill::PLACE_GOLD_SYMBOL == :first
   @symbol = $data_system.words.gold
   ly = 0
   @ids = @list.keys.sort
   @ids.each do |sid|
     draw_skill(sid)
     ly += 28
   end
 end

 def draw_skill(sid)
   skill = $data_skills[sid]
   name = sprintf(@label, skill.name)
   skill = @list[sid]
   lvl = "LVL " + skill.level.to_s
   gold = skill.gold.to_s
   gold = @symbol_first ? @symbol + gold : gold + @symbol
   item = $data_items[skill.item].name
   total = "#{$game_party.item_number(skill.item)}/#{skill.total}"
   contents.draw_text(0, ly, width - 32, 28, name)
   contents.draw_text(120, ly, 160, 28, lvl)
   contents.draw_text(0, ly + 24, 160, 28, gold)
   contents.draw_text(120, ly + 24, width - 152, 28, item)
   contents.draw_text(240, ly + 24, width - 272, 28, total)
 end
 attr_reader :ids
end

class KActorSkillMenu
 def initialize(pos=0) @index = pos end
 def main
   @name_only = KActorSkill::ACTOR_NAME_AS_TITLE
   @title = KActorSkill::PENDING_SKILLS_LABEL
   @actors = $game_party.actors
   @name_window = Window_Help.new
   @skill_window = KActorSkillWindow.new
   update_actor_data
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     break if $scene != self
   end
   Graphics.freeze
   @skill_window.dispose
 end

 def update
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     return $scene = Scene_Map.new
   elsif Input.trigger?(Input::C)
     $game_system.se_play($data_system.decision_se)
     
   elsif Input.trigger?(Input::L)
     $game_system.se_play($data_system.cursor_se)
     @index = (@index - 1) % @actors.size
     update_actor_data
     return
   elsif Input.trigger?(Input::R)
     $game_system.se_play($data_system.cursor_se)
     @index = (@index + 1) % @actors.size
     update_actor_data
   end
 end

 def update_actor_data
   actor = @actors[@index]
   label = @name_only ? actor.name : sprintf(@title, actor.name)
   @name_window.set_text(label, 1)
   @skill_window.list = actor.learnings
 end
end

The terms and conditions are the same as those found on the first post.
"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.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

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! Laughing + Tongue sticking out

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
Reply }


Messages In This Thread
KActorSkill XP - by kyonides - 06-03-2020, 05:03 AM
RE: KActorSkill XP - by kyonides - 06-04-2020, 09:27 PM



Users browsing this thread: 1 Guest(s)