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.

Super Simple Journal

The white checkmark comes with the demo. The green checkmark is up there in one of my previous posts. Just right-click -> Save image.

Can you post your Journal scripts from Your computer?
 
Nope, but I can post the scripts with a 2nd page implemented.

Code:
#==============================================================================
# ** Window_Journal
#------------------------------------------------------------------------------
#  This window displays a journal.
#  Original Script - Lambchop
#  Modified 'for' loops & 'journal_height' so you only have to edit the
#  data array. - Brew
#  Moved completed items to 2nd page (L, R arrows to switch)
#==============================================================================

class Window_Journal < Window_Selectable
# ------------------------
attr_accessor :page
def initialize
   super(0, 32, 460, 330) 
   @column_max = 1
   @page = false
   refresh
   self.index = 0 
### to change the windowskin for the journal
#   self.windowskin = RPG::Cache.windowskin("RMXP4life_Wood.png")
###
 end


#--------------------------------------------------------------------------
# * Draw the contents of the item window
#--------------------------------------------------------------------------
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end 
   
   # populate your journal with entries. Each entry must match its switch number!
   @page_title = []
   @page_title[1] = "Active Quests"
   @page_title[2] = "Completed Quests"
   @data = [] 
   @data[1] = "Help Man"
   @data[2] = "Kill Chicken"
   @data[3] = "Make cow eat"
   @data[4] = "Sniff the Glove"
   @data[5] = "Jump off a bridge after your friends"
   @data[6] = "Item 6"
   @data[7] = "Item 7"
   @data[8] = "Item 8"
   @data[9] = "Item 9"
   @data[10] = "Item 10"
   @data[11] = "Item 11"
   @data[12] = "Item 12"
   @data[13] = "Item 13"
   
   num = @data.size
      
   # variables
   @journal_height = (num - 2)*32   # y height of entire journal
   @n = 0                     # y coord for each entry
   @item_max = 1              # max items to display
   
   # draw the bitmap. the text will appear on this bitmap
   self.contents = Bitmap.new(width - 32, height+@journal_height)
 
   if @page == false
   # Show active items
     draw_title(1)
     for i in 1..(num - 1)
       if ($game_switches[i + 100] == true) and ($game_switches[i + 200] == false)
         draw_item(i)
         @item_max += 1
       end
     end 
   else
   # Show complete items
     draw_title(2)
     for i in 1..(num - 1)
       if ($game_switches[i + 200] == true)
         draw_item_complete(i)
         @item_max += 1
       end
     end         
   end
 end
   
#--------------------------------------------------------------------------
# * Draw an individual item in the window
#     index : Index of the item to be drawn
#--------------------------------------------------------------------------

 def draw_title(index)
      item = @page_title[index]
      rect = Rect.new(10, @n, 460, 32)
      self.contents.fill_rect(rect, Color.new(0,0,0,0))        
      self.contents.font.color.set(256,256,256,256)
      self.contents.draw_text(0, @n, 428, 32, item, 1)
      @n += 32
      
 end
 def draw_item(index)
      item = @data[index]
      rect = Rect.new(10, @n, 460, 32)
      self.contents.fill_rect(rect, Color.new(0,0,0,0))        
      self.contents.font.color.set(256,256,128,256)
      self.contents.draw_text(10, @n, 15, 32, "â—
 
Im getting an error when I start the game:
NameError occurred while running the script
undefined local variable or method 'i' for #<Interpreter:0x3a1fa18>
It occurs when I pick "New Game"
 
I took out the jornal script and AP Script,
These are the scripts I have:
Mr.Moe's NeoABS
Rye CBS Starter Pack 0.3
Enhanced Weapons 0.5
 

HoRe

Member

Hey Brew, I know you advised Love to look at another post when they said they couldn't find the Window_Menu. I looked, yet I still can't figure it out.  :down: I know, I'm ashamed. And the link for the demo goes nowhere.
 
Ok, I updated the instructions for a new game.  (there is no Window_Menu script)

This post got destroyed by the server move. (See the 1st post)
 
brew! there you are.

it worked, thanks so much.

but one prob, the 'square' ain't long enough to support another item so the line above 'play time' cuts through the word 'journa;'

how can i change that? please and thanks.
 
brew, i have another problem.

i copied and pasted that code into the scene_menu part and everything seems fine at first, but when i playtested my game i couldn't even go into my menu section! why is this? O_O

something about line 70 having problems...

i check line 70 and the word 'update' is there... what's that supposed to mean?
 
Not a clue.  To even have a chance at guessing, I need to see the whole error. (either type it in, or post a screenshot of the error window.)

More than likely, something got botched with the copy / paste.

Another problem is, now I have so many different versions of this script, I don't even remember which one is yours...

If you want to post your version of the scripts (Scene_Menu, Scene_journal, Window_Journal), I can debug it for you.

Wait, I just read that again.  If you pasted my Scene_Menu in place of the default Scene_Menu, that is probably the problem.
What you needed to do was Insert a new empty script right above 'main', and add my Scene_Menu_Mods there. My version of
scene menu is not the whole script, it only adds things to the class.
To get the original / default Scene_Menu back, the easiest way is to start a new project, then copy / paste it from the
new project to your project.

So, the bottom of your scripts list should look like...

Scene_Debug              <- this is the last default script other than main
Window_Journal
Scene_Journal
Scene_Menu_Mods      <- I called this Scene_Menu_Mods so they don't get mixed up
Scene_Map_Mods        <- If you are using the "Q" option
Main

Let me know
 
Colonist540":33qkfrdj said:
How can i make the Journal Description?

If you mean, "How do I add my own quests?"
Look in the Window_Journal script for these lines...

Code:
   @data[1] = "Task 1"
   @data[2] = "Task 2"
   @data[3] = "Task 3"

and change "Task 1" to the text for your first quest

Be Well
 
Err...I mean like
If the player press at the journal a Description come out.Like if the player press the beer quest then it comes out the description in a new window.
Something like this:
Beer Quest:
  Go buy you Father a beer.
 

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