Fantasist's Previously Unreleased Scripts

Started by Fantasist, January 14, 2011, 04:30:51 am

Previous topic - Next topic

Fantasist

January 14, 2011, 04:30:51 am Last Edit: January 14, 2011, 05:49:38 am by Fantasist
Well folks, hello! In my days working with RMXP, I have made several scripts for experimentation or for my own use, which I never posted here. Since I'm done with RGSS for now, I decided I will share them all here :D

Note that this is and will be an informal topic, and I don't plan on using the script submission format just yet. I just want to share all my work so that others can learn/adapt/improve upon them. When I feel like completing these scripts with final touches and documentation, I may post respective topics for each script.

One more note: this is not my complete collection. I have more scripts in my archives (like my version of a Message System, individual menu scenes for Status and Items, and others I don't even remember). I'll post them when I find them, okay?

Caution: These scripts were not meant to be released. Even if they were, they were not released because they were not tested extensively. So expect incompatibility issues, corrupted savegames or random problems if you plan on using these in your game. A simple rule of thumb is, scripts with script headers are less prone to problems. But in any case, some of these scripts will corrupt old save games, so be careful! Now enough talk, let's get down to the good stuff!



1. Dynamic Battle Help

This script makes better use of the help window during battle. This can be useful when special command windows are used instead of the command window in battle, where text is not displayed (like Icon commands, Ring commands, etc). This is inspired partly by Blizzard's Chaos Project and partly by my all-time favorite RPG: Chrono Trigger :D
Configuration instructions are in the script header.

Dynamic Battle Help: ShowHide

#=====================================================================================================================
# ** Dynamic Battle Help
#---------------------------------------------------------------------------------------------------------------------
# by Fantasist
# Version 1.0
# 16-Mar-2008
#---------------------------------------------------------------------------------------------------------------------
# Version History:
#
#   1.0 - First public version
#---------------------------------------------------------------------------------------------------------------------
# Description:
#       This script makes better use of the help window during battle. This can be useful
#     when special command windows are used instead of the command window in battle,
#     where text is not displayed (like Icon commands, Ring commands, etc).
#
#     Features:
#      - Displays every selectable command (Fight, Escape, Attack, Skill, Defend, Item)
#      - Can display differently than the actual command ("Use Item" when 'Item' is selected)
#      - Displays actions performed during battle (attacking, defending, skill casting, item using,
#           enemy fleeing and victory)
#      - Instead of just "Attack" or "Arshes attacks", you can chose to display the weapon name
#           ("Attack with Bronze Sword", "Arshes attacks with Bronze Sword"
#           And when no weapon is equipped: "Arshes attacks without weapon)
#      - During battle, the help window can use a solid colored background  instead of
#           the windowskin to make it look professional (the color and opacity are customizable)
#
#---------------------------------------------------------------------------------------------------------------------
# Compatibility:
#     20% chance of problems with other battle scripts.
#   Made to work with Unique Skill Commands addon from Tons and Addons.
#---------------------------------------------------------------------------------------------------------------------
# Installation: Place anywhere above 'Main' and below 'Scene Battle 4'.

# Configuration:

module FTSCFG
#============================================================
# Config Start
#============================================================

  # NOTE: Setting everything with "_Words" to 'nil' will use the default words you set in the database.
  #             Remember that this is the text displayed in the help window, not the command windows.
 
 
  # Party Command text (Fight, Escape window)
  DBH_Fight_Words = 'Engage opponents' # Text to display when 'Fight' is selected
  DBH_Escape_Words = 'Abscond battle'  # Text to display when 'Escape' is selected
 
  # Actor Command text (Attack, Skill, Defend, Item)
 
  DBH_Attack_Weapon = true # Whether to display "with <weapon>" / "without weapon"
 
  DBH_Attack_Words = nil # Text to display when 'Attack' is selected
  DBH_Skill_Words = nil # Text to display when 'Skill' is selected (Unique Skill Commands
                                       #  overrides this setting)
  DBH_Defend_Words = nil # Text to display when 'Defend' is selected
  DBH_Item_Words = nil # Text to display when 'Item' is selected
 
  DBH_Victory_Words = 'Victory!' # Text to display when battle is won
 
  # Help window tweaks
  DBH_Help_Always_Visible = false  # Whether the help window ALWAYS stays visible
  DBH_BG_Mod = false   # Whether a solid background is used instead of the windowskin
  DBH_BG_Color = Color.new(0, 0, 0, 128)  # Color of the solid background (applies for above)
                                                               #  Syntax: Color.new(RED, GREEN, BLUE, OPACITY)
 
#============================================================
# Config End
#============================================================
end
#---------------------------------------------------------------------------------------------------------------------
# Issues: None discovered yet.
#---------------------------------------------------------------------------------------------------------------------
# Credits: Fantasist, for making
# Thanks: Chaos Project (Game) for the inspiration
#---------------------------------------------------------------------------------------------------------------------
# Notes: If you have any problems, questions or suggestions, you can find me here:
#
#  www.quantumcore.forumotion.com
#  www.chaos-project.com/forums
#
#  Enjoy ^_^
#=====================================================================================================================

#=============================================================================
# ** Scene_Battle
#=============================================================================

class Scene_Battle
 
  # Part 1 - This disables the hiding of help window while chosing actions, to prevent flickering.
 
  alias fant_battle_help_mod_start_phase1 start_phase1
  def start_phase1
    @help_window.visible = true
    fant_battle_help_mod_start_phase1
  end
 
  alias fant_battle_help_mod_end_enemy_select end_enemy_select
  def end_enemy_select
    fant_battle_help_mod_end_enemy_select
    @help_window.visible = true
  end
 
  alias fant_battle_help_mod_end_skill_select end_skill_select
  def end_skill_select
    fant_battle_help_mod_end_skill_select
    @help_window.visible = true
  end
 
  alias fant_battle_help_mod_end_item_select end_item_select
  def end_item_select
    fant_battle_help_mod_end_item_select
    @help_window.visible = true
  end
 
  # Part 2 - This updates the help text accordingly when needed.
 
  alias fant_battle_help_mod_update_phase2 update_phase2
  def update_phase2
    txt = case @party_command_window.index
    when 0
      FTSCFG::DBH_Fight_Words ? FTSCFG::DBH_Fight_Words : (@party_command_window.commands[0] rescue 'Fight')
    when 1
      FTSCFG::DBH_Escape_Words ? FTSCFG::DBH_Escape_Words : (@party_command_window.commands[1] rescue 'Escape')
    end
    @help_window.set_text(txt, 1)
    fant_battle_help_mod_update_phase2
  end
 
  alias fant_battle_help_mod_update_phase3_basic_cmd update_phase3_basic_command
  def update_phase3_basic_command
    txt = case @actor_command_window.index
    when 0
      wpn = FTSCFG::DBH_Attack_Weapon ? (" with #{$data_weapons[@active_battler.weapon_id].name}" rescue
      ' without weapon') : ''
      ((FTSCFG::DBH_Attack_Words ? (FTSCFG::DBH_Attack_Words) : (@actor_command_window.commands[0] rescue
      'Attack')) + wpn)
    when 1
      if $tons_version && $game_system.UNIQUE_SKILL_COMMANDS
        (@actor_command_window.commands[1] rescue (FTSCFG::DBH_Skill_Words ? FTSCFG::DBH_Skill_Words : 'Skill'))
      else
        (FTSCFG::DBH_Skill_Words ? FTSCFG::DBH_Skill_Words : (@actor_command_window.commands[1] rescue 'Skill'))
      end
    when 2
      FTSCFG::DBH_Defend_Words ? FTSCFG::DBH_Defend_Words : (@actor_command_window.commands[2] rescue 'Defend')
    when 3
      FTSCFG::DBH_Item_Words ? FTSCFG::DBH_Item_Words : (@actor_command_window.commands[3] rescue 'Item')
    end
    @help_window.set_text(txt, 1)
    fant_battle_help_mod_update_phase3_basic_cmd
  end
 
  alias fant_battle_help_mod_start_phase5 start_phase5
  def start_phase5
    @help_window.set_text(FTSCFG::DBH_Victory_Words, 1)
    fant_battle_help_mod_start_phase5
  end
 
  alias fant_battle_help_mod_make_basic_action_result make_basic_action_result
  def make_basic_action_result
    fant_battle_help_mod_make_basic_action_result
    if @active_battler.current_action.basic == 0
      txt = "#{@active_battler.name} attacks" + ((@active_battler.is_a?(Game_Enemy) ||
      !FTSCFG::DBH_Attack_Weapon) ? '' :
      (" with #{$data_weapons[@active_battler.weapon_id].name}" rescue ' without weapon'))
      @help_window.set_text(txt, 1)
    elsif @active_battler.current_action.basic == 1
      @help_window.set_text("#{@active_battler.name} defends", 1)
    elsif @active_battler.is_a?(Game_Enemy) && @active_battler.current_action.basic == 2
      @help_window.set_text("#{@active_battler.name} fled", 1)
    end
  end
 
  alias fant_battle_help_mod_make_skill_action_result make_skill_action_result
  def make_skill_action_result
    fant_battle_help_mod_make_skill_action_result
    @help_window.set_text("#{@active_battler.name} performs #{@skill.name}", 1)
  end
 
  alias fant_battle_help_mod_make_item_action_result make_item_action_result
  def make_item_action_result
    fant_battle_help_mod_make_item_action_result
    @help_window.set_text("#{@active_battler.name} uses #{@item.name}", 1)
  end
 
end

#=============================================================================
# ** Window_Help
#=============================================================================

class Window_Help
 
  alias fant_battle_help_mod_help_win_init initialize
  def initialize
    fant_battle_help_mod_help_win_init
    if $scene.is_a?(Scene_Battle) && FTSCFG::DBH_BG_Mod
      self.y -= 8
      self.opacity = 0
      bmp = Bitmap.new(640-16, 32)
      bmp.fill_rect(0, 0, 640-16, 32, FTSCFG::DBH_BG_Color)
      @bg = Sprite.new
      @bg.x, @bg.y, @bg.z = self.x + 8, self.y + 16, self.z + 1
      @bg.bitmap = bmp
    end
  end
 
  def visible=(val)
    super(val)
    if $scene.is_a?(Scene_Battle) && !FTSCFG::DBH_BG_Mod
      val = FTSCFG::DBH_Help_Always_Visible unless val
      super(val)
    end
    if @bg
      val = FTSCFG::DBH_Help_Always_Visible unless val
      @bg.visible = val
    end
  end
 
  alias fant_battle_help_mod_help_win_dispose dispose
  def dispose
    fant_battle_help_mod_help_win_dispose
    if @bg != nil
      @bg.bitmap.dispose
      @bg.dispose
    end
  end
 
end

#=============================================================================
# ** Window_Command
#=============================================================================

class Window_Command
  attr_accessor :commands
end

#=============================================================================
# ** Window_PartyCommand
#=============================================================================
class Window_PartyCommand
 
  alias fant_battle_help_mod_win_party_init initialize
  def initialize
    fant_battle_help_mod_win_party_init
    self.y = 64
  end
 
end




2. Enhanced Equip Scene

Remember my script "Enhanced Shop Status"? I made this along similar lines: to replace the default equip scene of RMXP. The layout is inspired by RPG Advocate's mod, but I believe this is more efficient. At any rate, it's much more efficient than the crummy default equip scene ;)

