[XP] Skill Categories

Started by G_G, April 13, 2013, 01:18:15 am

Previous topic - Next topic

G_G

April 13, 2013, 01:18:15 am Last Edit: April 16, 2013, 01:22:33 am by gameus
Skill Categories
Authors: gameus
Version: 1.3
Type: Skill Organization Script
Key Term: Battle Add-on



Introduction

Adds Skill Categories to the Default Battle System. For every Skill Category your actor gets a new command, assuming they know skills from that category. Actors also get their default "Skill" command.


Features


  • Adds new battle commands for each category

  • Separates all skills from every other category/normal category

  • All skills still display in the normal Skill Scene

  • Have as many categories as you want




Screenshots

Spoiler: ShowHide

Spoiler: ShowHide

Spoiler: ShowHide



Demo

Demo 1.3


Script

Place this below all of Blizzard's scripts. It should have compatibility with all of his stuff.
Spoiler: ShowHide
Code: ruby

#===============================================================================
# Skill Categories
# Version 1.3
# Author gameus
#-------------------------------------------------------------------------------
# Intro:
#  Adds Skill Categories to the Default Battle System. For every Skill Category
#  your actor gets a new command, assuming they know skills from that category.
#  Actors also get their default "Skill" command.
#
# Features:
# -Adds new battle commands for each category
# -Separates all skills from every other category/normal category
# -All skills still display in the normal Skill Scene
# -Have as many categories as you want
#
# Version History:
#  1.3 - Added compatibility with Chaos Rage Limit System by Blizzard
#  1.2 - Fixed small bug with Easy Overdrive System by Blizzard
#  1.1 - Added compatibility with Easy Overdrive System by Blizzard
#  1.0 - Initial Release
#
# Instructions:
#  Jump down to the configuration, here's where you will define your Skill
#  Categories.
#  SKILL_SETS        = {
#    "Rank 1" => 17,
#    "Rank 2" => 18,
#    "Rank 3" => 19,
#  }
#  To add a new category, add a new line under the last category and follow
#  the template:
#    "Category Name" => Element_Id,
#  Name it whatever, and make sure to give it an unused element id.

#  To add skills to these categories, you have to add these elements to the
#  skills. Say you wanted Skills 1, 2, 3 to be under the category with the
#  element id of 17, these three skills need to have element id 17 in order
#  to be considered in that category.
#
# Compatibility:
# -Not tested with anything other than the default battle system.
# -Will not work with Skill Separation add-on from Tons of Add-ons by Blizzard
#  But this script would be useless if you were to use it.
# -Will work with Battle Memory Commands by gameus
# -Will not work properly with Battle Icons by Juan, however, other scripts
#  that add similar functionality should work depending on the naming
#  conventions that are required.
# -Not tested with SDK (Probably won't work)
# -Works perfectly with Easy Overdrive System by Blizzard. Place this script
#  below his.
# -If you run into any other scripts that don't work with it, just post it in
#  the topic and I'll try to look at it.
# -Works with Unique Skill Commands by Blizzard.
# -Works with Chaos Rage Limit System by Blizzard, make sure you place this
#  script below it.
#
# Credits:
#  gameus ~ For creating it
#  MarkHest ~ For requesting it and testing it
#===============================================================================

module Gameus
  SKILL_SETS        = {
    "White Magic" => 17,
    "Black Magic" => 18,
    "Rank 3" => 19,
  }
end

$gg_skill_categories = 1.3

#-------------------------------------------------------------------------------
# Scene_Battle
#-------------------------------------------------------------------------------

class Scene_Battle
 
  alias gg_phase3_setup_command_lat phase3_setup_command_window
  def phase3_setup_command_window
    gg_phase3_setup_command_lat
    @actor_command_window.new_items(@active_battler.generate_commands)
  end
 
  alias gg_cats_update_phase3_basic_command update_phase3_basic_command
  def update_phase3_basic_command
    if $crls != nil && $crls >= 6.2
      battler = (BlizzCFG::RTAB_ACTIVE ? @active_actor : @active_battler)
      restore_commands(battler)
      return if update_sls_input(battler)
      return if update_srs_input(battler)
      return if update_cds_input(battler)
    end
    if $easy_overdrive != nil && $easy_overdrive >= 2.21
      battler = (BlizzCFG::RTAB_ACTIVE ? @active_actor : @active_battler)
      restore_commands(battler)
      return if update_overdrive_input(battler)
    end
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      phase3_prior_actor
      return
    end
    if Input.trigger?(Input::C)
      case @actor_command_window.index
      when 0
        $game_system.se_play($data_system.decision_se)
        @active_battler.current_action.kind = 0
        @active_battler.current_action.basic = 0
        start_enemy_select
      when 1..@actor_command_window.commands.size - 3
        $game_system.se_play($data_system.decision_se)
        @active_battler.current_action.kind = 1
        start_skill_select
      when @actor_command_window.commands.size - 2
        $game_system.se_play($data_system.decision_se)
        @active_battler.current_action.kind = 0
        @active_battler.current_action.basic = 1
        phase3_next_actor
      when @actor_command_window.commands.size - 1
        $game_system.se_play($data_system.decision_se)
        @active_battler.current_action.kind = 2
        start_item_select
      end
      return
    end
  end
 
  alias gg_cats_start_skill_select start_skill_select
  def start_skill_select
    gg_cats_start_skill_select
    index = @actor_command_window.index
    @skill_window.index = 0
    @skill_window.refresh(@actor_command_window.commands[index]) if index > 1
  end
 
