Super Simple Journal

Super Simple Journal - V2

I agree this needs to be simplified a bit. - Brewmeister (in response to feedback & excessive support requests)
Changes:
* You only need to edit the list of tasks. The scripts will figure out the rest.
* Added a callback so you can use this from the menu, or from the map with the "Q" key
You will return to the map or menu from whence you came. :)
* Added @offset near tasks, to make it easier to specify a starting switch other than 1.
* Include separate Menu & Map mods so you don't have to edit any default scripts
* Added an option to use a custom windowskin for your journal

Introduction
If you want a very simple journal, this is the script for you. This script creates a new journal screen for you that contains a list of quests that your character needs to complete. The player can scroll through the list, and that's it. You define your journal entries in the script, and then use switches to turn the entries on and off in your game. Easy!

Create Window_Journal

In this section, we will create the journal and its window.

1. Open your game and script editor. ( Tools -> Script Editor, Script Editor Icon, or F11 )

2. Right-Click on Main, and select Insert

2. In the name box, type Window_Journal

3. In the code page (right side), copy & paste the following script:
Remember to turn off line numbers before using the "Select All" button!

  1. #==========================================================================
  2. # Window_Journal
  3. #------------------------------------------------------------------------------
  4. #  This window displays a journal.
  5. #==========================================================================
  6.    
  7. class Window_Journal < Window_Selectable
  8.     # ------------------------
  9.     def initialize
  10.        super(0, 32, 460, 330)
  11.        
  12.     #----------------------------------------------------------
  13.     # populate your journal with entries.
  14.        @data = []
  15.        @data[1] = "Help Man"
  16.        @data[2] = "Kill Chicken"
  17.        @data[3] = "Make cow eat"
  18.        @data[4] = "Sniff the Glove"
  19.        @data[5] = "Jump off a bridge after your friends"
  20.        
  21.     # this is the offset for your switches. If you start with switch 100, set
  22.     # @offset = 99
  23.    
  24.     @offset = 0
  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.        refresh
  34.        self.index = 0
  35.      end
  36.    
  37.    
  38.     #--------------------------------------------------------------------------
  39.     # * Draw the contents of the item window
  40.     #--------------------------------------------------------------------------
  41.      def refresh
  42.        if self.contents != nil
  43.          self.contents.dispose
  44.          self.contents = nil
  45.        end
  46.        
  47.        # variables
  48.        @journal_height = (@data.size - 1)*32   # y coord of entire journal (# of entries - 1) * 32
  49.        @n = 0                    # y coord for each entry
  50.        @item_max = 0              # max items to display
  51.        
  52.        # draw the bitmap. the text will appear on this bitmap
  53.        self.contents = Bitmap.new(width - 32, @journal_height)
  54.          
  55.        for i in [email hidden]
  56.          if $game_switches[i + @offset] == true
  57.            draw_item(i)
  58.            @item_max += 1
  59.          end
  60.        end      
  61.      
  62.      end
  63.        
  64.     #--------------------------------------------------------------------------
  65.     # * Draw an individual item in the window
  66.     #    index : Index of the item to be drawn
  67.     #--------------------------------------------------------------------------
  68.    
  69.      def draw_item(index)
  70.           item = @data[index]
  71.           rect = Rect.new(10, @n, 640, 32)
  72.           self.contents.fill_rect(rect, Color.new(0,0,0,0))    
  73.           self.contents.draw_text(10, @n, 640, 32, "●", 0)
  74.           self.contents.draw_text(25, @n, 640, 32, item, 0)
  75.           @n += 32
  76.          
  77.      end
  78.    
  79.     end
Expand to see the code.



Create Scene_Journal

In this section, we will create the scene that will contain our journal window. The scene determines where the journal window will appear to users and what happens when keys are pressed.

1. Open your script editor.

2. Add a new script called Scene_Journal below Window_Journal (above Main) in your script list.

