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.

Newbie window question

Drykul

Member

Ok, just to start off, I've used RPG Maker since 95 was new. I've taken big breaks here and there. When XP came out, I started learning how to use RGSS, but didn't get too far before I gave up. Now I'm having a go with VX and hoping I'll last longer. So far, so good. First of all, I know what variables, arrays, hashes, methods, classes, etc all are and what they do. But I'm having some other newbie problems that I feel stupid that I can't figure out on my own.

For one, I remember XP having a script call function in the events where all you had to do was put in the class, with VX it doesn't seem to work the same. For instance, I was reading an old RGSS tutorial and the basis was this:
Code:
class Say_something

  def initialize
     print "Say Something"
  end

end

Pretty simple, but I loaded up an event with the call script of Say_something.new, and it didn't work. I'm sure someone call tell me what I'm doing wrong.

Secondly, One thing I'm trying to do is create two seperate windows at the same time. The bottom window has different options to select and the top window displays info about the selected item. A couple of questions about that.

For the life of me, I can't figure out why I'm getting a "ArgumentError occurred while running script. wrong number of arguments(0 for 4)wth this:
***EDIT***
Ok, I figured out how to get both windows up at the same time in the right places. They both come up at the same time, like expected, but after a couple of seconds, the top window just disappears. ?? I've got both windows in seperate classes being called seperatly by an event. Is that not the proper way of doing it?
***END EDIT***
Code:
class Windows < Window_Base

   #Top window with description
   def top_win
      super(0, 0, 544, 312)
      self.contents = Bitmap.new(width - 32, height - 32)
   end

   #Bottom selectable window
   def bot_win
      super(0, 313, 544, 104)
      self.contents = Bitmap.new(width - 32, height - 32)
   end

end

And also, how do I go about pausing the game in the background while my window is up?
 

Drykul

Member

Ok, I've sifted through tons of different scripts and tried editing out parts that I didn't think were relevant to what I was trying to do, and it's just not working. The code is too big and it's not all described, so I'm not really sure what I'm supposed to keep in it to just keep the simple menu system part of the script running... I need a good example. The selectable window I want to just have simple text that I can customize called from variables, most likely a characters name. The top window I want to reflect variables associated with the current char's name that is highlighted to preview, and cause that choice to be selected... I don't want the game running in the background while this is going on... can someone please post a sample script that does this and explain it? I understand what classes, methods, scenes, variables, and stuff like that are, but I just can't create a simple two window system and it's getting aggrivating... the tuts and sifting through other ppl's work isn't helping. I'm learning different things from them, yeah, but not in specific what I'm trying to do... please someone help!

I now have this:
Code:
class Top_Win < Window_Base
  def initialize
    super(0, 0, 544, 312)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  
  def refresh
    self.contents.clear
  end
end

class Bot_Win < Window_Base
  def initialize
    super(0, 312, 544, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  
  def refresh
    self.contents.clear
  end
end

#==============================================================================
# ** Scene_Example
#------------------------------------------------------------------------------
#  This is just an example scene.
#==============================================================================

class Scene_Example < Scene_Base
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    @some_window1 = Top_Win.new
    @some_window2 = Bot_Win.new
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @some_window1.dispose
    @some_window2.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @some_window1.update
    @some_window2.update
  end
end

I have the call event
Code:
@scene1 = Scene_Example.new

set to action button. But when I try to activate it, nothing happens, literally. No error, no windows, no nothing...
 

Drykul

Member

Ok, well, I guess I misunderstood the first time, but now I put

Code:
#==============================================================================
# ** Scene_Example
#------------------------------------------------------------------------------
#  This is just an example scene.
#==============================================================================

class Scene_Example < Scene_Base
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    @some_window1 = Window_Base.new(0, 0, 544, 312)
    @some_window2 = Window_Base.new(0, 312, 544, 104)
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @some_window1.dispose
    @some_window2.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @some_window1.update
    @some_window2.update
  end
end

and it still doesn't do anything. The windows don't even show up with this.
 

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