end

#-------------------------------------------------------------------------------
# Game_Actor
#-------------------------------------------------------------------------------

class Game_Actor < Game_Battler
 
  def generate_commands
    s1, s2 = $data_system.words.attack, $data_system.words.skill
    s3, s4 = $data_system.words.guard, $data_system.words.item
    si = []
    Gameus::SKILL_SETS.each_key {|key|
      skills = @skills.find_all {|id|
        $data_skills[id].element_set.include?(Gameus::SKILL_SETS[key])}
      si.push(key) if skills != []}
    return [s1, s2] + si + [s3, s4]
  end
 
end

#-------------------------------------------------------------------------------
# Window_Command
#-------------------------------------------------------------------------------

class Window_Command < Window_Selectable
 
  attr_accessor :commands
 
  def new_items(commands)
    self.contents.dispose if self.contents != nil
    self.contents = nil
    @item_max = commands.size
    @commands = commands
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    refresh
  end
 
if $crls != nil && $crls >= 6.2
  alias gg_refresh_skill_cats_lat refresh
  def refresh
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
    gg_refresh_skill_cats_lat
  end
end
 
end

#-------------------------------------------------------------------------------
# Window_Skill
#-------------------------------------------------------------------------------

class Window_Skill < Window_Selectable
 
  alias gg_cats_refresh_skill_window_lat refresh
  def refresh(category = "")
    if !$scene.is_a?(Scene_Battle)
      gg_cats_refresh_skill_window_lat
      return
    end
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    rank = category == "" ? nil : Gameus::SKILL_SETS[category]
    @data = []
    @actor.skills.each {|id|
      skill = $data_skills[id]
      if skill != nil
        if rank == nil
          flag = true
          Gameus::SKILL_SETS.each_value {|element|
            flag = false if skill.element_set.include?(element)}
          @data.push(skill) if flag
        else
          @data.push(skill) if skill.element_set.include?(rank)
        end
      end}
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
 
end



Instructions

Configuration is in the script. Be sure to read the compatibility section too.


Compatibility


  • Not tested with anything other than the default battle system.

  • Will not work with Skill Separation add-on from Tons of Add-ons by Blizzard But this script would be useless if you were to use it.

  • Will work with Battle Memory Commands by gameus

  • Will not work properly with Battle Icons by Juan, however, other scripts that add similar functionality should work depending on the naming  conventions that are required.

  • Not tested with SDK (Probably won't work)

  • Works perfectly with Easy Overdrive System by Blizzard. Place this script below his.

  • If you run into any other scripts that don't work with it, just post it in the topic and I'll try to look at it.

  • Works with Unique Skill Commands by Blizzard.

  • Works with Chaos Rage Limit System by Blizzard, place this script below it.




Credits and Thanks


  • gameus ~ For creating it

  • MarkHest ~ For requesting it and testing it




Author's Notes

Enjoy!

MarkHest

I can't thank you enough for this script. Thanks a ton man! :haha:
   

BetaGod

April 14, 2013, 02:56:56 pm #2 Last Edit: April 14, 2013, 05:52:20 pm by BetaGod
You sir just won my respect. Thanks a lot for this!

EDIT: I've found an incompatibility issue but i am not sure what causes it. The problem happens in battle; the word "Item" appears just in the Item command for actor in position 1 (despite wich character that is).  The command itself appears for ALL actors, but the word "Item", just for the first one. The result is a blank square option for any actor who is not in position number 1.

This is the list of scripts that i am using (in order of placement, from the top):

QuoteZydragon's Simple Custom Menu System
Categorized Items Menu by Albertfish
Tons of Addons by Blizzard
Chaos Rage Limit System by Blizzard
Soul Force Combo System addon, also by Blizz
Teleportation System by Diagostimo
Ryex's Weapons Unleash Skills
Easy Party Switcher by Blizzard
Leon's Shopping System
Legacy Class Change by Legacyblade
Universal Message System by Ccoa
Organized Quest System by KK20
Threat System by Fantasist
Multi-Slot Equipment by Guillaume777


It is indeed the Chaos Rage System or the Soul Force Combo System. Maybe a combination of both. Thanks for your time :D
I am a god in BETA status and therefore, i may contain bugs and such.

G_G

April 14, 2013, 05:45:08 pm #3 Last Edit: April 14, 2013, 08:42:30 pm by gameus
It might have to do with the Chaos Rage System or the Soul Force Combo System. Maybe the Threat System or the Weapon Unleash Skills, regardless, I'll look into it after I'm done helping Aegisrox.

EDIT: In the meantime, try editing the placement of the script. Place it below every other script but above main.

EDIT: I think I've pinpointed it to Chaos Rage Limit System. I just tried it and my Item and Defend slots seem to disappear. I'll work on a new update. Thanks for posting the compatibility bug. :)

G_G

Had some time after work and I was able to fix it. Just make sure this script gets placed below Chaos Rage Limit System.

BetaGod

Tested and confirmed; it works as intended. Awesome job here, gameus!

I'll report back if i discover other issues  :ninja:
I am a god in BETA status and therefore, i may contain bugs and such.