Instructions:

Set ELEM_ICONS to "true" to enable icons for elemental change display. Name the icon files like "elem_<name of element as specified in the database>". (for the element "White Fire", the icon should be named "elem_White Fire").

Set STATUS_ICONS to "true" to enable icons for status change display. Name the icon files like "stat_<name of status as specified in the database>". (for the status "Sleep", the icon should be named "stat_Sleep").

Enhanced Equip Scene: ShowHide

#=============================================================================
# ** CMS
#=============================================================================

module CMS
 
  ELEM_ICONS = false
  STATUS_ICONS = false
 
end

#=============================================================================
# ** Window_Base
#=============================================================================

class Window_Base
 
  def up_color
    return Color.new(64, 255, 64)
  end
 
  def down_color
    return Color.new(255, 64, 64)
  end
 
end

#=============================================================================
# ** Game_Actor
#=============================================================================

class Game_Actor < Game_Battler
 
  def get_stats
    return [maxhp, maxsp, atk, pdef, mdef, str, dex, agi, int, eva]
  end
 
end

#==============================================================================
# ** Window_EquipLeft
#==============================================================================

class Window_EquipLeft < Window_Base
 
  attr_accessor :mode
  def initialize(actor)
    super(0, 64, 272, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.size = 22
    @actor, mode = actor, 0
    @new_stats = [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil]
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.blt(4, 0, RPG::Cache.character(@actor.character_name,
    @actor.character_hue), Rect.new(0, 0, 32, 32))
    draw_actor_name(@actor, 40, 0)
    draw_actor_level(@actor, 180, 0)
    (@new_stats.size - 1).times {|i| draw_actor_parameter(@actor, 4, 32 + i * 24, i)}
    old_stats = @actor.get_stats
    @new_stats.each_with_index {|stat, i| next unless stat.is_a?(Numeric)
    self.contents.font.color = system_color
    self.contents.draw_text(160,  32 + i * 24, 40, 24, '» »', 1)
    color = old_stats[i] > stat ? down_color : old_stats[i] < stat ? up_color : normal_color
    self.contents.font.color = color
    self.contents.draw_text(200, 32 + i * 24, 36, 24, stat.to_s, 2)}
    txt = @mode == 0 ? 'Elemental Affinity:' : 'Elemental Resistance:'
    self.contents.draw_text(4, 280, self.width - 32, 24, txt)
    txt = @mode == 0 ? 'Status Infliction:' : 'Status Resistance'
    self.contents.draw_text(4, 332, self.width - 32, 24, txt)
    draw_elemental_change(@new_stats[10])
    draw_status_change(@new_stats[10])
  end
 
  def set_new_parameters(array=nil)
    return if array == @new_stats
    if array == nil
      @new_stats = [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil]
    else
      array.each_with_index {|nstat, i| next if nstat == @new_stats[i]
      @new_stats[i] = nstat}
    end
    refresh
  end
 
  def draw_elemental_change(item=nil)
    return if item == nil
    ary = []
    if item.is_a?(RPG::Weapon)
      item.element_set.each {|i| ary.push($data_system.elements[i])}
    else
      item.guard_element_set.each {|i| ary.push($data_system.elements[i])}
    end
    return unless ary.size > 0
    ary.delete_at(ary.size - 1) while ary.size > 8
    if CMS::ELEM_ICONS
      ary.each_with_index {|str, i| x = 4 + i * 28
      icon =  RPG::Cache.icon('elem_' + str)
      self.contents.blt(x, 308, icon, icon.rect)}
    else # Text
      self.contents.font.color, txt = system_color, ''
      ary.each_with_index {|str, i| txt += str; txt += ', ' unless i == ary.size - 1}
      self.contents.draw_text(4, 308, self.width - 32, 24, txt)
    end
  end
 
  def draw_status_change(item=nil)
    return if item == nil
    ary = []
    if item.is_a?(RPG::Weapon)
      item.plus_state_set.each {|i| ary.push($data_states[i].name)}
    else
      item.guard_state_set.each {|i| ary.push($data_states[i].name)}
    end
    return unless ary.size > 0
    ary.delete_at(ary.size - 1) while ary.size > 8
    if CMS::STATUS_ICONS
      ary.each_with_index {|str, i| x = 4 + i * 28
      icon =  RPG::Cache.icon('stat_' + str)
      self.contents.blt(x, 356, icon, icon.rect)}
    else # Text
      self.contents.font.color, txt = system_color, ''
      ary.each_with_index {|str, i| txt += str; txt += ', ' unless i == ary.size - 1}
      self.contents.draw_text(4, 356, self.width - 32, 24, txt)
    end
  end
 
  def draw_actor_parameter(actor, x, y, type)
    case type
    when 0
      txt, val = 'max '+$data_system.words.hp, actor.maxhp
    when 1
      txt, val = 'max '+$data_system.words.sp, actor.maxsp
    when 2
      txt, val = $data_system.words.atk, actor.atk
    when 3
      txt, val = $data_system.words.pdef, actor.pdef
    when 4
      txt, val = $data_system.words.mdef, actor.mdef
    when 5
      txt, val = $data_system.words.str, actor.str
    when 6
      txt, val = $data_system.words.dex, actor.dex
    when 7
      txt, val = $data_system.words.agi, actor.agi
    when 8
      txt, val = $data_system.words.int, actor.int
    when 9
      txt, val = 'Evasion', actor.eva
    end
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 120, 24, txt)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 120, y, 36, 24, val.to_s, 2)
  end
 
