Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

RMXP skills window problem.

Can someone please help me? I can't figure out why my skills arent appearing from the skills window in the menu. They only appear in battle
 
You're gonna have to tell use a lot more than just "they're not appearing in the menu"
Do you have any custom scripts would be the major one.
Another good one that you could tell us is when this started happening. i.e. what did you change before this happened
 
I do have a Custom Menu, and I got rid of it to see if it was the problem, but it wasn't.

Right now I am using SDK, My Menu, Passive skills by Leon, Blizzards add-on pack(most of which are disabled), blizzards Level up notifier, and a party changer script.
I can post one if you want.
 
My first guess would be the passive skills script. Try taking it out and see what happens. I'm sure that at least one of the passive skill scripts out there will actually have passive skills not show up, so that's a possible cause
 
well it seems to work now - but is there a way to fix this so that I can keep it without having the problem? even my normal skills won't show up. Or do you know of a better one?

Code:
#===============================================================================
#  Passive Skills, by Leon_Westbrooke
#  v. 1.0
#----------------------------------------------------------------------
#  Instructions:  Put below all default scripts, and above Main
#  
#  Features:  Creates passive skills that adds to the stats:
#    HP, SP, STR, DEX, AGI, INT, EVA, Atk, PDef, MDef
#    
#    Adds stats based on a percentage. (so, 100% will double that stat.)
#
#  To have a skill lower stats, make the number negative in the module.
#
#  Compatability:
#    There are no known clashes with other scripts.
#
#  Notes:
#    This script aliases the stats in Game_Actor, and rewrites the refresh 
#    method in Window_Skill. 
#===============================================================================


#===============================================================================
#  module Passive_Skills
#===============================================================================
module Passive_Skills
  #--------------------------------------------------------------------
  #  Passive_Skills = { skill_id => {'stat' => amount,..},..}
  #  stats:  'hp', 'sp', 'str', 'dex', 'agi', 'int', 'eva', 'atk', 'pdef', 'mdef'
  #--------------------------------------------------------------------
  Passive_Skills = {
  84 => {'hp' => 10},
  85 => {'hp' => 5},
  86 => {'hp' => 5},
  87 => {'hp' => 5},
  88 => {'sp' => 10},
  89 => {'sp' => 5},
  90 => {'sp' => 5},
  91 => {'sp' => 5},
  }
end
#===============================================================================
#  END module Passive_Skills
#===============================================================================


#===============================================================================
#  Game_Actor
#===============================================================================
class Game_Actor < Game_Battler
  
  attr_accessor :passive_hp
  attr_accessor :passive_sp
  attr_accessor :passive_str
  attr_accessor :passive_dex
  attr_accessor :passive_agi
  attr_accessor :passive_int
  attr_accessor :passive_eva
  attr_accessor :passive_atk
  attr_accessor :passive_pdef
  attr_accessor :passive_mdef
  
  alias leon_passiveskills_gameactor_setup setup
  alias leon_passiveskills_gameactor_basehp base_maxhp
  alias leon_passiveskills_gameactor_basesp base_maxsp
  alias leon_passiveskills_gameactor_basestr base_str
  alias leon_passiveskills_gameactor_basedex base_dex
  alias leon_passiveskills_gameactor_baseagi base_agi
  alias leon_passiveskills_gameactor_baseint base_int
  alias leon_passiveskills_gameactor_baseeva base_eva
  alias leon_passiveskills_gameactor_baseatk base_atk
  alias leon_passiveskills_gameactor_basepdef base_pdef
  alias leon_passiveskills_gameactor_basemdef base_mdef
  
  def setup(actor_id)
    @passive_hp = 0
    @passive_sp = 0
    @passive_str = 0
    @passive_dex = 0
    @passive_agi = 0
    @passive_int = 0
    @passive_eva = 0
    @passive_atk = 0
    @passive_pdef = 0
    @passive_mdef = 0
    leon_passiveskills_gameactor_setup(actor_id)
  end
  
  def passive_bonus
    ps = Passive_Skills
    hp = 0
    sp = 0
    str = 0
    dex = 0 
    agi = 0
    int = 0
    eva = 0
    atk = 0
    pdef = 0
    mdef = 0
    for i in 0...@skills.size
      if ps::Passive_Skills.keys.include?(@skills[i])
        for j in 0...ps::Passive_Skills[@skills[i]].size
          case ps::Passive_Skills[@skills[i]].keys[j]
          when 'hp' 
            hp += ps::Passive_Skills[@skills[i]]['hp']
          when 'sp' 
            sp += ps::Passive_Skills[@skills[i]]['sp']
          when 'str' 
            str += ps::Passive_Skills[@skills[i]]['str']
          when 'dex' 
            dex += ps::Passive_Skills[@skills[i]]['dex']
          when 'agi' 
            agi += ps::Passive_Skills[@skills[i]]['agi']
          when 'int' 
            int += ps::Passive_Skills[@skills[i]]['int']
          when 'eva' 
            eva += ps::Passive_Skills[@skills[i]]['eva']
          when 'atk' 
            atk += ps::Passive_Skills[@skills[i]]['atk']
          when 'pdef' 
            pdef += ps::Passive_Skills[@skills[i]]['pdef']
          when 'mdef' 
            mdef += ps::Passive_Skills[@skills[i]]['mdef']
          end
        end
      end
    end
    @passive_hp = hp
    @passive_sp = sp
    @passive_str = str
    @passive_dex = dex
    @passive_agi = agi
    @passive_int = int
    @passive_eva = eva
    @passive_atk = atk
    @passive_pdef = pdef
    @passive_mdef = mdef
  end
  
  def base_maxhp
    ps = Passive_Skills
    n = leon_passiveskills_gameactor_basehp
    n = n + (n * @passive_hp * 0.01)
    passive_bonus
    return n
  end
  
  def base_maxsp
    ps = Passive_Skills
    n = leon_passiveskills_gameactor_basesp
    n = n + (n * @passive_sp * 0.01)
    return n
  end
  
  def base_str
    ps = Passive_Skills
    n = leon_passiveskills_gameactor_basestr
    n = n + (n * @passive_str * 0.01)
    return n
  end
  
  def base_dex
    ps = Passive_Skills
    n = leon_passiveskills_gameactor_basedex
    n = n + (n * @passive_dex * 0.01)
    return n
  end
  
  def base_agi
    ps = Passive_Skills
    n = leon_passiveskills_gameactor_baseagi
    n = n + (n * @passive_agi * 0.01)
    return n
  end
  
  def base_int
    ps = Passive_Skills
    n = leon_passiveskills_gameactor_baseint
    n = n + (n * @passive_int * 0.01)
    return n
  end
  
  def base_atk
    ps = Passive_Skills
    n = leon_passiveskills_gameactor_baseatk
    n = n + (n * @passive_atk * 0.01)
    return n
  end
  
  def base_pdef
    ps = Passive_Skills
    n = leon_passiveskills_gameactor_basepdef
    n = n + (n * @passive_pdef * 0.01)
    return n
  end
  
  def base_mdef
    ps = Passive_Skills
    n = leon_passiveskills_gameactor_basemdef
    n = n + (n * @passive_mdef * 0.01)
    return n
  end
