(XP) how to change Actor window battle command?

kaigames

Veteran
Veteran
Joined
Feb 8, 2019
Messages
38
Reaction score
4
First Language
Portuguese.BR
Primarily Uses
RMXP
hello, currently the standard rmxp battle system has this window:



I'm trying to modify it to my liking but as I do not understand
nothing about scripts, I'm having problems

I'm trying something like this: (ps: merely illustrative images XD)



if anyone knows how to edit this part, could you teach me?. sorry for my English
.desde já agradeço
 
Last edited:

DerVVulfman

Resident Werewolf
Veteran
Joined
Jun 26, 2012
Messages
315
Reaction score
155
First Language
English
Primarily Uses
RMXP
Years ago, a team of scripters worked upon a package they dubbed the RMXP.SDK. It was an attempt to encourage better coding techniques which could let scripts run together with less conflicts while rewriting the underlying system. It was a massive undertaking, inspired, but doomed as it only spread through the western world and it wasn't spread throughout all the forums. At the same time, they continually updated it so older 'compatible' scripts would not work with newer versions. I would love to point out that the RMXP SDK's 'Scene_Base' method existed roughly a year before RPGMaker VX's own 'Scene_Base'... rip off!!!!

Now that the history lesson is over, now for the content.

Below is a script from the RPGMaker SDK Version 2.4. It is a separate class that handles Horizontal command windows such as the one you wish to use:
Code:
#==============================================================================
# ** Window_HorizCommand
#------------------------------------------------------------------------------
#  This window deals with general command choices. (Horizontal)
#==============================================================================

class Window_HorizCommand < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :commands
  attr_accessor :c_spacing
  attr_accessor :alignment
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(width, commands, c_spacing = (width - 32) / commands.size)
    # Compute window height from command quantity
    super(0, 0, width, 64)
    @commands     = commands
    @item_max     = commands.size
    @column_max   = @item_max
    @c_spacing    = c_spacing
    @alignment    = 1
    self.contents = Bitmap.new(@item_max * @c_spacing, height - 32)
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Command
  #--------------------------------------------------------------------------
  def command(index = self.index)
    return @commands[index]
  end
  #--------------------------------------------------------------------------
  # * Commands
  #--------------------------------------------------------------------------
  def commands=(commands)
    # Return if Commands Are Same
    return if @commands == commands
    # Reset Commands
    @commands = commands
    # Resets Item Max
    item_max    = @item_max
    @item_max   = @commands.size
    @column_max = @item_max
    # If Item Max Changes
    unless item_max == @item_max
      # Deletes Existing Contents (If Exist)
      unless self.contents.nil?
        self.contents.dispose
        self.contents = nil
      end
      # Recreates Contents
    self.contents = Bitmap.new(@item_max * @c_spacing, height - 32)
    end
    # Refresh Window
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    command = commands[index]
    x = index * @c_spacing + 4
    self.contents.font.color = color
    self.contents.draw_text(x, 0, @c_spacing - 8, 32, command, @alignment)
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(@c_spacing * @index, 0, @c_spacing, 32)
    end
  end
end
Now, the normal script to create a command window is typically:
@command_window = Window_Command.new( window_width, [array of commands] )

For example, the Title window would have thus:
@command_window = Window_Command.new(192, [s1, s2, s3])

But the new script to create a horizontal command window is this:
@command_window = Window_Command.new( window_width, [array of commands], command_width )
* The window width would be the value of the 'command_width' multiplied by the total number of commands, and with a '32' margin added.

For example, a Title window with a Horizontal command window would use this:
@command_window = Window_Command.new(512, [s1, s2, s3], 160)
The 160 at the end indicates that each command_width option is 160px wide.
As I have three options, the window_width is each 160px width X 3.... plus the 32px margin, or
( 160 x 3 ) + 32 .... or 512.

So now you have this script to give you a Horizontal Command window, and a basic primer to use it. ^_^
 

kaigames

Veteran
Veteran
Joined
Feb 8, 2019
Messages
38
Reaction score
4
First Language
Portuguese.BR
Primarily Uses
RMXP
I LOVE THIS FORUM THANK YOU :D
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,454
Members
137,821
Latest member
Capterson
Top