Script Edit VX Ace

Hi!

I wanted to ask for a script edit.
I am using Tsukihime's large choices, and thanks to my portrait system I can have choices show up in the textbox instead, like so:


However, when I have more than 4 choices they drop out of the textbox. I was wondering if it was possible to makes them show up as columns instead? e.g.
choice1 choice5
choice2 choice6
choice3 choice7
choice4 choice8

But only if say, switch6: choicerows = on. Else, no rows.
Is something like that possible?

The script can be found here:
It's hard to say without seeing the other script you're using for the portraits (since it most likely changes the position of the choice window). You could give this a try:
Ruby:
class Window_ChoiceList < Window_Command
  COLUMN_VARIABLE = 13 # the ID of whatever variable you want to use
  
  def col_max
    [$game_variables[COLUMN_VARIABLE], 1].max
  end
 
  alias amn_choices_windchoicelist_updateplacement  update_placement
  def update_placement
    amn_choices_windchoicelist_updateplacement
    dw = (max_choice_width * 2) + spacing
    self.width = [dw + 12, 96].max + padding * 2
    self.width = [width, Graphics.width].min
    rm = [($game_message.choices.size + col_max - 1) / col_max, 1].max
    self.height = fitting_height(rm)
# this stuff below may interfere with your existing script
    self.x = Graphics.width - width
    if @message_window.y >= Graphics.height / 2
      self.y = @message_window.y - height
    else
      self.y = @message_window.y + @message_window.height
    end
  end

  def contents_height
    super
  end
 
end

That should make it so that you can dynamically change the amount of columns; just change it before you call the choices.
It works! Made some edits. Do need to make some texts smaller. I did notice it gets cut off at the right, any way to solve that?

9de84025717e80df13bdbfaa8cea1bb3.png
Limit to 3 columns? looks like you have 4. But I think I remember @A-Moonless-Night fixing this kind of thing before. Don't remember how, but it was with the text width.

I also did this for a member with yanfly subclass/jp script. Basically set the text size and cut off the rest if it is too long. Not sure where to do this for your choice menu though.
Code:
    if R2_subclass_battle_jp::Cut_text
      text = actor.class.name
      text = text[0..(R2_subclass_battle_jp::Name_length - 1)]
      draw_text(dx, dy, dw, line_height, text, 3)
    else
      draw_text(dx, dy, dw, line_height, actor.class.name, 3)
    end
Yeah, I tried it with 4 because I have a tutorial book that has 4 columns.
I am not sure how to utilize your code. I'd rather not want it to cut off, you see.
It'll be because the text is too long for the cell, which it calculates from the amount of columns, so you can either reduce the columns or you can change the size of the text if it's too big with this snippet:
Ruby:
class Window_ChoiceList < Window_Command
 
  def reset_font_settings
    change_color(normal_color)
    contents.font.bold = Font.default_bold
    contents.font.italic = Font.default_italic
  end
 
  alias amn_choices_windchoicelist_drawtextex draw_text_ex
  def draw_text_ex(x, y, text)
    amn_choices_windchoicelist_drawtextex(x, y, text)
    contents.font.size = Font.default_size
  end
 
  alias amn_choices_windchoicelist_drawitem draw_item
  def draw_item(index)
    rect = item_rect_for_text(index)
    text = command_name(index)
    until text_size(text).width <= rect.width
      contents.font.size -= 1
    end
    amn_choices_windchoicelist_drawitem(index)
  end
 
end
Thanks! 😀

Original thread: https://forums.rpgmakerweb.com/threads/script-edit-vx-ace.121423/