Battle Skill Command Size Changing

So recently I've tried to expand the battle menu for skills so it displays more than four choices.

qVX9fTc.png


This is what I got when I tried to expand the window height, but it's... uh... just kinda stuck like that? Ideally I would want it to be more like this:

PcbQ34O.png


... With the size of the window adjusting itself based on how many commands are there. (Bonus consideration: I use Himeworks Command Manager, so I often have commands on characters that are just direct skills or items.)

Is there a cleaner way to make this possible?
The game already did exactly what you asked it to do – it increased the height of the window. But that's not quite what you wanted it to do. If you make the window taller when it's already touching the bottom of the screen, then of course it'll go off the bottom of the screen. Windows are positioned by their top left corner.

In summary: you need to change not just the size but also the position. Move the Y coordinate up lineHeight() * 4 or so and you should get pretty close to your desired result.
of course it'll go off the bottom of the screen. Windows are positioned by their top left corner.

Wasn't exactly confused by why it was happening, just that it was annoying.

That said, the only thing I genuinely don't know is how to control the Y aspect of the window. Never had to do this kind of thing before. This is the code I'm working with, for reference:

Ruby:
class Window_ActorCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
    self.openness = 0
    deactivate
    @actor = nil
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return 128
  end
 
  def window_height
    return 200
  end
 
  #--------------------------------------------------------------------------
  # * Get Number of Lines to Show
  #--------------------------------------------------------------------------
  def visible_line_number
    return 4
  end
end

It's a modified version of Actor Command that I copy-pasted down the script list. (The original is untouched.)
wrong place to go - these just return the window sizes, but not the position.

you need to find the code that calls and uses those definitions.
when you find that code, you'll see that it uses not only the width but also gives a starting position, and that position you'll need to change.

unfortunately unless you want it to be a fixed different position, that will be a lot more complex to do for a dynamically adjusting position.

If you want a dynamic adjustment, you'll have to count how many lines the window will have, and reduce the y coordinate by a number of pixels for each line entry.
here's a similar post with resizing the window.
Although this just sets the status window to a smaller size, you can see how it adjusts the y position.
You could use something like this to set the position or the windows, then adjust the actor command for how many commands are shown.
e.g.
max actor commands is 8. set actor command position for 8 commands and use the code in the link to adjust the info window. Then when pulling in the actor command adjust the y for it based on number of commands present actor only has 5 commands 8-5 = 3. move actor command down 3 * 24.

And you should control the actor command where it gets created, not in the window.
Take in consideration that those windows are attached to a viewport, meaning they are not supposed to get any taller than they are now. Otherwise they would get cut off...
Right. Thanks @Roninator2 @kyonides @Andar for your advice. I managed to tweak it to work the way I wanted, barring a few things.

LduBN3q.png


Skill and Item menus are stretched out like this, which is a bit of a problem since it cuts into the enemy sprites. Is there a way to give these their own rect heights so they don't do this?

(For reference, roninator, I used the script you gave that guy in the link you provided.)

... Also is there a way to track command slots so the command window changes its size based on the amount of commands an actor can use?
So, when you adjusted the info_window viewport, you made the size to what you see for the skill and item windows. When you look at where they get created in battle, you can see how it passes in the viewport dimension (@info_viewport).
The window height is then using the values to adjust the height.
You could simple adjust this.
Ruby:
class Window_BattleItem < Window_ItemList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     info_viewport : Viewport for displaying information
  #--------------------------------------------------------------------------
  def initialize(help_window, info_viewport)
    y = help_window.height
    super(0, y, Graphics.width, fitting_height(4)) # I changed this
    self.visible = false
    @help_window = help_window
    @info_viewport = info_viewport
  end
end
untested
So, when you adjusted the info_window viewport, you made the size to what you see for the skill and item windows. When you look at where they get created in battle, you can see how it passes in the viewport dimension (@info_viewport).
The window height is then using the values to adjust the height.
You could simple adjust this.
Ruby:
class Window_BattleItem < Window_ItemList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     info_viewport : Viewport for displaying information
  #--------------------------------------------------------------------------
  def initialize(help_window, info_viewport)
    y = help_window.height
    super(0, y, Graphics.width, fitting_height(4)) # I changed this
    self.visible = false
    @help_window = help_window
    @info_viewport = info_viewport
  end
end
untested

It doesn't seem to do anything. I plugged it in and the skill/item window stayed the same.
Right I just clued in. You have something else that is making the skill window. Whatever script that is will have different numbers to adjust.
I remembered that the skill window is normally the full screen, but yours is not so I need to know what is adjusting the skill window.
Right I just clued in. You have something else that is making the skill window. Whatever script that is will have different numbers to adjust.
I remembered that the skill window is normally the full screen, but yours is not so I need to know what is adjusting the skill window.

Ruby:
    @info_viewport.rect.y = Graphics.height - 35 * 5
    @info_viewport.rect.height = 35 * 5

It's this snippet I took from your script from the other thread. When I change the rect here, it changes the size of the skill/item menu too.
right and that makes the entire window area to that size. Now you need to adjust the window y position.
In my other post I quoted @status_window.y = 24 * 3
So if you do the same for the skill and item windows for where they are created, then it will lower the window.

Original thread: https://forums.rpgmakerweb.com/threads/battle-skill-command-size-changing.145934/