end

#==============================================================================
# ** Window_EquipItem
#==============================================================================

class Window_EquipItem < Window_Selectable
 
  def initialize(actor, equip_type)
    super(272, 256, 368, 224)
    @actor, @equip_type, @column_max = actor, equip_type, 1
    refresh
    self.active, self.index = false, -1
  end
 
  def item
    return @data[self.index]
  end
 
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    if @equip_type == 0
      weapon_set = $data_classes[@actor.class_id].weapon_set
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0 && weapon_set.include?(i)
          @data.push($data_weapons[i])
        end
      end
    end
    if @equip_type != 0
      armor_set = $data_classes[@actor.class_id].armor_set
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0 && armor_set.include?(i)
          if $data_armors[i].kind == @equip_type-1
            @data.push($data_armors[i])
          end
        end
      end
    end
    @data.push(nil)
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max-1
      draw_item(i)
    end
    h = @data.size - 1
    self.contents.draw_text(4, h * 32, self.width - 32, 32, '[Remove]')
  end
 
  def draw_item(index)
    item = @data[index]
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    case item
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 240, y, 16, 32, ':', 1)
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
  end
 
  def update_help
    @help_window.set_text(self.item == nil ? '' : self.item.description)
  end
 
end

#==============================================================================
# ** Scene_Equip
#==============================================================================

class Scene_Equip
 
  def initialize(actor_index = 0, equip_index = 0)
    @actor_index, @equip_index = actor_index, equip_index
  end
 
  def main
    @actor = $game_party.actors[@actor_index]
    @help_window = Window_Help.new
    @left_window = Window_EquipLeft.new(@actor)
    @right_window = Window_EquipRight.new(@actor)
    @item_windows = []
    5.times {|i| @item_windows.push(Window_EquipItem.new(@actor, i))}
    @right_window.help_window = @help_window
    @item_windows.each {|win| win.help_window = @help_window}
    @right_window.index = @equip_index
    update_equip_type
    @left_window.set_new_parameters(nil)
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    Graphics.freeze
    @help_window.dispose
    @left_window.dispose
    @right_window.dispose
    @item_windows.each {|win| win.dispose}
  end
 
  def update
    @left_window.update
    @right_window.update
    @item_window.update
    if @right_window.active
      update_right
      return
    end
    if @item_window.active
      update_item
      return
    end
  end
 
  def update_right
    if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN)
      update_equip_type
      @left_window.refresh
    end
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(2)
      return
    end
    if Input.trigger?(Input::C)
      if @actor.equip_fix?(@right_window.index)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @right_window.active = false
      @item_window.active = true
      @item_window.index = 0
      compare_stats
      return
    end
    if Input.trigger?(Input::R)
      $game_system.se_play($data_system.cursor_se)
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      $scene = Scene_Equip.new(@actor_index, @right_window.index)
      return
    end
    if Input.trigger?(Input::L)
      $game_system.se_play($data_system.cursor_se)
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      $scene = Scene_Equip.new(@actor_index, @right_window.index)
      return
    end
  end
 
  def update_item
    if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN) ||
      Input.repeat?(Input::L) || Input.repeat?(Input::R)
      compare_stats
    end
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @right_window.active = true
      @item_window.active = false
      @item_window.index = -1
      @left_window.set_new_parameters(nil)
      return
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.equip_se)
      item = @item_window.item
      @actor.equip(@right_window.index, item == nil ? 0 : item.id)
      @right_window.active = true
      @item_window.active = false
      @item_window.index = -1
      @right_window.refresh
      @item_window.refresh
      @left_window.set_new_parameters(nil)
      return
    end
  end
 
  def update_equip_type
    @item_windows.each {|win| win.visible = false}
    @item_windows[@right_window.index].visible = true
    @item_window = @item_windows[@right_window.index]
    @left_window.mode = @right_window.index == 0 ? 0 : 1
  end
 
  def compare_stats
    item1 = @right_window.item
    item2 = @item_window.item
    last_hp = @actor.hp
    last_sp = @actor.sp
    @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
    new_stats = @actor.get_stats.clone
    new_stats.push(item2)
    @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
    @actor.hp = last_hp
    @actor.sp = last_sp
    @left_window.set_new_parameters(new_stats)
  end
 
