Looking for a script that shows what skill an actor will learn when they get to a certain level

Title says it all
It doesn't, really. Shows it where? What certain level?
Are you using Yanfly Learn skill script?
If so you can add this on to not show skills until they reach the specified level.
It doesn't, really. Shows it where? What certain level?
I’m trying to make it similar to how most shin megami tensei games handle it where in the status or skill menu of the demon (actor in this case) has a menu where it shows all the skills the actor will learn when they get to the levels that they would learn the skills.

Heres a picture of it. The skills are shown at the bottom right of the screen and the level where one of the skills will be learned are at the top of that menu.
1666973940418.png
I’m trying to make it similar to how most shin megami tensei games handle it where in the status or skill menu of the demon (actor in this case) has a menu where it shows all the skills the actor will learn when they get to the levels that they would learn the skills.

Heres a picture of it. The skills are shown at the bottom right of the screen and the level where one of the skills will be learned are at the top of that menu.
View attachment 243832
So would this just be in the status menu? Would you need to also show skills there since that isn't currently part of status, or just what skills will be learned at the next level where skills are learned? Does it just show the skills for that level or does it show muliple upcoming levels' worth of skills? You need to explain these things for people who have never played a Shin Megami Tensei game rather than just assuming people will know what you're talking about and how you plan to implement that in the RPG Maker interface.
So would this just be in the status menu? Would you need to also show skills there since that isn't currently part of status, or just what skills will be learned at the next level where skills are learned? Does it just show the skills for that level or does it show muliple upcoming levels' worth of skills? You need to explain these things for people who have never played a Shin Megami Tensei game rather than just assuming people will know what you're talking about and how you plan to implement that in the RPG Maker interface.
Yeah thats on me for not being specific enough, Sorry bout that.
It would probably be shown in the skills menu since you can't see skills in the status menu.
It would show multiple upcoming levels of skills.
How many?
How many?
if you mean the most amount of skills to be shown on screen, the most i want is 5.
if you mean the most amount of skills to be shown on screen, the most i want is 5.
Can you do a mockup of what you'd want the skill menu to look like?
Can you do a mockup of what you'd want the skill menu to look like?
Something like this?
Something like this?
Perfect. Not sure when I'll have time to fit this in but I'll see what I can do.
Here is my attempt at this.
First attempt that works
Spoiler: Show next skill levels
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Show skills for next level   ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║   Display the next 5 skills that    ╠════════════════════╣
# ║   are learned at upcoming levels    ║    25 Oct 2022     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║     Plug and play                                        ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Updates:                                                 ║
# ║   2022-Nov-01 - Initial publish                          ║
# ║                                                          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all uses in RPG Maker VX Ace - except nudity    ║
# ╚══════════════════════════════════════════════════════════╝

module R2_Show_Next_Skills
  Amount = 5
end

class Window_SkillList < Window_Selectable
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 1
  end
end

class Window_SkillNextList < Window_SkillList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super
    @actor = nil
    @stype_id = 0
    @data = []
  end
  #--------------------------------------------------------------------------
  # * Set Actor
  #--------------------------------------------------------------------------
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
    self.oy = 0
  end
  #--------------------------------------------------------------------------
  # * Set Skill Type ID
  #--------------------------------------------------------------------------
  def stype_id=(stype_id)
    return if @stype_id == stype_id
    @stype_id = stype_id
    refresh
    self.oy = 0
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 1
  end
  #--------------------------------------------------------------------------
  # * Get Number of Items
  #--------------------------------------------------------------------------
  def item_max
    R2_Show_Next_Skills::Amount
  end
  #--------------------------------------------------------------------------
  # * Include in Skill List?
  #--------------------------------------------------------------------------
  def include?(item)
    item && item.stype_id == @stype_id
  end
  #--------------------------------------------------------------------------
  # * Display Skill in Active State?
  #--------------------------------------------------------------------------
  def enable?(item)
    @actor && @actor.usable?(item)
  end
  #--------------------------------------------------------------------------
  # * Create Skill List
  #--------------------------------------------------------------------------
  def make_item_list
    @data = []
    cur_data = []
    @all_data = []
    aval_data = []
    cur_data = @actor ? @actor.skills.select {|skill| include?(skill) } : []
    @all_data = $data_classes[@actor.class_id].learnings
    for i in 0..@all_data.size - 1
      skill = $data_skills[@all_data[i].skill_id]
      found = false
      cur_data.each do |line|
        found = true if line.id == skill.id
      end
      next if found == true
      aval_data[i] = skill
    end
    aval_data.compact!
    for i in 0..item_max
      @data << aval_data[i] unless aval_data[i].nil?
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if skill
      rect = item_rect(index)
      rect.width -= 4
      draw_item_name(skill, rect.x, rect.y, enable?(skill))
      draw_skill_level(rect, skill)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Skill Use Cost
  #--------------------------------------------------------------------------
  def draw_skill_level(rect, skill)
    level = 0
    @all_data.each do |entry|
      level = entry.level if entry.skill_id == skill.id
    end
    change_color(text_color(18), true)
    text = "LV "+level.to_s
    draw_text(rect, text, 2)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    make_item_list
    create_contents
    draw_all_items
  end