end
#===============================================================================
#  END Game_Actor
#===============================================================================


#===============================================================================
#  Window_Skill
#===============================================================================
class Window_Skill
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...@actor.skills.size
      skill = $data_skills[@actor.skills[i]]
      #-----------------------------------------------------------------
      #  Added 3 Lines right here:
      #  if $game_temp.in_battle
      #    ps = Passive_Skills
      #    unless ps::Passive_Skills.keys.include?(skill)
      # ----------------------------------------------------------------
      if $game_temp.in_battle
        ps = Passive_Skills
        unless ps::Passive_Skills.keys.include?(skill.id)
          if skill != nil
            @data.push(skill)
          end
      #-----------------------------------------------------------------
      # Added two 'end's right here.
      #-----------------------------------------------------------------
        end
      end
    end
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      self.contents.font.name = $defaultfonttype  # "Skill" window font
      self.contents.font.size = $defaultfontsize
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
end
#===============================================================================
# End Window_Skill
#===============================================================================
 
under this
Code:
if $game_temp.in_battle
        ps = Passive_Skills
        unless ps::Passive_Skills.keys.include?(skill.id)
          if skill != nil
            @data.push(skill)
          end
      #-----------------------------------------------------------------
      # Added two 'end's right here.
      #-----------------------------------------------------------------
        end
try adding this
Code:
else
  if skill != nil
    @data.push(skill
  end
The problem is that it only adds the skills to the drawn data in battle >_>
 
ok, I'll do it one step better...Change this:
Code:
#-----------------------------------------------------------------
      #  Added 3 Lines right here:
      #  if $game_temp.in_battle
      #    ps = Passive_Skills
      #    unless ps::Passive_Skills.keys.include?(skill)
      # ----------------------------------------------------------------
      if $game_temp.in_battle
        ps = Passive_Skills
        unless ps::Passive_Skills.keys.include?(skill.id)
          if skill != nil
            @data.push(skill)
          end
      #-----------------------------------------------------------------
      # Added two 'end's right here.
      #-----------------------------------------------------------------
        end
      end
    end
to this:
Code:
#-----------------------------------------------------------------
      #  Added 3 Lines right here:
      #  if $game_temp.in_battle
      #    ps = Passive_Skills
      #    unless ps::Passive_Skills.keys.include?(skill)
      # ----------------------------------------------------------------
      if $game_temp.in_battle
        ps = Passive_Skills
        unless ps::Passive_Skills.keys.include?(skill.id)
          if skill != nil
            @data.push(skill)
          end
      #-----------------------------------------------------------------
      # Added two 'end's right here.
      #-----------------------------------------------------------------
        end
      else
        if skill != nil
          @data.push(skill)
        end
      end
    end
that SHOULD work
 
sweet, it works perfect now - Thank you so much, sorry if I was a hassle. I wish I knew ruby better. - now if i knew how to get rid of the sp cost in the menu. and anchor the passive skills to the top or bottom of the list...
 
Actually...that would be relatively easy....
change the code from before to
Code:
#-----------------------------------------------------------------
      #  Added 3 Lines right here:
      #  if $game_temp.in_battle
      #    ps = Passive_Skills
      #    unless ps::Passive_Skills.keys.include?(skill)
      # ----------------------------------------------------------------
      if $game_temp.in_battle
        ps = Passive_Skills
        unless ps::Passive_Skills.keys.include?(skill.id)
          if skill != nil
            @data.push(skill)
          end
      #-----------------------------------------------------------------
      # Added two 'end's right here.
      #-----------------------------------------------------------------
        end
      else
        ps = Passive_Skills
        unless ps::Passive_Skills.keys.include?(skill.id)
          if skill != nil
            @data.push(skill)
          end
        end
      end
    end
    ps = Passive_Skills
    for i in 0...@actor.skills.size
      skill = $data_skills[@actor.skills[i]]
      if ps::Passive_Skills.keys.include?(skill.id)
        @data.push(skill)
      end
    end
that should work lol...it's a bit of a sneaky way around it really, but I'm fairly sure it'll put all passives at the bottom
 
Nah, that script rewrote the entire Window_Skill class. My guess was that he just forgot to add the conditional for NOT being in battle. The intention might've been to add all skills when not in battle, but there simply was no actual code to account for it
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top