end




3. Ring Command

A rotating ring with pictures, can be used as a command window :D Instructions and settings found in the script. I actually made better versions, but I lost them in my archives... But this is functional :)

Ring Command: ShowHide

#============================================================================
# ** Ring Command
#------------------------------------------------------------------------------------------------------------------------
# by Fantasist
# Version 1.0
# 13-Mar-2008
#------------------------------------------------------------------------------------------------------------------------
# Version History:
#
#   1.0 - First functional version
#------------------------------------------------------------------------------------------------------------------------
# Description:
#   A rotating ring with pictures, can be used as a command window.
#------------------------------------------------------------------------------------------------------------------------
# Compatibility:
#   No compatibility issues
#------------------------------------------------------------------------------------------------------------------------
# Instructions/Configuration:
#
#   Scroll down a bit and you'll find 'Frames' and 'Depth'.
#   Frames - The speed of rotation. Larger numbers means slower movement.
#   Depth - The 'tilt' factor of the ring, or how elliptical the ring looks. 1 means a circle.
#               Larger numbers means more elliptical. Remember that the zooming of the icons
#               is not made to look real, but to fit the regular usage. If you use 1 for depth, the
#               zoom is disabled, to make th ring look like a circle.
#------------------------------------------------------------------------------------------------------------------------
# Issues: None
#------------------------------------------------------------------------------------------------------------------------
# Credits: Fantasist for making this
# Thanks: Chaos Project (Game) for inspiration
#------------------------------------------------------------------------------------------------------------------------
# Notes: Enjoy ^_^
#============================================================================


#=============================================================================
# ** Icon_Ring
#=============================================================================

class Icon_Ring < RPG::Sprite
 
  Icon_BG = 'IconBGCP'  # Background to be used behind all ring icons (optional)
  Icon_Disable = 'IconDisableCP'   # Icon overlay for 'disabled' options (optional, but there's no
                                                  # other way to show a disabled icon for now
 
  def initialize(item, disabled=false)
    super()
    @item = item
    self.bitmap = make_bmp(item, disabled)
    self.ox, self.oy = self.bitmap.width / 2, self.bitmap.height / 2
  end
 
  def make_bmp(item, disabled=false)
    bmp = RPG::Cache.icon(Icon_BG).clone rescue Bitmap.new(32, 32)
    # Draw item
    if item.is_a?(Numeric)
      bmp.draw_text(0, 0, bmp.width, bmp.height, item.to_s, 1)
    elsif item.is_a?(String)
      bmp.draw_text(0, 0, bmp.width, bmp.height, item, 1)
    elsif item.is_a?(Bitmap)
      bmp.blt(bmp.width/2 - item.rect.width/2, bmp.height/2 - item.rect.height/2, item, item.rect)
    end
    # Draw X
    disable if disabled
    bmp
  end
 
  def disable
    bmp = self.bitmap
    x = RPG::Cache.icon(Icon_Disable) rescue Bitmap.new(32, 32)
    bmp.blt(bmp.width/2 - x.rect.width/2, bmp.height/2 - x.rect.height/2, x, x.rect)
    self.bitmap = bmp
  end
 
  def enable
    self.bitmap = make_bmp(@item)
  end
 
end

#=============================================================================
# ** Ring_Command
#=============================================================================

class Ring_Command < Sprite
 
  Frames = 6 # Movement Speed. Larger number means slower movement
  Depth = 6 # Depth of the ring, meaning the 'tilt' factor.
 
  attr_reader :index
  attr_accessor :active
  attr_reader :radius
  attr_reader :cmds
  attr_reader :unit_angle
 
  #dummy values for window compatibility
  attr_accessor :windowskin, :contents, :stretch, :cursor_rect, :pause, :back_opacity, :contents_opacity
 
  def initialize(x=320, y=240, r=200, cmds=15, win_w=0, win_h=0)
    super()
    set_icons(cmds)
    @unit_angle = 360.0/@cmds.size
    @win_offset = [win_w/2, win_h]
    self.radius, self.x, self.y = r, x, y
    self.index = 0
    self.active = true
  end
 
  def set_icons(cmds)
    #dispose previous icons
    if @cmds != nil
      @cmds.each {|sp|
      sp.bitmap.dispose
      sp.dispose}
    end
    #make icons
    @cmds = []
    unless cmds.is_a?(Array)
      (1..cmds).each {|i| @cmds.push(Icon_Ring.new(i))}
    else
      cmds.each {|item| @cmds.push(Icon_Ring.new(item))}
    end
  end
 
  def set_items(ang=self.angle)
    @cmds.each_index {|i|
    @cmds[i].blink_off
    @cmds[i].x = self.x + self.radius * sin(ang + @unit_angle * i)
    @cmds[i].y = self.y + self.radius/Depth * cos(ang + @unit_angle * i)
    @cmds[i].z = self.z + @cmds[i].y
    unless Depth == 1
      zoom = 0.8 + 0.2 * (@cmds[i].y - (self.y-self.radius/Depth)).to_f / (2*self.radius/Depth)
      @cmds[i].zoom_x = @cmds[i].zoom_y = zoom
    end
    }
  end
 
  def move(dir=0)
    ang = (@unit_angle / Frames)
    Frames.times {
    self.angle += (dir == 0 ? ang : -ang)
    self.angle -= 360 if self.angle > 360.0
    self.angle += 360 if self.angle < -360.0
    set_items
    Graphics.update}
  end
 
  def update
    if self.active
      @cmds[@index].update
      @cmds[@index].blink_on
      if Input.repeat?(Input::RIGHT)
        $game_system.se_play($data_system.cursor_se)
        move(1)
        @index = (@index + 1) % @cmds.size
      elsif Input.repeat?(Input::LEFT)
        $game_system.se_play($data_system.cursor_se)
        move(0)
        @index = (@index - 1) % @cmds.size
      end
    end
  end
 
  def disable_item(index)
    @cmds[index].disable
  end
 
  def sin(val)
    Math.sin(Math::PI*val/180)
  end
 
  def cos(val)
    Math.cos(Math::PI*val/180)
  end
 
  def dispose
    super
    @cmds.each {|sp|
    sp.bitmap.dispose
    sp.dispose}
  end
 
  def visible=(val)
    super(val)
    @cmds.each {|sp| sp.visible = val}
  end
 
  def index=(i)
    @index = i
    self.angle = i * @unit_angle
    set_items
  end
 
  def radius=(r)
    @radius = r
    set_items
  end
 
  def cmds=(cmds)
    #dispose previous icons
    if @cmds != nil
      @cmds.each {|sp|
      sp.bitmap.dispose
      sp.dispose}
    end
    @cmds = cmds
    @unit_angle = 360.0/@cmds.size
    self.angle = 0
    self.index = 0
  end
   
 
  def x=(x)
    super(x+@win_offset[0])
    set_items
  end
 
  def y=(y)
    super(y+@win_offset[1])
    set_items
  end
 
