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.

[VX] Skill Subsets

Skill Subsets
by Dargor
Version 1.0


Introduction

This script let your characters have different set of skills like White Magic, Black Magic, Sword Tech, everything you can imagine. You can give a skill as many subsets as you want. The skill subset windows will be activated by a battle command with the same name as the desired subset. So if Skill #82 has the subset 'Black', only the battle command 'Black' will open the skill subset window.

Script

Code:
#==============================================================================

# ** Skill Subsets

#------------------------------------------------------------------------------

#  © Dargor, 2008

#  06/09/08

#  Version 1.0

#------------------------------------------------------------------------------

#  VERSION HISTORY:

#   - 1.0 (07/09/08), Initial release

#------------------------------------------------------------------------------

#  INTRODUCTION:

#     This script let your characters have different set of skills like

#     White Magic, Black Magic, Sword Tech, everything you can imagine.

#     You can give a skill as many subsets as you want. The skill subset

#     windows will be activated by a battle command with the same name

#     as the desired subset. So if Skill #82 has the subset 'Black', only

#     the battle command 'Black' will open the skill subset window.

#------------------------------------------------------------------------------

#  INSTRUCTIONS:

#   - Paste this above main

#   - If you are using the Draw Skill script:

#        1) Make sure to use Draw Skill version 2.0 or higher

#        2) Place the Skill Subsets ABOVE the Draw Skill script

#   - Edit the constants in Skill_Subsets module

#------------------------------------------------------------------------------

#  NOTES:

#   - This script requires the Custom Commands script version 1.10 

#     or higher.

#==============================================================================

 

#==============================================================================

# * Skill Subset Configuration Module

#==============================================================================

  

module Skill_Subsets

  # Temporary System Data

  $data_system = load_data('Data/System.rvdata')

  # Skill subsets

  # SYNTAX: Skill_ID => [subset1, subset2, subset3, ...]

  Skills = {

            3 => ['Special', Vocab::skill], 

            35 => ['White'], 

            82 => ['Black']

           }

  # Available skill subsets (commands)

  Subsets = ['White','Black','Special']

  # Default skill subset

  Skills.default = Vocab::skill

end

 

#==============================================================================

# ** Window_Skill

#------------------------------------------------------------------------------

#  This window displays a list of usable skills on the skill screen, etc.

#==============================================================================

 

class Window_Skill < Window_Selectable

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    create_data

    create_contents

    for i in 0...@item_max

      draw_item(i)

    end

  end

  #--------------------------------------------------------------------------

  # * Create Data

  #--------------------------------------------------------------------------

  def create_data

    @data = []

    for skill in @actor.skills

      @data.push(skill)

      if skill.id == @actor.last_skill_id

        self.index = @data.size - 1

      end

    end

    @item_max = @data.size

  end

end

 

#==============================================================================

# ** Window_Skill

#------------------------------------------------------------------------------

#  This window displays a list of usable skills on the skill screen, etc.

#==============================================================================

 

class Window_Skill < Window_Selectable

  #--------------------------------------------------------------------------

  # * Get Skill

  #--------------------------------------------------------------------------

  alias dargor_vx_ssubsets_skill_window_initialize initialize

  alias dargor_vx_ssubsets_skill_window_create_data create_data

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     x      : window x-coordinate

  #     y      : window y-coordinate

  #     width  : window width

  #     height : window height

  #     actor  : actor

  #--------------------------------------------------------------------------

  def initialize(x, y, width, height, actor)

    dargor_vx_ssubsets_skill_window_initialize(x, y, width, height, actor)

    @subset = nil

  end

  #--------------------------------------------------------------------------

  # * Create Data

  #--------------------------------------------------------------------------

  def create_data

    if @subset.nil?

      dargor_vx_ssubsets_skill_window_create_data

      for skill in @actor.skills

        if Skill_Subsets::Skills.has_key?(skill.id) &&

              !Skill_Subsets::Skills[skill.id].include?(Skill_Subsets::Skills.default)

          @data.delete(skill)

        end

      end

    else

      @data = []

      for skill in @actor.skills

        if Skill_Subsets::Skills.has_key?(skill.id) &&

            Skill_Subsets::Skills[skill.id].include?(@subset)

          @data.push(skill)

        end

        if skill.id == @actor.last_skill_id

          self.index = @data.size - 1

        end

      end

    end

    @item_max = @data.size

  end

  #--------------------------------------------------------------------------

  # * Set Subset

  #--------------------------------------------------------------------------

  def set_subset(subset)

    @subset = subset

    refresh

  end

end

 

#==============================================================================

# ** Scene_Battle

#------------------------------------------------------------------------------

#  This class performs battle screen processing.

#==============================================================================

 

class Scene_Battle < Scene_Base

  #--------------------------------------------------------------------------

  # * Alias Listing

  #--------------------------------------------------------------------------

  alias dargor_vx_skill_subsets_battle_actor_command update_actor_command_selection

  #--------------------------------------------------------------------------

  # * Update Actor Command Selection

  #--------------------------------------------------------------------------

  def update_actor_command_selection

    dargor_vx_skill_subsets_battle_actor_command

    if Input.trigger?(Input::C) && 

        Skill_Subsets::Subsets.include?(@actor_command_window.selection)

      Sound.play_decision

      start_skill_subset_command_selection(subset=@actor_command_window.selection)  

    end

  end

  #--------------------------------------------------------------------------

  # * Start Skill Subset Command Selection

  #--------------------------------------------------------------------------

  def start_skill_subset_command_selection(subset=@actor_command_window.selection)

    @help_window = Window_Help.new

    @skill_window = Window_Skill.new(0, 56, 544, 232, @active_battler)

    @skill_window.set_subset(subset)

    @skill_window.help_window = @help_window

    @actor_command_window.active = false

  end

end

Notes

This script rewrites the refresh method of Window_Skill and creates a new method to create the skill data.
Other scripts modifying the refresh method of Window_Skill might be incompatible with it.
This script also requires the Custom Commands script.

Hope you like it!
-Dargor
 
Thanks.
You don't need an event to call subsets. The only thing you need is a battle command with the same name as the skill subset.
I haven't posted a screenshot because it's quite pointless, it's only a skill window with less skills.
Bot a demo might be useful! :)

Take care!
-Dargor
 
hmm,,, so I can give my skills more than one subset... guess thats really useful XD

hmm still need a way to give me a subset when equiped with certain armors...

like if I had "Book of Beginners Magery" I like long named stuffs XD
do you have a way with your custom comands script that would give
Basic Magery skill subset into a characters battle commands?
 
Yeah sure! Simply use a script call in a COmmon Event and write $game_actors[actor_id].add_command(command_name)
"command_name" must be the same name as the skill subset. However, you'll have to find a way to know which actor is using it...
 
eh hmm...

eh I'm gonna see if I can mess with a script to check armor's instead if I end up needing it
I hate making huge common events XD

and I actually dont think I need it at all right now... since I will just give the chars the commands anyways and just use a hidden skills script to hide skills of a certain level XD
I wanted to do something else originally but...  I changed my mind and decided to go in a slightly different direction XD

and I can use some common events through an item to add different skills subsets if I decide I want someone to learn some through a script...
 
This is me going insane. The script just won't work. I've tried to fix it, but nothing I've done has any effect. All skills show up in every subset. >_> Yes, I use the Tankentai SBS. But I have the same problem in a project with only the default scripts/Custom Commands script, so it isn't that. And yes, I use version 1.10.
 
Interesting. It works just fine for me.
I'll make a demo since it's not the most user friendly script.
BTW, the Takentai CBS won't help ;)
 

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