The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX Ace => VXA Scripts Database => Topic started by: SoulPour777 on February 14, 2014, 09:18:36 PM

Title: Soul Engine Ace – Enhanced Battle Commands (Hud + Graphics)
Post by: SoulPour777 on February 14, 2014, 09:18:36 PM
Soul Engine Ace – Enhanced Battle Commands
Version: Version 1
Author: Soulpour777
Date: Feb. 15, 2014


Description


Creates transparent windows for all Battle Commands and uses pictures as background. The battle hud is also created to enhance battle visibility for the game.

Features


Screenshots

See the script in action here:

http://www.youtube.com/watch?feature=player_embedded&v=lQCJ-yYMiKw

Instructions

Place the script below Materials above Main.
If you are using Soulpour777?s Battle Cursor, Place this script first. This script should be above SEA – Battle Cursor.
Place all the required images on the Systems folder.

Script


Code: [Select]
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Soul Engine Ace - Enhanced Battle Commands
# Author: Soulpour777
# Version 1.0
# Description: Creates transparent windows for all Battle Commands and uses
# pictures as background. The battle hud is also created to enhance battle
# visibility for the game.
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Features:
#~ 1. Enhanced Battle Messaging
#~ 2. Enhanced Window ActorCommand
#~ 3. Enhanced Window PartyCommand
#~ 4. Enhanced Window Battle, Skill, Enemy, Actor and Help
#~ 5. Enhanced BattleManager Victory Processing
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Terms of Use:
# ALL SEA Scripts are bound to my terms of use. The script can not be used
# for commercial projects without author's license.
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#~ For Commercial Use:
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#~ The script license is required to use the script commercially. This license means that I (SoulPour777) acknowledge the user on using my scripts in your project. This script license is issued per script use or per project. If the script is to be used on multiple projects, the user must pay for them separately.
#~ Updates or Bug Fixes are accepted. These updates or bug fixes are also charged.
#~ Credit SoulPour777 for the script on your project.
#~ Preserve the Script Headers and Notes.
#~ Requested Scripts has a higher price that the scripts that are already available on my website.
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#~ For Non-Commercial Use:
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#~ You are free to use the script on any non-commercial projects.
#~ You are free to adapt the script. Any modifications are allowed as long as it is provided as a note on the script.
#~ Credits to SoulPour777 for the script.
#~ Preserve the Script Header.
#~ Claiming the script as your own is prohibited.
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

#==============================================================================
# ** BattleManager
#------------------------------------------------------------------------------
#  This module manages battle progress.
#==============================================================================
module BattleManager
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Reposition Message
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def self.battle_start
    $game_system.battle_count += 1
    $game_party.on_battle_start
    $game_troop.on_battle_start
    $game_troop.enemy_names.each do |name|
      create_victory_image
         $game_message.background = 2
        $game_message.position = 0
      $game_message.add(sprintf("\n" + Vocab::Emerge, name))
    end
    if @preemptive
      $game_message.add(sprintf("\n" + Vocab::Preemptive, $game_party.name))
    elsif @surprise
      $game_message.add(sprintf("\n" + Vocab::Surprise, $game_party.name))
    end
    wait_for_message
    dispose_victory_image
  end 
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Upgraded Process Victory Message
  # Added: Image Based Battle Message
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def self.process_victory
    play_battle_end_me
    replay_bgm_and_bgs
    $game_message.background = 2
    $game_message.position = 0
    $game_message.add("\n" + sprintf(Vocab::Victory, $game_party.name))
    create_victory_image
    display_exp
    gain_gold
    gain_drop_items
    gain_exp
    SceneManager.return
    dispose_victory_image
    dispose_background_status
    battle_end(0)
    return true
  end 
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Create Victory Image
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def self.create_victory_image
      @victory_message = Sprite.new
      @victory_message.bitmap = Cache.system("battle_victory_message")
      @victory_message.x = 0
      @victory_message.y = 0
      @victory_message.opacity = 255
  end
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Dispose Victory Image
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def self.dispose_victory_image
    @victory_message.bitmap.dispose
    @victory_message.dispose
  end
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Create Background Status
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def self.create_background_status
    @sprite = Sprite.new
    @sprite.bitmap = Cache.system("status_command")
    @sprite.x = 0
    @sprite.y = 300
  end 
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Dispose Background Status
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def self.dispose_background_status
    @sprite.bitmap.dispose
    @sprite.dispose
  end
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Create Item
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def self.create_battle_item
    @battle_item = Sprite.new
    @battle_item.bitmap = Cache.system("Battle_ItemSelectActor")
  end
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Dispose Battle Item
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def self.dispose_battle_item
    @battle_item.bitmap.dispose
    @battle_item.dispose
  end
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Create Enemy Command
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def self.create_battle_enemy
    @battle_enemy = Sprite.new
    @battle_enemy.bitmap = Cache.system("Battle_ItemSelectEnemy")
  end
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Dispose Enemy Command
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def self.dispose_battle_enemy
    @battle_enemy.bitmap.dispose
    @battle_enemy.dispose
  end
 
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Display Experience
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def self.display_exp
    if $game_troop.exp_total > 0
      text = sprintf(Vocab::ObtainExp, $game_troop.exp_total)
      $game_message.background = 2
      $game_message.position = 0     
      $game_message.add('\.' + text)
    end
  end
  #--------------------------------------------------------------------------
  # * Gold Acquisition and Display
  #--------------------------------------------------------------------------
  def self.gain_gold
    if $game_troop.gold_total > 0
      text = sprintf(Vocab::ObtainGold, $game_troop.gold_total)
      $game_message.background = 2
      $game_message.position = 0   
      $game_message.add('\.' + text)
      $game_party.gain_gold($game_troop.gold_total)
    end
    wait_for_message
  end
  #--------------------------------------------------------------------------
  # * Dropped Item Acquisition and Display
  #--------------------------------------------------------------------------
  def self.gain_drop_items
    $game_troop.make_drop_items.each do |item|
      $game_party.gain_item(item, 1)
      $game_message.add(sprintf("\n" + Vocab::ObtainItem, item.name))
      $game_message.background = 2
      $game_message.position = 0
    end
    wait_for_message
  end

