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 some help with Journal Script

I'm using this Journal script, I don't know who the author is though.

Code:
class Window_Journal < Window_Selectable
#--------------------------------------------------------------------------
# ● Initialize journal
#--------------------------------------------------------------------------
def initialize
   super(0, 0, 640, 480) 
   @column_max = 1
   refresh
   self.index = $game_variables[4980]
 end


#--------------------------------------------------------------------------
# ● Draw the contents of the item window
#--------------------------------------------------------------------------
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end 
   
   @journal_start = 5
   @journal_end = 10
   @journal_height = (@journal_end-@journal_start)*32
   
   # draw the bitmap. the text will appear on this bitmap
   self.contents = Bitmap.new(width - 32, height+@journal_height) 
   self.contents.font.color = j_color
   self.contents.font.size = 22
   self.contents.font.name = 'Bradley Hand ITC'
   self.contents.font.bold = true
   
   # n represents the y coordinate where the entry will be displayed
   @n = 0
   @item_max = 100
   
   # create your empty journal
   @data = []    
     
   # populate your journal with entries. 
   # each entry must match its switch number!
   @data[1999] = "------ENTRY 1------"
   @data[2000] = "Disora? Alchemy and Magick?"
   @data[2001] = "Is this some far off country..."
   @data[2002] = "or am I merely dreaming?"
   @data[2003] = ""
   @data[2004] = "No, I'm not dreaming. I can't be."
   @data[2005] = "I hope this alchemist can offer an explanation."
   @data[2006] = "________________________________________________________"
   @data[2007] = ""
   @data[2008] = ""
   @data[2009] = ""
   @data[2010] = ""
   @data[2011] = ""
   @data[2012] = ""
   @data[2013] = "------ENTRY 2------"
   @data[2014] = "A new world besides Earth."
   @data[2015] = "Its a strange theory, but its the only one that makes sense."
   @data[2016] = "It took me 15 years to find the Ashkalet..."
   @data[2017] = "but, if this world truly has none, what shall we do?"
   @data[2018] = "Emily...will I ever see you again?"
   @data[2019] = ""
   @data[2020] = "First, however, I must help Wolfram."
   @data[2021] = "If we are to find our way home, we should remain allies."
   @data[2022] = "However, I don't think he is fighting Ishmael simply for his sword..."
   @data[2023] = "Although he won't admit it, he seems to have a strong sense of justice."
   @data[2024] = "That makes me wonder - Who exactly is his client?"
   @data[2025] = "________________________________________________________"
   @data[2026] = ""
  # print the entries in your journal 
  for i in 1999..3000

    # check to see which quest switches are on
    if $game_switches[i] == false
       @data[i] = nil
    else
       @item_max += 1
    end

    # check to see which messages should display
    if @data[i] != nil 
       draw_item(i) 
     end

   end      
  
 end
     
#--------------------------------------------------------------------------
# ● Draw an individual item in the window
#     index : Index of the item to be drawn
#--------------------------------------------------------------------------

 def draw_item(index)
      item = @data[index]
      rect = Rect.new(0, 0, 0, 0)
      self.contents.fill_rect(rect, Color.new(255,0,0,0))        
      self.contents.draw_text(10, @n, 640, 32, "●", 0)
      self.contents.draw_text(25, @n, 640, 32, item, 0)
      @n += 32
      
 end
end

Code:
#==============================================================================
# â–  Scene_Status
#------------------------------------------------------------------------------
#  This class contains the windows for the character status menu that can be 
#   accessed from the main menu.
#==============================================================================

class Scene_Journal
  #--------------------------------------------------------------------------
  # ● Initialize the Status menu
  #--------------------------------------------------------------------------
  def main

    @journal_window = Window_Journal.new
      
    Graphics.transition

    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end  
    end

    Graphics.freeze
    @journal_window.dispose

  end
  #--------------------------------------------------------------------------
  # ● Draw the Status menu
  #--------------------------------------------------------------------------
  def update

    @journal_window.update
    
    if @journal_window.active
      update_item
      return
    end
      
  end

  #--------------------------------------------------------------------------
  # ● Update menu after player makes a selection
  #--------------------------------------------------------------------------
  def update_item
    
    # Cancel key pressed (go to menu)
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $game_system.windowskin_name = 'plainpearl'
      $data_system.cursor_se = RPG::AudioFile.new('001-System01', 80, 0)
      $scene = Scene_Menu.new(2)
      return
    end
    
  end
end

Now, as for the text, its from my game. I turn switches 1999-2026 ON, but for some reason it doesn't print entires 2019-2026

If anyone knows why or can direct me to another joournal script, thank you.
 

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