3. In Scene_Journal, add the following code:

  1. #==============================================================================
  2.     #  Scene_Status
  3.     #------------------------------------------------------------------------------
  4.     # This class contains the windows for the character status menu that can be
  5.     #   accessed from the main menu.
  6.     #==========================================================================
  7.    
  8.     class Scene_Journal
  9.       #--------------------------------------------------------------------------
  10.       #  Initialize the Status menu
  11.       #--------------------------------------------------------------------------
  12.       def initialize(callback = 0)  #callback from menu
  13.         @callback = callback
  14.       end
  15.      
  16.       def main
  17.    
  18.         @journal_window = Window_Journal.new
  19.         @journal_window.x = 90
  20.         @journal_window.y = 70
  21.        
  22.         Graphics.transition
  23.    
  24.         loop do
  25.           Graphics.update
  26.           Input.update
  27.           update
  28.           if $scene != self
  29.             break
  30.           end  
  31.         end
  32.    
  33.         Graphics.freeze
  34.         @journal_window.dispose
  35.    
  36.       end
  37.       #--------------------------------------------------------------------------
  38.       #   Draw the Status menu
  39.       #--------------------------------------------------------------------------
  40.       def update
  41.         @journal_window.update
  42.         if @journal_window.active
  43.           update_item
  44.           return
  45.         end
  46.       end
  47.    
  48.       #--------------------------------------------------------------------------
  49.       #   Update menu after player makes a selection
  50.       #--------------------------------------------------------------------------
  51.       def update_item
  52.        
  53.         # Cancel key pressed (go to menu)
  54.         if Input.trigger?(Input::B) or Input.trigger?(Input::L)
  55.           $game_system.se_play($data_system.cancel_se)
  56.           if @callback == 0
  57.             $scene = Scene_Menu.new(4)
  58.           else
  59.             $scene = Scene_Map.new
  60.           end
  61.           return
  62.         end
  63.        
  64.       end
  65.      
  66.     end
Expand to see the code.



Create Scene_Menu_Mods (optional)

In this section, we will add Journal to the main menu. It will appear after Status.

1. Open your script editor.

2. Add a new script called Scene_Menu_Mods below Scene_Journal (above Main) in your script list.