end

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# BattleCommand
# ----------------------------------------------------------------------------
# This module holds values for all transparency of the Window Commands
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
module BattleCommand
    STATUS_OPACITY = 0
    INDEX_VALUE = 96
    ITEM_WIDTH = 96
    ITEM_RECT_Y = 0
    PARTY_COMMAND_OPACITY = 0
    ACTOR_COMMAND_OPACITY = 0
end

#==============================================================================
# ** Window_BattleActor
#------------------------------------------------------------------------------
#  This window is for selecting an actor's action target on the battle screen.
#==============================================================================
class Window_BattleActor < Window_BattleStatus
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     info_viewport : Viewport for displaying information
  #--------------------------------------------------------------------------
  alias battle_actor_initialize initialize
  alias battle_actor_hide hide
 
  def initialize(info_viewport)
    battle_actor_initialize(info_viewport)
    self.opacity = 0
  end

  #--------------------------------------------------------------------------
  # * Show Window
  #--------------------------------------------------------------------------
  def show
    if @info_viewport
      BattleManager.create_battle_item
      width_remain = Graphics.width - width
      self.x = width_remain
      @info_viewport.rect.width = width_remain
      select(0)
    end
    super
  end
 
  #--------------------------------------------------------------------------
  # * Hide Window
  #--------------------------------------------------------------------------
  def hide
    battle_actor_hide()
    BattleManager.dispose_battle_item
  end 
 
end

#==============================================================================
# ** Window_BattleEnemy
#------------------------------------------------------------------------------
#  Window for selecting the enemy who is the action target on the battle
# screen.
#==============================================================================
class Window_BattleEnemy < Window_Selectable
 
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     info_viewport : Viewport for displaying information
  #--------------------------------------------------------------------------
  # Alias Listings
  #--------------------------------------------------------------------------
  alias battle_skill_hide hide 
  alias battle_enemy_initialize initialize
  #--------------------------------------------------------------------------
 
  def initialize(info_viewport)
    battle_enemy_initialize(info_viewport)
    self.opacity = 0
  end
 
  #--------------------------------------------------------------------------
  # * Show Window
  #--------------------------------------------------------------------------
  def show
    if @info_viewport
      BattleManager.create_battle_enemy
      width_remain = Graphics.width - width
      self.x = width_remain
      @info_viewport.rect.width = width_remain
      select(0)
    end
    super
  end
 
  #--------------------------------------------------------------------------
  # * Hide Window
  #--------------------------------------------------------------------------
  def hide
    battle_skill_hide()
    BattleManager.dispose_battle_enemy
  end 
 
end

#==============================================================================
# ** Window_BattleSkill
#------------------------------------------------------------------------------
#  This window is for selecting skills to use in the battle window.
#==============================================================================
class Window_BattleSkill < Window_SkillList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     info_viewport : Viewport for displaying information
  #--------------------------------------------------------------------------
  alias battle_skill_initialize initialize
  def initialize(help_window, info_viewport)
    battle_skill_initialize(help_window, info_viewport)
    self.opacity = 0
  end
 
  #--------------------------------------------------------------------------
  # * Show Window
  #--------------------------------------------------------------------------
  def show
    select_last
    @help_window.show
    super
  end
  #--------------------------------------------------------------------------
  # * Hide Window
  #--------------------------------------------------------------------------
  def hide
    @help_window.hide
    super
  end 
 
end

