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.

Need help with Window_MenuStatus

Twirly

Sponsor

I'm starting with scripting and costumized the menu a bit.
This what it looks like:
http://img29.picoodle.com/img/img29/3/8/5/t_lollolololm_320acd5.png[/img]
My question is: how can i make three other boxes which only show up when the other chars are in the party?
Heres my edit of Window_MenuStatus:
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     x : window X coordinate
  #     y : window Y coordinate
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 282, 122)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
     draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
      x = 104
      y = actor.index * 96 + WLH / 2
      draw_actor_name(actor, x + 20, y)
      draw_actor_state(actor, x, y + WLH * 2)
      draw_actor_hp(actor, x + 20, y + WLH * 1)
      draw_actor_mp(actor, x + 20, y + WLH * 2)
    end
  end
  #--------------------------------------------------------------------------
  # * Update cursor
  #--------------------------------------------------------------------------
  def update_cursor
    if @index < 0               # No cursor
      self.cursor_rect.empty
    elsif @index < @item_max    # Normal
      self.cursor_rect.set(0, @index * 96, contents.width, 96)
    elsif @index >= 100         # Self
      self.cursor_rect.set(0, (@index - 100) * 96, contents.width, 96)
    else                        # All
      self.cursor_rect.set(0, 0, contents.width, @item_max * 96)
    end
  end
end
EDIT:
WHoops forgot to add the picture, sorry...
EDIT: FIXED.
 
Hello indian giver. :smile:

You want to have four different windows displaying each character in your party, but you only want to show the window(s) if the character(s) is/are currently in the party right?

Window1: showing first party member
Window2: showing second party member
etc...

Then you have to create 4 different windows displaying one of the characters and assign them to 4 different Instance variables just like your original Window_MenuStatus in the Scene_Menu script:
Code:
@status_window = Window_MenuStatus.new(160, 0)

You should then make all of your windows invisible. So let's say your Scene_Menu looks something like this:
Code:
@status_window = Window_MenuStatus.new(160, 0)
@status_window.visible = false

@status_window_two = Window_MenuStatus.new(160, 122)
@status_window_two.visible = false

@status_window_three = Window_MenuStatus.new(160, 244)
@status_window_three.visible = false

@status_window_four = Window_MenuStatus.new(160, 366)
@status_window_four.visible = false

Then in the start method in Scene_Menu you can check if there are 1, 2, 3 or 4 party members using a case statement, and then make the windows visible based on how many party members there are in the party, like this:
Code:
    case $game_party.members.size
    when 1
      @status_window.visible = true
    when 2
      @status_window.visible = true
      @status_window_two.visible = true
    when 3
      @status_window.visible = true
      @status_window_two.visible = true
      @status_window_three.visible = true
    when 4
      @status_window.visible = true
      @status_window_two.visible = true
      @status_window_three.visible = true
      @status_window_four.visible = true
    end


I'm sorry for not explaining very well, but it's kinda late here where i live right now and i'm kinda tired and i'm gonna go sleep now. :tongue2:
If you don't understand what i mean, or if you need any further help i can try to explain better tomorrow when i wake up, or maybe someone else sees this they might help you out instead. Well anyways, good luck :thumb:

Over and out - Gando
 

Twirly

Sponsor

Thank you Gando that's what i needed!
I'll be releasing a new menu should i 'credit' you or something like that?
Edit:
I got an error  :cry: It says something is wrong about members and nil class.
I can't seem to upload a screenshot of it...
 

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