end

Icons (necessary!): ShowHide

Put these icons in the Icons folder:

(Just an extra)
(rename to "IconBGCP")
(rename to "IconDisableCP")




3a. Ring Command Replacement for Battle Scene

And here is an addon that allows you to replace the command window in the battle scene :D

Battle Ring Command Addon: ShowHide

#============================================================================
# ** Ring Command Replacement for Battle Scene
#------------------------------------------------------------------------------------------------------------------------
# by Fantasist
# Version 1.0
# 13-Mar-2008
#------------------------------------------------------------------------------------------------------------------------
# Version History:
#
#   1.0 - First functional version
#------------------------------------------------------------------------------------------------------------------------
# Description:
#   Replaces the actor command windows with the Ring command. As an added feature,
#   the icon of the actor's weapon is used for the attack icon (sword, mace, etc). If no weapon is
#   equipped, the default icon is used. This is a feature from the game Chaos Project.
#   The icons can be configured.
#------------------------------------------------------------------------------------------------------------------------
# Compatibility:
#   No compatibility issues
#------------------------------------------------------------------------------------------------------------------------
# Instructions/Configuration:
#------------------------------------------------------------------------------------------------------------------------
# Issues: None
#------------------------------------------------------------------------------------------------------------------------
# Credits: Fantasist for making this
# Thanks: Chaos Project (Game) for inspiration
#------------------------------------------------------------------------------------------------------------------------
# Notes: Enjoy ^_^
#============================================================================

#=============================================================================
# ** Scene_Battle
#=============================================================================

class Scene_Battle
 
  Ring_Y = 160
  Ring_Radius = 64
 
  Fight = '001-Weapon01'
  Escape = '020-Accessory05'
 
  Attack = '001-Weapon01'
  Defend = '009-Shield01'
  Skill = '044-Skill01'
  Item = '032-Item01'
 
  alias fant_party_cmd_ring_start_phase1 start_phase1
  def start_phase1
    if @party_command_window.is_a?(Window_PartyCommand)
      @party_command_window.dispose
      fight = RPG::Cache.icon(Fight)
      escape = RPG::Cache.icon(Escape)
      @party_command_window = Ring_Command.new(320, 128, 64, [fight, escape])
    end
    if @actor_command_window.is_a?(Window_Command)
      @actor_command_window.dispose
      wpn = RPG::Cache.icon($data_weapons[@active_battler.weapon_id].icon_name) rescue
        RPG::Cache.icon(Attack)
      skl = RPG::Cache.icon(Skill)
      dfn = RPG::Cache.icon(Defend)
      itm = RPG::Cache.icon(Item)
      cmds = [wpn, skl, dfn, itm]
      @actor_command_window = Ring_Command.new(0, Ring_Y, Ring_Radius, cmds, 160, 80)
    @actor_command_window.visible = false
    end
    fant_party_cmd_ring_start_phase1
  end
 
  alias fant_weapon_icon_ring phase3_setup_command_window
  def phase3_setup_command_window
    @actor_command_window.visible = false
    wpn = RPG::Cache.icon($data_weapons[@active_battler.weapon_id].icon_name) rescue
      RPG::Cache.icon(Attack)
    @actor_command_window.cmds[0].bitmap.dispose
    @actor_command_window.cmds[0].dispose
    @actor_command_window.cmds[0] = Icon_Ring.new(wpn)
    fant_weapon_icon_ring
  end
 
end


Here's a demo using the ring command in battle with the dynamic battle help script. Though it's just the DBS, it looks a lot like CP battle system ;)
Demo (287.15 KB)



4. Repeat Battle Actions

Adds Repeat, Attack and Defend functions to Party Command Window. More info in script header. This is made for the default battle system. This will corrupt old save games!

Repeat Battle Actions: ShowHide

#============================================================================
# ** Repeat Battle Actions
#------------------------------------------------------------------------------------------------------------------------
# by Fantasist
# Version 1.1
# 17-Apr-2008
#------------------------------------------------------------------------------------------------------------------------
# Version History:
#
#   0.1 - First alpha version
#   0.2 - Added support for default action
#   0.3 - Added Status Window Mod (for default status screen)
#   0.4 - Added fail-safe actions
#   1.0 - Optimized code and added some options
#   1.1 - Fixed a bug in Status Config
#------------------------------------------------------------------------------------------------------------------------
# Description:
#     Adds Repeat, Attack and Defend functions to Party Command Window.
#   Repeat - Repeats previous actions
#   Attack - All actors attack
#   Defend - All actors defend
#
# Features:
#  - Make actors Repeat their previous actions, or make them all attack or defend
#  - Config addon for default status screen
#  - Memorize option in the status config saves the last action with the savefile, and is
#    globally remembered
#  - Fail-safe actions - performs default action if previous action can't be performed
#------------------------------------------------------------------------------------------------------------------------
# Compatibility:
#
#   Might not be compatible with other battle systems.
#------------------------------------------------------------------------------------------------------------------------
# Installation: Place this script anywhere above main and below Scene_Battle.
#
# Configuration:
#
#   Fail_Safe_Action: When using 'Repeat', if the action fails (not enough SP or no item to use),
#                             default action is performed.
#   Memorize_Atk_Dfn: Whether to remember 'Attack' or 'Defend' used from the auto-battle options.
#
class Scene_Battle
 
  Fail_Safe_Action = true
 
  Memorize_Atk_Dfn = false
 
end
#------------------------------------------------------------------------------------------------------------------------
# Issues: None
#------------------------------------------------------------------------------------------------------------------------
# Credits: Fantasist for making this
#------------------------------------------------------------------------------------------------------------------------
# Notes:
# If you have any questions, problems or suggestions, you can find me at:
#  - www.chaos-project.com
#  - www.quantumcore.forumotion.com
#
# Enjoy ^_^
#============================================================================

#==============================================================================
# ** Game_Battler
#==============================================================================

class Game_Battler
 
  attr_accessor :prior_action, :default_action, :memorize_action
 
  alias fant_auto_battle_game_battler_init initialize
  def initialize
    fant_auto_battle_game_battler_init
    @prior_action, @default_action = Game_BattleAction.new, Game_BattleAction.new
    @default_action.kind, @default_action.basic, @memorize_action = 0, 1, false
  end
 
  def current_action=(action)
    @current_action = action if action.is_a?(Game_BattleAction)
  end
 