3. In Scene_Menu_Mods, add the following code:

  1. class Scene_Menu
  2.     #--------------------------------------------------------------------------
  3.     # * Object Initialization
  4.     #    menu_index : command cursor's initial position
  5.     #--------------------------------------------------------------------------
  6.     def initialize(menu_index = 0)
  7.       @menu_index = menu_index
  8.     end
  9.     #--------------------------------------------------------------------------
  10.     # * Main Processing
  11.     #--------------------------------------------------------------------------
  12.     def main
  13.       # Make command window
  14.       s1 = $data_system.words.item
  15.       s2 = $data_system.words.skill
  16.       s3 = $data_system.words.equip
  17.       s4 = "Status"
  18.       s5 = "Journal"
  19.       s6 = "Save"
  20.       s7 = "End Game"
  21.       @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
  22.       @command_window.index = @menu_index
  23.       # If number of party members is 0
  24.       if $game_party.actors.size == 0
  25.         # Disable items, skills, equipment, and status
  26.         @command_window.disable_item(0)
  27.         @command_window.disable_item(1)
  28.         @command_window.disable_item(2)
  29.         @command_window.disable_item(3)
  30.       end
  31.       # If save is forbidden
  32.       if $game_system.save_disabled
  33.         # Disable save
  34.         @command_window.disable_item(4)
  35.       end
  36.       # Make play time window
  37.       @playtime_window = Window_PlayTime.new
  38.       @playtime_window.x = 0
  39.       @playtime_window.y = 256
  40.       @playtime_window.height = 96
  41.       # Make steps window
  42.       @steps_window = Window_Steps.new
  43.       @steps_window.x = 0
  44.       @steps_window.y = 352
  45.       # Make gold window
  46.       @gold_window = Window_Gold.new
  47.       @gold_window.x = 0
  48.       @gold_window.y = 416
  49.       @gold_window.height = 64
  50.       # Make status window
  51.       @status_window = Window_MenuStatus.new
  52.       @status_window.x = 160
  53.       @status_window.y = 0
  54.       # Execute transition
  55.       Graphics.transition
  56.       # Main loop
  57.       loop do
  58.         # Update game screen
  59.         Graphics.update
  60.         # Update input information
  61.         Input.update
  62.         # Frame update
  63.         update
  64.         # Abort loop if screen is changed
  65.         if $scene != self
  66.           break
  67.         end
  68.       end
  69.       # Prepare for transition
  70.       Graphics.freeze
  71.       # Dispose of windows
  72.       @command_window.dispose
  73.       @playtime_window.dispose
  74.       @steps_window.dispose
  75.       @gold_window.dispose
  76.       @status_window.dispose
  77.     end
  78.  
  79.     def update_command
  80.       # If B button was pressed
  81.       if Input.trigger?(Input::B)
  82.         # Play cancel SE
  83.         $game_system.se_play($data_system.cancel_se)
  84.         # Switch to map screen
  85.         $scene = Scene_Map.new
  86.         return
  87.       end
  88.       # If C button was pressed
  89.       if Input.trigger?(Input::C)
  90.         # If command other than save or end game, and party members = 0
  91.         if $game_party.actors.size == 0 and @command_window.index < 4
  92.           # Play buzzer SE
  93.           $game_system.se_play($data_system.buzzer_se)
  94.           return
  95.         end
  96.         # Branch by command window cursor position
  97.         case @command_window.index
  98.         when 0  # item
  99.           # Play decision SE
  100.           $game_system.se_play($data_system.decision_se)
  101.           # Switch to item screen
  102.           $scene = Scene_Item.new
  103.         when 1  # skill
  104.           # Play decision SE
  105.           $game_system.se_play($data_system.decision_se)
  106.           # Make status window active
  107.           @command_window.active = false
  108.           @status_window.active = true
  109.           @status_window.index = 0
  110.         when 2  # equipment
  111.           # Play decision SE
  112.           $game_system.se_play($data_system.decision_se)
  113.           # Make status window active
  114.           @command_window.active = false
  115.           @status_window.active = true
  116.           @status_window.index = 0
  117.         when 3  # status
  118.           # Play decision SE
  119.           $game_system.se_play($data_system.decision_se)
  120.           # Make status window active
  121.           @command_window.active = false
  122.           @status_window.active = true
  123.           @status_window.index = 0
  124.         when 4  # journal
  125.           # Play decision SE
  126.           $game_system.se_play($data_system.decision_se)
  127.           # Switch to journal scene
  128.           $scene = Scene_Journal.new
  129.         when 5  # save
  130.           # If saving is forbidden
  131.           if $game_system.save_disabled
  132.             # Play buzzer SE
  133.             $game_system.se_play($data_system.buzzer_se)
  134.             return
  135.           end
  136.           # Play decision SE
  137.           $game_system.se_play($data_system.decision_se)
  138.           # Switch to save screen
  139.           $scene = Scene_Save.new
  140.         when 6  # end game
  141.           # Play decision SE
  142.           $game_system.se_play($data_system.decision_se)
  143.           # Switch to end game screen
  144.           $scene = Scene_End.new
  145.         end
  146.         return
  147.       end
  148.     end
  149.   end
  150.  
  151.   #=============================================================
  152.  # ** Window_Steps
  153.  #------------------------------------------------------------------------------
  154.  #  This window displays step count on the menu screen.
  155.  #=============================================================
  156.  
  157.  class Window_Steps < Window_Base
  158.    #--------------------------------------------------------------------------
  159.    # * Object Initialization
  160.    #--------------------------------------------------------------------------
  161.    def initialize
  162.      super(0, 0, 160, 64)
  163.      self.contents = Bitmap.new(width - 32, height - 32)
  164.      refresh
  165.    end
  166.    #--------------------------------------------------------------------------
  167.    # * Refresh
  168.    #--------------------------------------------------------------------------
  169.    def refresh
  170.      self.contents.clear
  171.      self.contents.font.color = system_color
  172.      self.contents.draw_text(0, 0, 50, 32, "Steps")
  173.      self.contents.font.color = normal_color
  174.      self.contents.draw_text(50, 0, 78, 32, $game_party.steps.to_s, 2)
  175.    end
  176.  end
Expand to see the code.



Create Scene_Map_Mods (optional)

In this section, we will add a script to enable using the "Q" key to open the journal

1. Open your script editor.

2. Add a new script called Scene_Map_Mods below Scene_Menu_Mods (above Main) in your script list.

