RPG Maker Forums

So, then.

I was FINALLY dipping my fingers into the RGSS scripting world. Decided to start with a simple XP game. I'm working on a simple monster book.

I've...already ran into an issue.

I was working on a list of monsters to select from. At first, it looks fine. But then I scroll down.

I get this:

Test 10_7_2018 4_50_40 PM.png

Basically, it's making the size of the list the exact amount of enemies I have in the game.

But, the text is only displaying the initial amount of enemies visible in the window.

Here's what I've got so far:

Code:
#==============================================================================
#
# My first RGSS Script. Hopefully, this works out well
#
# This is a standard bestiary script. It displays a list of enemies that
# you've encountered and their image and stats.
#
# Author: AceTheMad
#==============================================================================

class Window_Monster_Image < Window_Base
  #-----------------------------------------------------------------------------
  # * Object Initialization
  #-----------------------------------------------------------------------------
  def initialize
    super(220, 0, 420, 240)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.size = MBook::TEXT_SIZE
    self.contents.draw_text(30, 30, contents.text_size(MBook::TEXT).width, MBook::TEXT_SIZE + 12, MBook::TEXT)
  end
end

class Monster_List < Window_Selectable
  def initialize
    super(0, 0, 220, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item_max = $data_enemies.compact.length
    @column_max = 1
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    y = 4 + index * 32
    self.contents.draw_text(0, y, 220, 32, $data_enemies.compact[index].name)
  end
end
And this, if you need it, is my scene code.

Code:
#-------------------------------------------------------------------------------
# MonsterBook scene
#-------------------------------------------------------------------------------
class Monster_Book
  #-----------------------------------------------------------------------------
  # * Main Processing
  #-----------------------------------------------------------------------------
  def main
    @image_window = Window_Monster_Image.new
    @list_window = Monster_List.new
    Graphics.transition
    
    loop do
      Graphics.update
      
      Input.update
      
      update
      
      if $scene != self
        break
      end
    end
    
    Graphics.freeze
    
    @image_window.dispose
    @list_window.dispose
  end
 
  def update
    @image_window.update
    @list_window.update
  end
 
end
Forgive the lack of organization. I'm still new to this and care more about learning the language. X'D

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,472
Members
137,822
Latest member
madelbylz
Top