end

#==============================================================================
# ** Scene_Battle
#==============================================================================

class Scene_Battle
 
  alias fant_auto_battle_scene_battle_main main
  def main
    $game_party.actors.each {|actor| actor.prior_action = actor.default_action.clone}
    fant_auto_battle_scene_battle_main
  end
 
  alias fant_auto_battle_scene_battle_upd_phase2 update_phase2
  def update_phase2
    if  Input.trigger?(Input::C) && @party_command_window.index == 2
      case @party_command_window.auto_index
      when 0
        $game_party.actors.each {|actor| actor.current_action = actor.prior_action.clone}
      when 1
        $game_party.actors.each {|actor| actor.current_action.kind = actor.current_action.basic = 0}
      when 2
        $game_party.actors.each {|actor| actor.current_action.kind, actor.current_action.basic = 0, 1}
      when 3
        if $easy_party_switcher && $easy_party_switcher >= 2.4 && BlizzCFG::BATTLE_SWITCH
          $game_system.se_play($data_system.decision_se)
          @spriteset.dispose
          $scene = Scene_PartySwitcher.new
          $scene.main
          $scene = self
          @spriteset = Spriteset_Battle.new
          15.times {@spriteset.update}
          @status_window.refresh
          Graphics.transition(0)
        end
      end
      start_phase4
    end
    fant_auto_battle_scene_battle_upd_phase2
  end
 
  alias fant_auto_battle_scene_battle_start_phase4 start_phase4
  def start_phase4
    fant_auto_battle_scene_battle_start_phase4
    $game_party.actors.each {|actor| prepare_action(actor)}
  end
 
  def prepare_action(actor)
    if @party_command_window.auto_index == 0 && !Memorize_Atk_Dfn
      actor.prior_action = actor.current_action.clone
      actor.default_action = actor.current_action.clone if actor.memorize_action
    end
    action = actor.current_action
    if Fail_Safe_Action && ((action.kind == 1 && !actor.skill_can_use?(action.skill_id)) ||
      (action.kind == 2 && !$game_party.item_can_use?(action.item_id)))
      actor.current_action = actor.default_action.clone
    end
  end
 
end

#==============================================================================
# ** Window_PartyCommand
#==============================================================================

class Window_PartyCommand < Window_Selectable
 
  attr_reader :auto_index, :auto_cmds
 
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.active = self.visible = false
    self.back_opacity, self.index = 160, 0
    @commands = ['Fight', 'Escape', 'Auto']
    @item_max = @column_max = 3
    @auto_index, @auto_cmds = 0, ['Repeat', 'Attack', 'Defend']
    if $easy_party_switcher && $easy_party_switcher >= 2.4 && BlizzCFG::BATTLE_SWITCH
      @auto_cmds.push('Switch')
    end
    draw_item(0, normal_color)
    draw_item(1, $game_temp.battle_can_escape ? normal_color : disabled_color)
    draw_item(2, normal_color)
  end
 
  def update
    super
    draw_item(2, normal_color) if Input.repeat?(Input::RIGHT) || Input.repeat?(Input::LEFT)
    if @index == 2
      if Input.repeat?(Input::UP)
        $game_system.se_play($data_system.cursor_se)
        @auto_index = (@auto_index - 1) % @auto_cmds.size
        draw_item(2, normal_color)
      elsif Input.repeat?(Input::DOWN)
        $game_system.se_play($data_system.cursor_se)
        @auto_index = (@auto_index + 1) % @auto_cmds.size
        draw_item(2, normal_color)
      end
    end
  end
 
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(index * 608 / @column_max, 0, 608 / @column_max, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    font = self.contents.font.name.clone
    self.contents.font.name = 'Arial'
    self.contents.draw_text(rect, '↑                  ↓', 1) if index == 2 && @index == 2 # ˄˅↑↓
    self.contents.font.name = font
    txt = index == 2 ? @auto_cmds[@auto_index] : @commands[index]
    self.contents.draw_text(rect, txt, 1)
  end
 
  def update_cursor_rect
    self.cursor_rect.set(index * 608 / @column_max, 0, 608 / @column_max, 32)
  end
 
end

#==============================================================================
# ** Window_Status
#==============================================================================

class Window_Status < Window_Selectable
 
  X, Y, W, W2 = 320, 118, 128, 96
 
  def initialize(actor)
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    @cmds = ['Attack', 'Defend', 'Memorize']
    if @actor.default_action.kind == 0 && @actor.default_action.basic == 0
      self.index = 0
    elsif @actor.default_action.kind == 0 && @actor.default_action.basic == 1
      self.index = 1
    end
    self.index = 2 if @actor.memorize_action
    refresh
  end
 
  def update_cursor_rect
    self.cursor_rect.set(X+W, Y, W2, 32)
  end
 
  def update
    super
    update_cursor_rect
    return if @index < 0
    if Input.repeat?(Input::RIGHT) || Input::repeat?(Input::C)
      $game_system.se_play($data_system.cursor_se)
      @index = (@index + 1) % @cmds.size
      self.contents.font.color = normal_color
      self.contents.fill_rect(X+W, Y, W2, 32, Color.new(0, 0, 0, 0))
      self.contents.font.color = crisis_color
      self.contents.draw_text(X+W, Y, W2, 32, @cmds[@index], 1)
      case @index
      when 0
        @actor.default_action.kind = @actor.default_action.basic = 0
        @actor.memorize_action = false
      when 1
        @actor.default_action.kind, @actor.default_action.basic = 0, 1
        @actor.memorize_action = false
      when 2
        @actor.memorize_action = true
      end
    end
    if Input.repeat?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      @index = (@index - 1) % @cmds.size
      self.contents.font.color = normal_color
      self.contents.fill_rect(X+W, Y, W2, 32, Color.new(0, 0, 0, 0))
      self.contents.font.color = crisis_color
      self.contents.draw_text(X+W, Y, W2, 32, @cmds[@index], 1)
      case @index
      when 0
        @actor.default_action.kind = @actor.default_action.basic = 0
        @actor.memorize_action = false
      when 1
        @actor.default_action.kind, @actor.default_action.basic = 0, 1
        @actor.memorize_action = false
      when 2
        @actor.memorize_action = true
      end
    end
    if self.active and @help_window != nil
      update_help
    end
  end
 
  def refresh
    self.contents.clear
    draw_actor_graphic(@actor, 40, 112)
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 4 + 144, 0)
    draw_actor_level(@actor, 96, 32)
    draw_actor_state(@actor, 96, 64)
    draw_actor_hp(@actor, 96, 112, 172)
    draw_actor_sp(@actor, 96, 144, 172)
    draw_actor_parameter(@actor, 96, 192, 0)
    draw_actor_parameter(@actor, 96, 224, 1)
    draw_actor_parameter(@actor, 96, 256, 2)
    draw_actor_parameter(@actor, 96, 304, 3)
    draw_actor_parameter(@actor, 96, 336, 4)
    draw_actor_parameter(@actor, 96, 368, 5)
    draw_actor_parameter(@actor, 96, 400, 6)
    self.contents.font.color = system_color
    self.contents.draw_text(320, 48, 80, 32, "EXP")
    self.contents.draw_text(320, 80, 80, 32, "NEXT")
    self.contents.font.color = normal_color
    self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(320, 160, 96, 32, "equipment")
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
    self.contents.font.color = normal_color
    self.contents.draw_text(X, Y, W, 32, 'Battle Action:')
    self.contents.font.color = crisis_color
    self.contents.draw_text(X+W, Y, W2, 32, @cmds[@index], 1)
  end
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  end
 
