Super Simple Journal

Have you ignored the many many things about necroposting up topics? I suppose this isn't too bad as it's only 11 days.

You should ask for help in the script requests, not advertising your thread in this one.
Colonist, this script doesn't do that. It's "Super Simple!" :scruff:

It was designed to be a simple 'to do' list. So your quest text would be / should be:

"Buy Brewmeister a beer."

Be Well
Wow, I've been messing around with this system on RMXP. I've made it so that you can set switches that give you an X mark if you failed the task. I like it being simple, it gives huge room for editing without much RGSS knowledge.
I think that was "Lamby-Poo's" objective in sharing it. :scruff:
(she is a pretty Hoopy Frood!)

I have 6 different versions of it myself.

It's not the cleanest code, but it does illustrate making a scene with windows well.

Have fun with it.
In my script list, there is no Window_Menu. There is, however a Windown_MenuScene. What do I do? There is a Scene_Menu... which is odd...
You didn't read the whole thread, did you?  Halfway down page 2, are modified instructions.
We know there is no 'Window_Menu' in the default scripts. Lambchop must have had a customized version to start with.

There is no 'Windown_MenuScene'.  There is a 'Windown_MenuStatus', which is the right window in main menu.

Scene_Menu isn't as odd as you might think. When you open the menu, you are in a new 'Scene'. The scene is made of the other windows, and the methods to control what happens when you press buttons.

Anyways, follow the instructions on Page 2, and I think you will be ok.

Be Well
Hello Brew,

Its a great script but i have a problem. Now if i have received a weapon, The weapon is in my itemlist not in equiptment.
:blush: well, I've tried the first script given here to add a quests journal in my game... I'm a totally newbie in that kind of prommaning langage, so... sorry to bother... most of the time I more guess how it works because I've been a programmer a looooooong time ago, but in .... cobol... yes.... I admit it 🙂
so, I almost understand everything, or guess them, but I've got a problem with the "index" reference...
so far I use switches from 1 to n, it perfectly works, but the problem is that in my game, these switches are already used, so I would like the switches for the quests to begin at 301...
so I changed the value of @offset at 300 and put naturally the definitions of the data for the messages from 301 to n...
but at the end of the script, I'm told that
"TypeError occured - cannot convert nil into string"...
so, just to test, I've put the real value in the "item = @data[301]" and it works quite well, except the fact I've got the same message 2 times in my journal... :huh:
so, if I have well understood, seems the value of index isn't well "fed" and stays at nil, but I can't figure so far how to change that...
I've tried many things, but none worked and I guess I really miss something ... :ouch:
any help would be really nice... thanks by advance 🙂
First, the offset applies only to the switches, not the data.
So, with an offset of 300, @data[1] is controlled by switch 301

Look at the refresh method, where it calls draw_item
  1.            for i in [email hidden]
  2.               if $game_switches[i + @offset] == true
  3.                  draw_item(i)
  4.                  @item_max += 1
  5.               end
  6.            end
Expand to see the code.


The 'i' in the for loop is what gets sent to 'index' in the draw_item method. (not 'i + @offset')
So the first index getting sent is '1'
However the test for the switch is 'if $game_switches[i + @offset] == true'
ohhhh thanks so much :blush:
well, I thought the value of the data in [] had to be exactly the same as the number of the switch...
and then offset would apply both somewhere.... don't know why, I thought I had read that somewhere... maybe in another life... :o:
that's why I was totally beside my feet (don't even know if it's really an english expression, but it's a French one 🙂 )

thanks again anyway, it's works naturally perfectly now

Catchoun offers a beer or anything else Brewmeister would like to thank him ... maybe a real old French Calva ? :grin:

btw, do you got any good link to get a good Ruby method ?... I'm not so young anymore 😀 , so, I need a simple one ...
Hello! I'm so new to RPG maker XP & this is my first time I explore the script editor. Anyway, I did everything mentioned & when I tried to playtest the game it said: "Script 'Window_Journal' line 49: SyntaxError occured." Is it something I did wrong on my part? Any help is much appreciated. Thanks in advance.

EDIT: Okay. I tried again & somehow it works. Thanks 😀
If you mean: 't Smisje Calva Reserva - Brouwerij De Regenboog, or even something similar, I'll be right over to collect!!! :scruff:
It looks delicious!
Heavy, dark beers are my favorite.

