Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Attack, Skill, Defend, Item All in One Row

Is there a way to put the battle command selections Attack, Skill, Defend, Item all in one row and in the same location as the default Fight, Escape selections?
So instead of:

Attack
Skill
Defend
Item

It would be:

Attack Skill Defend Item

Thanks for any insight.
 
Well I figured out how to get the window the way I wanted it (after lots of code_hunting :) )
I will provide what I did just in case someone else wants the same setup.


Code:
I first created this script and put it below the other Window_Command scripts:

 

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

# ** Window_Command3

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

#  This window creates a horizontal battle selection screen

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

 

class Window_Command3 < Window_Selectable

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

  # * Object Initialization

  #     width    : window width

  #     commands : command text string array

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

   def initialize

    super(0, 0, 640, 64)

    self.contents = Bitmap.new(width - 32, height - 32)

    self.contents.font.name = ["Arial Black", "Arial"]

    @item_max = 4

    @column_max = 4

    @commands = ["Attack  ", "Skill  ", "Defend  ", "Item  "]

    refresh

    self.index = 0

  end

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

  # * Refresh

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

  def refresh

    self.contents.clear

    for i in 0...@item_max

      draw_item(i)

    end

  end

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

  # * Draw Item

  #     index : item number

  #     color : text color

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

  

   def draw_item(index)

    x = 4 + index * 160

    self.contents.draw_text(x, 0, 128, 32, @commands[index],1)

  end

 

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

  # * Disable Item

  #     index : item number

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

  def disable_item(index)

    draw_item(index, disabled_color)

  end

end

 

Then I changed Scene_Battle 1 line 30 and 31 to:

 

  @actor_command_window = Window_Command3.new

  @actor_command_window.y = 0

 

And then deleted lines 26,27,28,29 (I don't think you have to do this, but I did)

 

 

Finally, in Scene_Battle 3 I changed line 81 to:

 

 @actor_command_window.x = 0

I have not playtested this in all conditions. just an fyi. So if anyone with more scripting experience would like to look over the code for anything that stands out as problematic that would be great.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top