end

#==============================================================================
# ** Scene_Status
#==============================================================================

class Scene_Status
 
  alias fant_auto_battle_scene_status_upd update
  def update
    @status_window.update
    fant_auto_battle_scene_status_upd
  end
 
end




5. Windowskin Viewer

This is a scene which gives detailed preview of windowskins. It automatically reads all the windowsking in your "Graphics/Windowskins" folder. This is only meant for debug purposes, but can be used anywhere and anytime. Call the scene with the script call:
$scene = Scene_Winskin.new


Windowskin Viewer: ShowHide

#============================================================================
# ** Windowskin Viewer
#----------------------------------------------------------------------------------------
# by Fantasist
# Version: Alpha-2
# Date: 21-Sep-2008
#----------------------------------------------------------------------------------------
# Version History:
#
#    - Alpha 1: First version
#    - Alpha 2: Complete Overhaul
#----------------------------------------------------------------------------------------
# Description:
#
#     This is a scene which gives detailed preview of all the windowskins in
#   the Graphics/Windowskins folder. This is only meant for debug purposes,
#   but can be used anywhere and anytime.
#----------------------------------------------------------------------------------------
# Compatibility:
#
#   Compatible with most other scripts.
#----------------------------------------------------------------------------------------
# Instructions/Configuration:
#
#    Just paste the script anywhere below Window_Selectable and above Main.
#   Call the scene by using the following line of script:
#               $scene = Scene_Winskin.new
#
#   To change the windowskin BG, press X (A key by default). Other
#   instructions are in the message window preview in the scene.
#----------------------------------------------------------------------------------------
# Issues:
#
#     None significant for now.
#----------------------------------------------------------------------------------------
# Credits and Thanks:
#
#   Fantasist, for making this.
#----------------------------------------------------------------------------------------
# Notes:
#
#     I'm too lazy right now :P
#============================================================================

#=============================================================================
# ** Scene_Winskin
#=============================================================================

class Scene_Winskin
 
  Excluded_Skins = ['Outlaw']
 
  def main
    @index = @hue = 0
    @wins, @sprites = [], []
    @names = [$data_system.windowskin_name.clone]
    dir = Dir.new('Graphics/Windowskins')
    dir.entries.each {|file| next unless file.include?('.png')
    @names.push(file); RPG::Cache.windowskin(file)}
    @names = (@names | @names) - Excluded_Skins
    # Background
    @win_bg = Window_SkinBG.new
    @wins.push(@win_bg)
    # Message Window
    @win_msg = Window_MessagePreview.new
    @wins.push(@win_msg)
    # Contents Window
    @win_cnts = Window_ContentsPreview.new
    @wins.push(@win_cnts)
    # Windowskin
    @skin = Sprite.new
    @skin.x, @skin.y, @skin.ox, @skin.oy, @skin.z = 320, 220, 96, 64, @win_bg.z + 10
    @sprites.push(@skin)
    # Battle Cursor
    @arrow = Sprite_BattleCursorPreview.new
    @arrow.z = 120
    @sprites.push(@arrow)
    refresh
    Graphics.transition
    loop {
      Graphics.update
      Input.update
      update
      break if $scene != self
    }
    Graphics.freeze
    @wins.each {|win| win.dispose if win}
    @sprites.each {|sp| sp.dispose if sp}
  end
 
  def refresh
    @skin.bitmap = RPG::Cache.windowskin(@names[@index])
    @win_bg.refresh(@names[@index])
  end
 
  def update
    @wins.each {|win| win.update if win}
    @sprites.each {|sp| sp.update if sp}
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      $game_system.se_play($data_system.cursor_se)
      $game_system.windowskin_name = @names[@index]
      @arrow.bitmap = RPG::Cache.windowskin(@names[@index])
      refresh
    end
    if Input.repeat?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      @index = (@index + 1) % @names.size
      refresh
    elsif Input.repeat?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      @index = (@index - 1) % @names.size
      refresh
    end
    if Input.repeat?(Input::L)
      $game_system.se_play($data_system.cursor_se)
      @hue = (@hue + 36) % 360
      RPG::Cache.windowskin(@names[@index]).dispose
      RPG::Cache.windowskin(@names[@index])
      RPG::Cache.windowskin(@names[@index]).hue_change(@hue)
      @arrow.bitmap = RPG::Cache.windowskin(@names[@index])
      refresh
    elsif Input.repeat?(Input::R)
      $game_system.se_play($data_system.cursor_se)
      @hue = (@hue + 324) % 360
      RPG::Cache.windowskin(@names[@index]).dispose
      RPG::Cache.windowskin(@names[@index])
      RPG::Cache.windowskin(@names[@index]).hue_change(@hue)
      @arrow.bitmap = RPG::Cache.windowskin(@names[@index])
      refresh
    end
  end
 
end

#=============================================================================
# ** Window_SkinBG
#=============================================================================

class Window_SkinBG < Window_Selectable
 
  def initialize
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width-32, height-32)
    @cursor_width = 64
    @index = 0
    draw_skin_bg
  end
 
  def draw_skin_bg
    self.contents.fill_rect(320-16-96-1, 220-16-64-1, 194, 130,
    Color.new(rand(256), rand(256), rand(256)))
    self.contents.fill_rect(320-16-96, 220-16-64, 192, 128,
    Color.new(rand(256), rand(256), rand(256)))
  end
 
  def update_cursor_rect
    super
    x = 320 - @cursor_width / 2 - 16
    self.cursor_rect.set(x, 96, @cursor_width, 32)
  end
 
  def refresh(str)
    x = 320 - @cursor_width / 2 - 16
    self.contents.fill_rect(x, 96, @cursor_width, 32, Color.new(0, 0, 0, 0))
    @cursor_width = self.contents.text_size(str).width + 16
    x = 320 - @cursor_width / 2 - 16
    self.contents.draw_text(x, 96, @cursor_width, 32, str, 1)
  end
 
  def update
    super
    if Input.repeat?(Input::X)
      draw_skin_bg
    end
  end
 
end

#=============================================================================
# ** Window_MessagePreview
#=============================================================================