In english we say, "beside myself", which means pretty much the same.

I use the ruby site http://www.ruby-lang.org/en/ for reference. But I was a programmer prior to learning Ruby.
Do a search on the site here, I know there's a list of references for beginners. And, we're always here for support as you go.

Be Well
I tried with all 3 scripts posted here, but an error keeps comming up: (open the spoiler)
Content Hidden Show
Script 'Window_Journal' line 104: SyntaxError occurred

I am using RPG Maker VX and the only other script I'm using is a side-view battle script.
You might have not seen errors like this one...

@n = 0Â

That shouldn't be there because it follows a number for no good reason. So delete any you can find there.
Weird. I dunno where the garbage characters came from, but I got rid of them.
We apologize for the inconvenience.

Be Well
So I replace this line
self.contents.draw_text(10, @n, 640, 32, "â €”
with what?
self.contents.draw_text(10, @n, 640, 32, "●", 0)

The scripts on the first page are clean now.
I replaced the line, but it still has the same error. If I remove the line it just has one on the line above.
Window_Journal should only have 79 lines. Did you paste some extra stuff in there?
Is there any way to turn the actual topics into buttons, though?

I know you told Colonist it's a simple script, but I could TOTALLY figure it out myself if I know just that, and how to identify the selected journal entry's ID, as that would help me find the right 'long' description, I can do the rest.

PLZ plz plz... you'd be my hero if you can just tell me heheh :P

Kudos for a great script by the way, I spent 4 HOURS today trying to work in a really nice-looking script that turned out to be only for VX... U.U (Building on XP)
If you mean you would like something to happen when the user selects one of the quests...

Yes, that can be done. The question is: What do you want to happen?

The window is already a Window_Selectable, which includes the methods to process selection of one of the items in the list.
If you look at the 'update_command' method in Scene_Menu, you'll see a section with the comment: "# If C button was pressed"
You would need to add a section similar in the 'update' method for Scene_Journal.
It is the 'index' property of the window that will tell you which entry is currently selected.
In Scene_Menu, it's @command_window.index
In Scene_Journal, it would be @journal_window.index.

Look at the 'update_item' method in Scene_Journal. It already handles what happens if the "B" (X or Escape key) button is pressed.
It either returns to the menu, or the map, depending on from where it was called.

So, if you add a section that looks like:

  1.    # If C button was pressed
  2.     if Input.trigger?(Input::C)
  3.       # Do what you need to do here
  4.     end
  5.  
Expand to see the code.


and use @journal_window.index to indicate which entry is selected.
thanks so much for the quick reply Brew, you're awesome :P

however, It seems I overestimated my abilities a bit... I can't seem to create a custom page based on a selected ID, like the selected [journal_window.index], even though I tried many things throughout the day...

I easily managed to make a second identical journal menu, (nested in the first one) but I just can't seem to turn it into a simple text display with the same graphic box (0, 32, 460, 330), but no selectable list.

the problem is, I hadn't fully considered in what shape the actual extra quest text would be transported, and it just wouldn't work when I tried making a duplicate list of the (@data[1] "Title", @data[2] "Title") list, but with longer entries, in a near-duplicate script I simply called [Window_JournalDetails]... and that was my best plan, I think. (Also have a [Scene_JournalDetails] script)

Worked at this all day, so it's not for lack of trying, heheh... but I''m afraid I gotta rely on your skill again... pleez :3



(for clarification, since my explanations can be confusing sometimes, the user would hit the C button on any of the journal's active entries, and it would open, in a similar frame, a description based on that @data[1] list's values.)

a downside would be that I could only have one text value for any entry, but I could just make a lot of entries. Besides, it would allow for updated titles as the quest progresses.

thanks bro :)
Here ya go:

Add above Window_Journal
  1. # Bitmap_Mods
  2.  
  3. class Bitmap
  4.   #-------------------------------------------------------------------------
  5.   #   Name      : Draw Paragraph
  6.   #   Info      : Draws a Paragraph
  7.   #   Author    : SephirothSpawn
  8.   #   Call Info : Five
  9.   #               Integer X and Y, Define Position
  10.   #               Integer Width, defines the width of the text rectangle
  11.   #               String Text, Information to Draw
  12.   #               Integer Indent Amount of Space to indent by
  13.   #               Integer Line_Height line height
  14.   #-------------------------------------------------------------------------
  15.   def draw_paragraph(x, y, width, text, indent = 32, line_height = 24)
  16.     ox, oy = indent, 0
  17.     for word in text.split
  18.       ow = text_size(word).width
  19.       if ow + ox > width
  20.         ox = 0
  21.         oy += line_height
  22.       end
  23.       if word == "n"
  24.         ox = 0
  25.         oy += line_height
  26.         next
  27.       end
  28.       ow = [ow, width].min
  29.       draw_text(x + ox, y + oy, ow + 10, line_height, word)
  30.       ox += ow + text_size(' ').width
  31.     end
  32.   end
  33. end
