Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Tankentai, landscape command window

Save-Point

Full Version: Tankentai, landscape command window
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I'm Mexican and my English isn´t very good, it's just that I have a question, I have the tankentai battle system, and seeing the script and achieve move the positions of some elements but I can´t move the commands of attack, defend, etc.
I would like someone could advise me how to do it.


here is a picture of how I would like the menu, thanks for reading


http://imageshack.us/photo/my-images/690...lo5qr.png/
Really? He moved the actor command window to the center??? Confused

Okay, look for a line in the script with this:
Code:
@actor_command_window.y
This controls the height of the window. Change it to something like this:
Code:
@actor_command_window.y =160
That should move the window down a bit for you. But that doesn't move it to the left or right. Adjust height according to preference.

Now do a search in the script for this:
Code:
@actor_command_window.x
That controls the left/right horizontal position and probably has a set numeric value which keeps it in the center.
Change that to this:
Code:
@actor_command_window.x = @actor_index * 160
This is actually the default code from the default battlesystem that moves the window to the actor in action. It's based on the notion of a 640 pixel width area divided by 4 actors (640/4 = 160)

As long as the @actor_index is the same value used in Tankentai's battlesystem, that should work.

BUT ... make a backup or copy of your project before performing any changes. Always a smart move.


The Dark Squid's 1st post, triggering registration (antispam) safeguard acceptance (24 hr delay). Estimated time to receive full 'registered' privileges... 7hrs 30mins from now. From then, full access to UserCP, PMs and etc.
forgive me if I did not explain well.
am, that's just a picture of how I would like it to be the command window, I couldn´t do that.
I did what you told me, but it only works with the menu vertically, well that was a result that gave me, thanks anyway, I appreciate it

if anyone knows Spanish, I'll explain easier down here:

la imagen de la izquierda es como tengo el menu actualmente y el de la derecha es como me gustaria que quedara, si fuera posible, eh intentado buscar la forma de moverlo pero no veo como, y lo que me dijo DerVVulfman solo cambio de posicion la ventana hacia la izquierda pero las opciones siguen estando en vertical, bueno espero me diera a entender un poco mas,

buen foro por cierto, saludos
(02-19-2013, 06:12 PM)The Dark Squid Wrote: [ -> ]if anyone knows Spanish, I'll explain easier down here:

la imagen de la izquierda es como tengo el menu actualmente y el de la derecha es como me gustaria que quedara, si fuera posible, eh intentado buscar la forma de moverlo pero no veo como, y lo que me dijo DerVVulfman solo cambio de posicion la ventana hacia la izquierda pero las opciones siguen estando en vertical, bueno espero me diera a entender un poco mas,

buen foro por cierto, saludos
The image on the left is how the menu looks right now and the one on the right is how I want it to be, if possible, but I can't work out how to make them take that shape. The way DerVVulfman said moves the window around but not the options, they stay vertical.
You need to make a new Window class. I'd tell you to use the help reference but if your English isn't very good that won't help much.

Add this script before Main;

Code:
# ** Window_Battle_Command
#------------------------------------------------------------------------------
#  This window is used to select a command on the battle
#  screen.
#==============================================================================

class Window_Battle_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor   :commands                     #list of commands
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(commands)
    super(0, 0, 480, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 160
    @commands = commands
    @item_max = commands.size
    @column_max = commands.size
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #     color : text character color
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(index*((width-40)/@commands.size), 2, 120, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    self.cursor_rect.set(index*((width-40)/@commands.size), 0, 128, 32)
  end
end

then, change
Code:
@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
to
Code:
@actor_command_window = Window_Battle_Command.new([s1, s2, s3, s4])
solved, thanks MechanicalPen xd

-------------------------------------------------------------------------------------------------------
I made the changes but didn´t work, i send you a pm... thanks
For anyone who may use this system in the future, here is the solution I sent The Dark Squid;

I am sorry! I did not know you were using "Individual Battle Commands" script.
Few more changes;
replace Window_Battle_Command with
Code:
# ** Window_Battle_Command
#------------------------------------------------------------------------------
#  This window is used to select a command on the battle
#  screen.
#==============================================================================

class Window_Battle_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor   :commands                     #list of commands
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(commands, battler = nil)
    super(0, 0, 480, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 160
    @commands = commands
    @item_max = commands.size
    @column_max = commands.size
    @battler = battler
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      if $scene.is_a?(Scene_Battle) and @battler != nil and
         Usable_Command.include?(@commands[i]) and not
         @battler.skill_can_use?(Usable_Command[@commands[i]])
        draw_item(i, disabled_color)
      elsif $scene.is_a?(Scene_Battle) and @commands[i] == $scene.escape_name and
         $game_temp.battle_can_escape == false
        draw_item(i, disabled_color)
      else
        draw_item(i, normal_color)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #     color : text character color
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(index*((width-40)/@commands.size), 2, ((width-40)/@commands.size), 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    self.cursor_rect.set(index*((width-40)/@commands.size), 0, ((width-40)/@commands.size), 32)
  end
end

then find
Code:
@actor_command_window = Window_Command.new(160, @individual_commands, @active_battler)
replace with
Code:
@actor_command_window = Window_Battle_Command.new(@individual_commands, @active_battler)

But the windows are still in wrong place! So;

find
Code:
COMMAND_WINDOW_POSITION = [240, 160]
replace with
Code:
COMMAND_WINDOW_POSITION = [160, 275]

find
Code:
    @active_battler_window.x = COMMAND_WINDOW_POSITION[0]
    @active_battler_window.y = COMMAND_WINDOW_POSITION[1] + 56 - 24 * comand_size

replace with
Code:
    @active_battler_window.x = 0
    @active_battler_window.y = COMMAND_WINDOW_POSITION[1]+ 120 - 24 * comand_size