class Window_MessagePreview < Window_Base
 
  def initialize
    super(80, 304, 480, 160)
    self.contents = Bitmap.new(480-32, 160-32)
    self.pause = true
    @blink = false
    @count = 0
    draw_stuff
  end
 
  def draw_stuff
    self.contents.clear
    self.contents.draw_text(0, 0, contents.width, 32, 'Left/Right: Change skin')
    self.contents.draw_text(0, 0, contents.width, 32, 'L/R: Change hue', 2)
    self.contents.draw_text(0, 32, contents.width, 32, 'C: Preview/set skin')
    self.contents.draw_text(0, 32, contents.width, 32, 'X: Change skin BG', 2)
    self.contents.draw_text(0, 64, contents.width, 32, 'A: Change message opacity')
  end
 
  def update
    super
    if @blink
      self.opacity += 8 unless self.opacity >= 255
    else
      self.opacity -= 8 unless self.opacity <= 196
    end
    if Input.trigger?(Input::A)
      @blink = !@blink
    end
  end
 
end

#=============================================================================
# ** Window_ContentsPreview
#=============================================================================

class Window_ContentsPreview < Window_Base
 
  def initialize
    super(16, 16, 160, 160)
    self.contents = Bitmap.new(160, 160)
    self.ox = self.oy = 8
    self.contents.font.size = 28
    self.contents.draw_text(0, 0, 160, 160, 'Text', 1)
    @count = 0
  end
 
end

#=============================================================================
# ** Sprite_BattleCursor
#=============================================================================

class Sprite_BattleCursorPreview < Sprite
 
  def initialize
    @blink_count = 0
    @battler = Sprite.new
    bname = $game_party.actors.size >= 1 ? $game_party.actors[0].battler_name : nil
    bhue = $game_party.actors.size >= 1 ? $game_party.actors[0].battler_hue : nil
    if bname == nil && bhue == nil
      b = Bitmap.new(96, 128)
      b.fill_rect(0, 0, 96, 128, Color.new(0, 0, 0))
      b.fill_rect(1, 1, 94, 126, Color.new(255, 255, 255))
      @battler.bitmap = b
    elsif bname != nil && bhue == nil
      @battler.bitmap = RPG::Cache.battler(bname)
    else
      @battler.bitmap = RPG::Cache.battler(bname, bhue)
    end
    @battler.ox = @battler.bitmap.width / 2
    @battler.oy = @battler.bitmap.height
    super
    self.bitmap = RPG::Cache.windowskin($game_system.windowskin_name)
    self.x, self.y = 512, 256
    self.ox, self.oy = 16, 64
    update
  end
 
  def update
    @blink_count = (@blink_count + 1) % 8
    x_off = @blink_count < 4 ? 128 : 160
    self.src_rect.set(x_off, 96, 32, 32)
  end
 
  def bitmap=(b)
    super(b)
    x_off = @blink_count < 4 ? 128 : 160
    self.src_rect.set(x_off, 96, 32, 32)
  end
 
  def x=(val)
    super(val)
    @battler.x = val if @battler
  end
 
  def y=(val)
    super(val)
    @battler.y = val if @battler
  end
 
  def z=(val)
    super(val)
    @battler.z = val-1 if @battler
  end
 
  def dispose
    super
    @battler.dispose
  end
 
end




6. Battle Phase Prompter

This is not much of a script, just a debug snippet I made to help me analyze the DBS easily. This script shows the phases during battles. Holding CTRL will pause the battle (displays a window).
Set "BATTLE_PHASE_CHECK" to "true" to enable it. Set it to "$DEBUG" to enable it only during debugging.

Battle Phase Prompter: ShowHide

#============================================================================
# ** Battle Phase Prompter
#----------------------------------------------------------------------------------------
# by Fantasist
# Version: 1.0
# Date: 8-Nov-2008
#----------------------------------------------------------------------------------------
# Version History:
#
#   1.0 - First Version
#----------------------------------------------------------------------------------------
# Description:
#
#     This script shows the phases during battles. Holding CTRL will pause
#   the battle (displays a window).
#----------------------------------------------------------------------------------------
# Compatibility:
#
#     Intended to work with the DBS, might not work with other CMSes,
#   but that's highly unlikely.
#----------------------------------------------------------------------------------------
# Instructions/Configuration:
#
#     Set the following to true or false:
#
      BATTLE_PHASE_CHECK = false
#----------------------------------------------------------------------------------------
# Issues: None.
#----------------------------------------------------------------------------------------
# Credits and Thanks: None needed for something as simple as this.
#----------------------------------------------------------------------------------------
# Notes: This can be pretty useless or useful. It was useful for me :)
#============================================================================

#=============================================================================
# ** Scene_Battle
#=============================================================================

class Scene_Battle
 
  alias bphasemain main
  def main
    @bphase = -1
    @bps = Sprite.new
    @bps.z = 9999
    @bps.y = 64
    b = Bitmap.new(640, 48)
    b.font.size = 32
    b.font.bold = true
    @bps.bitmap = b
    set_bps
    bphasemain
    @bphase = nil
    if @bps
      @bps.bitmap.dispose if @bps.bitmap
      @bps.dispose
    end
  end
 
  alias bphaseupd update
  def update
    if @bphase != @phase
      @bphase = @phase
      p "Phase #{@bphase}" if Input.press?(Input::CTRL)
      set_bps
    end
    if @bps.opacity > 160
      @bps.opacity -= 4
    end
    bphaseupd
  end
 
  def set_bps
    b = @bps.bitmap
    b.clear
    b.font.color = Color.new(0, 0, 0)
    b.draw_text(0, 0, 638, 46, "Phase #{@bphase}", 1)
    b.draw_text(0, 2, 638, 46, "Phase #{@bphase}", 1)
    b.draw_text(2, 0, 638, 46, "Phase #{@bphase}", 1)
    b.draw_text(2, 2, 638, 46, "Phase #{@bphase}", 1)
    b.font.color = Color.new(255, 255, 255)
    b.draw_text(1, 1, 638, 46, "Phase #{@bphase}", 1)
    @bps.opacity = 255
  end
 
end






That's all for now, folks! More will come as I find them. Hope you enjoy these as much as i did :)
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Ryex

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Fantasist

Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




LiTTleDRAgo

Quote from: Fantasist on January 14, 2011, 04:42:33 am
Thanks :) Tried anything yet?


I tried your enchanched equip scene

image: ShowHide


the actor sprite didn't fully appear, is that intended?

Fantasist

Yes, it is. Gives a portrait feel, I thought.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




LiTTleDRAgo

January 14, 2011, 08:13:42 am #5 Last Edit: January 14, 2011, 10:19:14 am by LiTTleDRAgo
I see, it's really cool

ah one more thing, can I ask example to use your ring command?
I trying to use it in my CMS and give me an error




edit : oh sorry, I didn't look properly that there are demo