Expand to see the code.


  1. #==============================================================================
  2. # ** Window_Journal_Detail
  3. #------------------------------------------------------------------------------
  4. #  This window displays a detailed description when an entry is
  5. #  selected in the journal.
  6. #==============================================================================
  7.  
  8. class Window_Journal_Detail < Window_Base
  9. # ------------------------
  10. attr_accessor :index
  11. def initialize
  12.    super(0, 32, 460, 330)
  13.    
  14. #----------------------------------------------------------
  15. # populate your journal with descriptions.
  16. # make sure your descriptions match your journal entries in
  17. # Window_Journal.  Use a single 'n' for a new line.
  18.  
  19.    @data = []
  20.    @data[1] = "1: This is a long description to n n illustrate the use of long descriptions"
  21.    @data[2] = "2: This is a long description to illustrate the use of long descriptions"
  22.    @data[3] = "3: This is a long description to illustrate the use of long descriptions"
  23.    @data[4] = "4: This is a long description to illustrate the use of long descriptions"
  24.    @data[5] = "5: This is a long description to illustrate the use of long descriptions"
  25.    
  26. ### to change the windowskin for the journal
  27. #   self.windowskin = RPG::Cache.windowskin("RMXP4life_Wood.png")
  28.  
  29.  
  30. #----------------------------------------------------------
  31.  
  32.    @column_max = 1
  33.    self.index = 0
  34.    @offset = 100
  35.  end
  36.  
  37.  
  38. #--------------------------------------------------------------------------
  39. # * Draw the contents of the item window
  40. #--------------------------------------------------------------------------
  41.  def refresh(index)
  42.    if self.contents != nil
  43.      self.contents.dispose
  44.      self.contents = nil
  45.    end
  46.    
  47.    # draw the bitmap. the text will appear on this bitmap
  48.    self.contents = Bitmap.new(428, 298)
  49.  
  50.    # get the item to display
  51.     item = index + 1
  52.     count = 0
  53.     for i in [email hidden]
  54.       if $game_switches[i + @offset] == false
  55.         item += 1
  56.       else
  57.         count += 1
  58.       end
  59.       if count == index + 1
  60.         break
  61.       end
  62.     end        
  63.  
  64.    # draw the description
  65.    text = @data[item]
  66.    self.contents.draw_paragraph(0, 0, 428, text)
  67.  end
  68.    
  69. end
Expand to see the code.