3. In Scene_Map_Mods, add the following code:

  1. class Scene_Map
  2.       alias journal_update update
  3.      
  4.       def update
  5.         journal_update
  6.         if Input.trigger?(Input::L)
  7.           $scene = Scene_Journal.new(1)
  8.         end
  9.       end
  10.     end
Expand to see the code.


Create Journal Entries

Now that you have your Journal set up, you need to add journal entries to it.

1. Go to your Window_Journal script.

2. Find this section:
@data[1] = "Task 1"
@data[2] = "Task 2"
@data[3] = "Task 3"


3. Replace the tasks with your own. For example:
@data[1] = "Find treasure for Jake"
@data[2] = "Get milk for Ma"
@data[3] = "Destroy the world"



Name your Journal Switches

Now that your journal entries are added to your journal, you turn them on and off with switches.
Let's name our switches so we can find them easily while making our game.

[color="Red"]Note: The number assigned to each data entry needs to match the number assigned to each switch. For example, @data[2] = "Get milk for Ma" is turned on/off with switch 0002: Help Ma.[/color]

1. Add a new event to one of your maps.

2. Open the Event Commands window.

3. Click Control Switches, select the arrow next to Single and add the following by selecting each switch number, and typing in a name below:
0001: Help Jake
0002: Help Ma
0003: Destroy World


4. You can delete this event if you're not using it. Or leave it for an event you'll use. We just used it to add names to the switches.


Turn Entries On and Off

To turn entries on and off, simply turn the journal switches on or off in the Event Command window for an event on the map.


How do I add more journal entries?

To add new journal entries, you need to update your list of switches and your list of journal entires in Window_Journal.

1. Open the Window_Journal script and add another entry to the data[] array. for example, data[4] = "Save the world"

4. Exit the script editor, and open an event on your map. Add a new switch for the journal entry. (for example, 0004: Save World)


I don't want to start with switch 1

If you don't want to start your journal entry with switch 1, simply adjust the @offset variable in Window_Journal as follows:

Note: The following code assumes that you are starting at switch 100 instead of 1.

@offset = 99

I want to use a different windowskin for my journal

You can use a custom windowskin just for your journal window. For example, a parchment or book page, or just a different style of windowskin. You will need to make & place your custom windowskin in the GraphicsWindowskins folder in you project.

1) Right below the @offset variable, uncomment (delete the # sign) the following line:

self.windowskin = RPG::Cache.windowskin("RMXP4life_Wood.png")

2) Change the "RMXP4life_Wood.png" to the name of your custom windowskin.

Enjoy!
And let me know if anything can be explained better, or doesn't work like it should.
One question when you play this script on the game in the quest part will only show save the world or we can put more description?
Can you make a demo? Please... script is very good!
yeahh...demo demo!!

we want a demo :D

..
too much copying and pasting..XD

but yeah! very good script lambchop!
When i saw this script, i just fall love for it..

Those who asked DEMO, i just made it, cause i got free time. This link can be added to first post if lambshop just want.

Super Simple Journal Script DEMO
@Isopaha
Thank you so much, Isopaha. I added a link to the demo at the top of the page. :)

@Reaper-
Yep, you can make the entries much longer if you want. When you define your switches, you will probably want to use shorter descriptions because you don't have a lot of room in the Switch dialog box, but in the actual Journal script (Window_Journal), you can make them long enough to fit across the entire screen.
Ok thank you it looks great i'm going to try it
Nice script, and also very user friendly. Great job.
Where is Windows_Menu? there's only MenuStatus and it isn't there.
In Scene_Menu, replace

    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Save"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
Expand to see the code.


with

    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Save"
    s6 = "End Game"
    s7 = "Journal"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
Expand to see the code.


When that's done, go to the end of line 165, press enter and add

      when 6  # Journal selected
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Journal.new
Expand to see the code.


Great script lambchop, simplicity at it's best. I hope you don't mind me helping easydelta out :D
Blah, it works except it overlaps on my menu, do I need a Custom Menu? I don't think I have it in me @__@

And a error on line 168 NameError or something?
I can't really come up with something that counters that error, I'm still learning how to script after all. About the overlapping, you can change that by editing the Y positions of your windows. You can find them in Scene_Menu. After that you might need to change the height of some windows, just so they don't get cut off at the edge of your screen. You can find that in Window_something, where something is the name of the window you're trying to change. Hope this helps you ;)
EDIT: LMAO I forgot to add Scene_Journal -.-