#==============================================================================
# ** Window_BattleItem
#------------------------------------------------------------------------------
#  This window is for selecting items to use in the battle window.
#==============================================================================
class Window_BattleItem < Window_ItemList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     info_viewport : Viewport for displaying information
  #--------------------------------------------------------------------------
  alias battle_item_initialize initialize
  def initialize(help_window, info_viewport)
    battle_item_initialize(help_window, info_viewport)
    self.opacity = 0
  end
end

#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
#  This window is for displaying the status of party members on the battle
# screen.
#==============================================================================
class Window_BattleStatus < Window_Selectable
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Alias Listings (initialize)
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  alias battle_status_init initialize
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # This is where the Battle Hud is created
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Initialize
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def initialize
    battle_status_init()
    self.opacity = BattleCommand::STATUS_OPACITY
    BattleManager.create_background_status
  end

  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Item Rect
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def item_rect(index)
    rect = Rect.new(0, 0, 0, 0)
    rect.width = BattleCommand::ITEM_WIDTH
    rect.height = self.contents.height
    rect.x = index * BattleCommand::INDEX_VALUE
    rect.y = BattleCommand::ITEM_RECT_Y
    return rect
  end
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Cursor Right
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def cursor_right(wrap = false)
    cursor_down(wrap)
  end
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Cursor Left
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def cursor_left(wrap = false)
    cursor_up(wrap)
  end
 
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  # Draw Item
  # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    actor = $game_party.members[index]
    draw_actor_face(actor, rect.x, 0)
    draw_actor_name(actor, rect.x, 0)
    draw_actor_icons(actor, rect.x, 24, 48)
    draw_actor_hp(actor, rect.x, 54, 94)
    draw_actor_mp(actor, rect.x, 74, 94)
  end
end

#==============================================================================
# ** Window_PartyCommand
#------------------------------------------------------------------------------
#  This window is used to select whether to fight or escape on the battle
# screen.
#==============================================================================
class Window_PartyCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias party_command_initialize initialize
  def initialize
    party_command_initialize()
    self.opacity = BattleCommand::PARTY_COMMAND_OPACITY
  end
end

#==============================================================================
# ** Window_ActorCommand
#------------------------------------------------------------------------------
#  This window is for selecting an actor's action on the battle screen.
#==============================================================================
class Window_ActorCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias actor_command_initialize initialize
  def initialize
    actor_command_initialize()
    self.opacity = BattleCommand::ACTOR_COMMAND_OPACITY
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================
class Scene_Battle < Scene_Base
  alias scene_battle_start start
  def start
    scene_battle_start()
    @help_window.opacity = 0
    @help_window.y = 37
  end   
end


You will also need this image as requirements, place them under the Systems Folder:

(https://rmrk.net/proxy.php?request=http%3A%2F%2Finfinitytears.files.wordpress.com%2F2014%2F02%2Fbattle_itemselectactor.png%3Fw%3D584%26amp%3Bh%3D438&hash=ed2bb8efc1752a00af3dba9280d26b9b4bd0de4d)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Finfinitytears.files.wordpress.com%2F2014%2F02%2Fbattle_itemselectenemy.png%3Fw%3D584%26amp%3Bh%3D438&hash=1584c65c3577dd9c37816eb221066729f2b2b514)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Finfinitytears.files.wordpress.com%2F2014%2F02%2Fbattle_victory_message.png%3Fw%3D584&hash=f2db7d2947d6ec20fc1c53039081aa579817e78e)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Finfinitytears.files.wordpress.com%2F2014%2F02%2Fstatus_command.png%3Fw%3D584&hash=65093b85e6154a81cec87e166bff53ee4748a3e7)

Credit



Support


If you have any questions, comments, critiques, corrections or any other concern about the script, please do contact me here on RMRK, comment below or mail me in my website.

Known Compatibility Issues

- N/A

Terms of Use


All my scripts are bound under my terms of use. If any terms on RMRK does not contradict my terms, please add those.
Title: Re: Soul Engine Ace – Enhanced Battle Commands (Hud + Graphics)
Post by: ShinGamix on March 08, 2014, 02:42:38 AM
Bug Issues

I can't move between my allies using this script when trying to use heal or a buff on the party.
Title: Re: Soul Engine Ace – Enhanced Battle Commands (Hud + Graphics)
Post by: ShinGamix on March 15, 2014, 05:31:06 PM
Wanted to bump and say I still haven't fixed that issue.
Title: Re: Soul Engine Ace – Enhanced Battle Commands (Hud + Graphics)
Post by: thechancellor on March 28, 2014, 09:48:44 PM
This is a compatibility issue. That might be why he's not replying. If you watch his video, he's selecting allies just fine. I tried it with minimal scripts and it works for me.
Title: Re: Soul Engine Ace – Enhanced Battle Commands (Hud + Graphics)
Post by: SoulPour777 on March 29, 2014, 12:31:54 PM
The script does not have any bug, as it does not contain anything that deals with altering battle skills nor any of that kind. As you can see, I just removed all the opacity of each window and added those images to suit a yet better display of commands. :)