Replace Scene_Journal with this:
  1. #==============================================================================
  2. # ■ Scene_Journal
  3. #------------------------------------------------------------------------------
  4. #  This class contains the windows for the Journal
  5. #==============================================================================
  6.  
  7. class Scene_Journal
  8.   #--------------------------------------------------------------------------
  9.   # ● Initialize the Status menu
  10.   #--------------------------------------------------------------------------
  11.   def initialize(callback = 0)  #callback from menu
  12.     @callback = callback
  13.   end
  14.  
  15.   def main
  16.  
  17.     @journal_window = Window_Journal.new
  18.     @journal_window.x = 90
  19.     @journal_window.y = 70
  20.     @journal_window.active = true
  21.     @journal_window.visible = true
  22.     @desc_window = Window_Journal_Detail.new
  23.     @desc_window.x = 90
  24.     @desc_window.y = 70
  25.     @desc_window.active = false
  26.     @desc_window.visible = false
  27.    
  28.     Graphics.transition
  29.  
  30.     loop do
  31.       Graphics.update
  32.       Input.update
  33.       update
  34.       if $scene != self
  35.         break
  36.       end  
  37.     end
  38.  
  39.     Graphics.freeze
  40.     @journal_window.dispose
  41.     @desc_window.dispose
  42.   end
  43.   #--------------------------------------------------------------------------
  44.   # ● Draw the Status menu
  45.   #--------------------------------------------------------------------------
  46.   def update
  47.     @journal_window.update
  48.     if @journal_window.active
  49.       update_item
  50.       return
  51.     end
  52.     if @desc_window.active
  53.       update_desc
  54.     end
  55.   end
  56.  
  57.   #--------------------------------------------------------------------------
  58.   # ● Update menu after player makes a selection
  59.   #--------------------------------------------------------------------------
  60.   def update_item
  61.    
  62.     # Cancel key pressed (go to menu)
  63.     if Input.trigger?(Input::B) or Input.trigger?(Input::L)
  64.       $game_system.se_play($data_system.cancel_se)
  65.       if @callback == 0
  66.         $scene = Scene_Menu.new(4)
  67.       else
  68.         $scene = Scene_Map.new
  69.       end
  70.       return
  71.     end
  72.     # If C button was pressed
  73.     if Input.trigger?(Input::C) and @journal_window.selectable == true
  74.       @journal_window.active = false
  75.       @journal_window.visible = false
  76.       @desc_window.active = true
  77.       @desc_window.visible = true
  78.       @desc_window.refresh(@journal_window.index)
  79.     end
  80.   end
  81.  
  82.   #--------------------------------------------------------------------------
  83.   # ● Update menu after player makes a selection
  84.   #--------------------------------------------------------------------------
  85.   def update_desc
  86.    
  87.     # Cancel key pressed (go to menu)
  88.     if Input.trigger?(Input::B) or Input.trigger?(Input::L)
  89.       $game_system.se_play($data_system.cancel_se)
  90.       @journal_window.active = true
  91.       @journal_window.visible = true
  92.       @desc_window.active = false
  93.       @desc_window.visible = false
  94.       return
  95.     end
  96.   end
  97.  
  98. end
Expand to see the code.



Instead of creating a new scene, I just added another window that starts out invisible. When you select an entry, it makes the first window inactive & invisible, and makes the second window active & visible. You'll need to populate the @data structure in the new window to match the first window. The other thing I did was add the Draw_Paragraph method to the Bitmap class so you don't have to worry about breaking up the description into multiple lines.

Try it out
WOW!!! :tongue:

okay, you ROCK dude... :rock: that is absolutely perfect, and the paragraphing tool is exactly what I needed but I thought it was too much to ask, I'm seriously in your debt my friend :grin:

Only one tiny detail I could find that didn't work, was that the game crashes if you try to enter the [blank] journal entry, what's left if all quests are gone...

Can I replace that with a simple [no current quests] and @journal_window.disable_item(0)?
I'm not 100% sure what the condition would be...

thanks again SO MUCH for the help hehe ^_^
-Drey


PS, one little detail I'd love to know, if it's not too much:3

Any way I can add a line break in the text description? I tried combining something in between, like in:["text".<br/>."more text"] but no success, because I dunno what the line break code is.
You should not have any blank @data entries. Use the switches to turn quests on/off.

the draw_paragraph method was written by Sephiroth Spawn. (I added the newline character 'n')
To make a newline: "Line 1 of my description n Line 2 of my description n n Line 4 of my description with a blank line above"