It works perfectly! My first four quests are up, but there's no way to show they are completed? They just go away once switch is off?
Just turn the switch off once you have finished and it will go.
Hmm you could probably have a finished quest journal too using system. If you were really interested.
Nevermind..
Does this script work with the SDK?

Thanks.:)
Well i tried it and it does give some errors.
Love : I gave you this script but you said thanks,but don't use
and yes it workes with SDK :)
@dark-archangel:That time I used a version which doesn't allow me to use it but now it will,thanks.

EDIT:Where is the Window_Menu?
I think there's a little mystake,search in scene_menu:)
Love, look at Tassadar's post up there ^  (Starts with "In Scene_Menu, replace...)

Skip Lambchop's "Window_Menu" & "Update Scene_Menu" steps, and do Tassadar's instead.

Then continue with the "Create Journal Entries" step.

Did you download Isopaha's demo?

Be Well
Thanks Brew,but does it really work with SKD? Because I tried it and it didn't appear.

Please help.

Thanks in advance.
@Love:
Yes, I tried the script just earlier and it works fine with the SDK. I am using ver. 2.3, by the way.

Did you do the part Tassadar posted? If you did so, you should see a new command option added into your menu interface. The Journal display will be made accessible from there.

If not, you can try opening the journal directly by running a call script event with:

$scene = Scene_Journal.new
Expand to see the code.


The demo posted here too has an example to that.
Thanks but I think I'll just go with a game without a journal.
You give up too easy....  :)

I just tried it with the SDK2.3, and it works. 

However, since we modified Scene_Menu to add the journal, and the SDK also modifies
Scene_Menu, if the SDK is right above Window_Journal & Scene_Journal, the SDK menu wins.
So, we should just be able to move Scene_Menu below the SDK, so the bottom of your script editor should look like....

Scene_Debug
SDK
Scene_Menu
Window_Journal
Scene_Journal
Main

Give it a shot
This really works though there should be a option to check how many quests are completed as well as certain quests that trigger throughtout the story.
Yes, but that would reduce the Super Simpleness of it all... :)

Someone else mentioned that a second "Completed Quests" page would be cool.
And...  I'm planning on replacing the current Quest system I'm using with this one, so I'll take a stab at adding a "Right/Left Arrow" to switch "Current" & "Completed" views.

Some developers might also like to have a list of "Undiscovered" quests as well. That way if the player finished the game they can see if they missed anything.

Not sure what you mean by the second ER (Enhancement Request).
Each quest is triggered by setting a switch. You also use the same switch to test, in game, if that quest is active.

Be Well

[ EDIT ] I'm an idiot!  I didn't even notice in the "draw_item" method
[code]
      check = Bitmap.new("Graphics\\Pictures\\checkmark.png")
      self.contents.fill_rect(rect, Color.new(0,0,0,0))       
      if $game_switches[index + 200] == true
        self.contents.blt(0, @n, check, check.rect)
      else
        self.contents.draw_text(10, @n, 640, 32, "â €”
Thanks,Brew! Thanks! Thanks! Thanks! But just one problem,it overlaps my menu also I've done everything right,I added everything,can you please please please please please please tell me how to solve this problem?
in Scene_Menu, "main" method, edit the 'y' values to match this...
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 256                           # changed
    # Make steps window
    @steps_window = Window_Steps.new
    @steps_window.x = 0
    @steps_window.y = 352                           # changed
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416                           # changed
Expand to see the code.


Then, edit Window_Steps to look like:
#==============================================================================
# ** Window_Steps
#------------------------------------------------------------------------------
#  This window displays step count on the menu screen.
#==============================================================================

class Window_Steps < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 64)                                                   # changed
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 60, 32, "Steps")                       # changed
    self.contents.font.color = normal_color
    self.contents.draw_text(60, 0, 68, 32, $game_party.steps.to_s, 2)       # changed
  end
end
Expand to see the code.
It worked!!! Weeeeeee!!!!!! YAPPY!!!! I AM HAPPY!!! *party*

Thanks so much Brew! Thanks! Thanks!

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