end

class Scene_Skill < Scene_ItemBase
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  alias r2_scene_skill_start_next_skills  start
  def start
    r2_scene_skill_start_next_skills
    create_next_window
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_next_window
    wx = Graphics.width / 2
    wy = @status_window.y + @status_window.height
    ww = Graphics.width / 2
    wh = Graphics.height - wy
    @next_window = Window_SkillNextList.new(wx, wy, ww, wh)
    @next_window.actor = @actor
    @next_window.viewport = @viewport
    @command_window.skill_window = @next_window
  end
  #--------------------------------------------------------------------------
  # * Create Item Window
  #--------------------------------------------------------------------------
  def create_item_window
    wx = 0
    wy = @status_window.y + @status_window.height
    ww = Graphics.width / 2
    wh = Graphics.height - wy
    @item_window = Window_SkillList.new(wx, wy, ww, wh)
    @item_window.actor = @actor
    @item_window.viewport = @viewport
    @item_window.help_window = @help_window
    @item_window.set_handler(:ok,     method(:on_item_ok))
    @item_window.set_handler(:cancel, method(:on_item_cancel))
    @command_window.skill_window = @item_window
  end
end
Well, it still needs a couple of fixes.

Ruby:
# * Fixes for Show skills for next level Script
#   by Kyonides Arkanthes
#   Purpose: To teach Roninator2 how to use iterators properly. :P

class Window_SkillNextList
  def level_max
    @actor.level + 1
  end

  def make_item_list
    @data = []
    @all_data = {}
    learn_skills = $data_classes[@actor.class_id].learnings
    learn_skills.each do |learn|
      next if level_max != learn.level
      @data << $data_skills[learn.skill_id]
      @all_data[learn.skill_id] = learn.level
    end
    @data = @data.take(item_max)
  end

  def draw_skill_level(rect, skill)
    level = @all_data[skill.id] || 0
    change_color(text_color(18), true)
    draw_text(rect, "LV#{level}", 2)
  end
end
it still needs a couple of fixes.
Your code may be better in concept, but it doesn't work for the request.
First is the level max. The request is to not show only the next level skills (if any), it's to show all skills coming up and at the various levels to a maximum of 5 entries.
second the all data looks good but if it doesn't match above statement then it shows nothing.
If I take out the level max part then it just shows all the levels.
third grabbing the number from the array works, but it's keeping everything in the array.
I was trying to only put in the array the data to display. which is why my make item list is so messy.
Spoiler: compare
My code
1667474238278.png

1667474558282.png

1667474626995.png

your code
1667474282045.png
aside from that, if you can show me how to optimize, that would be good.
You of course see how I was working it, trying to tailor the data to be only what is required.
The original screenshot only showed those skills available if the hero levels up so I based my previous code on that premise.

@Roninator2 thinks that @all_data would include more skills than necessary. In that case we can limit both @ data and @all_data at the same time.
[For some reason it replaces the data variable with a mention of some user I don't know anything about.]

The game dev can now set what the maximum level should be in his or her game.

Ruby:
# * Fixes for Show skills for next level Script
#   by Kyonides Arkanthes
#   Purpose: To teach Roninator2 how to use iterators properly. :P
#   Game Dev can also set the Skill Maximum Level.

class Window_SkillNextList
  def level_next
    @actor.level + 1
  end

  def level_max
    @actor.level + 10
  end

  def make_item_list
    @data = []
    @all_data = {}
    learn_skills = $data_classes[@actor.class_id].learnings
    learn_skills.each do |learn|
      next if learn.level < level_next or learn.level > level_max
      @data << $data_skills[learn.skill_id]
      @all_data[learn.skill_id] = learn.level
      break if @data.size == item_max
    end
  end

  def draw_skill_level(rect, skill)
    level = @all_data[skill.id] || 0
    change_color(text_color(18), true)
    draw_text(rect, "LV#{level}", 2)
  end
end

I must admit that there might be some occasions where the player might not find any skills or very few of them listed there. Perhaps that's not an issue after all. I mean, how could it be positive for him or her at level 12 to notice that the next skill can only be learned if he or she keeps grinding for the next couple of hours to reach level 25?

Original thread: https://forums.rpgmakerweb.com/threads/looking-for-a-script-that-shows-what-skill-an-actor-will-learn-when-they-get-to-a-certain-level.152278/