I updated the scripts above, re-download and install them. And replace Window_Journal as well...

  1. #==============================================================================
  2. # ** Journal
  3. #------------------------------------------------------------------------------
  4. #  This window displays a journal.
  5. #==============================================================================
  6.  
  7. class Window_Journal < Window_Selectable
  8.   attr_accessor :selectable
  9. # ------------------------
  10. def initialize
  11.    super(0, 32, 460, 330)
  12.    
  13. #----------------------------------------------------------
  14. # populate your journal with entries.
  15.    @data = []
  16.    @data[0] = "[No Current Quests]"
  17.    @data[1] = "Help Man"
  18.    @data[2] = "Kill Chicken"
  19.    @data[3] = "Make cow eat"
  20.    @data[4] = "Sniff the Glove"
  21.    @data[5] = "Jump off a bridge after your friends"
  22.    
  23. # this is the offset for your switches. If you start with switch 100, set
  24. # @offset = 99
  25.  
  26. @offset = 100
  27.    
  28. ### to change the windowskin for the journal
  29. #   self.windowskin = RPG::Cache.windowskin("RMXP4life_Wood.png")
  30.  
  31.  
  32. #----------------------------------------------------------
  33.  
  34.    @column_max = 1
  35.    self.index = 0
  36.    self.selectable = true
  37.    refresh
  38.  end
  39.  
  40.  
  41. #--------------------------------------------------------------------------
  42. # * Draw the contents of the item window
  43. #--------------------------------------------------------------------------
  44.   def refresh
  45.     if self.contents != nil
  46.      self.contents.dispose
  47.      self.contents = nil
  48.     end
  49.    
  50.     # variables
  51.     @journal_height = (@data.size - 1)*32   # y coord of entire journal (# of entries - 1) * 32
  52.     @n = 0                     # y coord for each entry
  53.     @item_max = 0              # max items to display
  54.    
  55.     # draw the bitmap. the text will appear on this bitmap
  56.     self.contents = Bitmap.new(width - 32, @journal_height)
  57.      
  58.     for i in [email hidden]
  59.      if $game_switches[i + @offset] == true
  60.        draw_item(i)
  61.        @item_max += 1
  62.        self.selectable = true
  63.      end
  64.     end    
  65.    
  66.     if @item_max == 0
  67.       draw_item(0)
  68.       self.selectable = false
  69.     end
  70.  
  71.   end
  72.    
  73. #--------------------------------------------------------------------------
  74. # * Draw an individual item in the window
  75. #     index : Index of the item to be drawn
  76. #--------------------------------------------------------------------------
  77.  
  78.   def draw_item(index)
  79.     item = @data[index]
  80.     rect = Rect.new(10, @n, 640, 32)
  81.     self.contents.fill_rect(rect, Color.new(0,0,0,0))
  82.     if index != 0
  83.       self.contents.draw_text(10, @n, 640, 32, "●", 0)
  84.     end
  85.     self.contents.draw_text(25, @n, 640, 32, item, 0)
  86.     @n += 32
  87.      
  88.   end
  89.  
  90. end
Expand to see the code.
[FIXED] sorry, no I mean how there's an empty box in the interface when you don't actually have any active quests.

If I hit the C button within the journal but without an active mission, it'll crash, giving me this error.
Image
[FIXED] Oh crap... I just swapped in the updated scripts, and now I can't open my journal without a total crash! O.O

Image
I should've backed up the working version though! *kicks myself hard*


EDIT: FIXED IT! *whew* it was simply because I had fixed the offset back to 0 before, (your default is 100) very important to remember if swapping in code.

Thanks a ton, Brew!!! :thumb:
Everything works like a charm, although it took me a few setbacks cause I switched in my own quests and mistakenly erased the @data(0) you'd added... but it's about as close to perfect as it's getting 😀

You're awesome :tongue:
(BTW tiny last details, any idea why a few of SephirothSpawn's paragraphed words are kinda squashed? not a dealbreaker, just looks curious) 😉
Image
I think there's a discrepancy in the text_size method. Certain letters don't seem to return the correct width.
We should be able to fake it out in the draw_text call in the draw_paragraph method.

Try changing this line:

draw_text(x + ox, y + oy, ow, line_height, word)

to:

draw_text(x + ox, y + oy, ow + 10, line_height, word)

ow for certain words is getting calculated too small. So just draw the text in a larger rectangle.


And, yes. There's a @offset in both Window scripts. You need to change it in 2 places.
perfect, worked without a hitch!! thanks so much Brew, you're a genius man... which is why I'll ask about a new problem I just found, I'm sure you thought of it already...

If any switches, other than my quest switches, get turned on right now, opening my journal crashes the game immediately.

Is the only cause the fact that they have varying numbers? I didn't use numbers 1 2 3 4 5, mine are actually 5 and 85, different numbers for importance... Other switches are obviously being used in other ways than quests, but I hadn't noticed until now that seems to clash with the journal?

my data list goes:
@data[0] = "[No Current Quests]"
@data[5] = "Shota"
@data[85] = "A Broken Staff"


Would it fix this at all if just made them 0, 101 and 102, with the offset? I'd actually like some wiggle room, so I can add more/less important quests in order as I think of them.

thanks bud ^.-
You need a contiguous range of switches, and the @data array can't have any empty slots.
That's the reason for the @offset value. If you use the @offset of 100, then switch 101 controls @data[1]. (i.e. you wouldn't use @data[101])
The @data array always starts at 1, you can have any number of slots, but don't leave any empty.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=21214