While always possible to have multiple diaries in the script, this addon gives an easy way to create and access them for the non-scripter. They are not accessible through the menu, only through events. So you can use items to call them, for instance, or a common event on key press. Detailed instructions are included in the header and the editable region:
#==============================================================================
# Multiple Diaries
# Addon to Diary 1.0
# Version: 1.0
# Author: modern algebra (rmrk.net)
# Date: January 17, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# This allows for an built-in way to create and access multiple diaries.
# Unlike the main diary, this is a little simpler as it does not allow for
# access through the menu or anything fancy, so it has to be called through
# an event. Entries for these diaries are also set up in the default way
# through the main script
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
#
# Place this script below the main Diary script, but keep it above Main
#
# To create the new diaries, go down to line 66 and read the instructions
# located there. Keep in mind what order you creat them, as that is how you
# will access them. The main diary will always have the ID 0, so each of the
# new diaries you create will have IDs starting from 1. So, the first one you
# make has ID 1, the second one ID 2, and so on.
#
# You can then write entries or call the diaries by using their IDs in these
# codes, which you put in the call script event command:
#
# write_diary_entry (entry_id, diary_id)
# entry_id : this is an ID of an entry set up in the database, or it
# could be an entry object itself if you have set one up in an
# event (which is NOT recommended, btw).
# diary_id : this is the ID of the diary you want to call. It could also
# be the diary object itself, if you wanted, but I don't see any
# reason why that would be easier than the ID. If left blank, it
# defaults to the main diary that you set up through the main script.
#
# call_diary (diary_id)
# diary_id : this is the ID of the diary you want to call. It could also
# be the diary object itself. If left blank, it defaults to the main
# diary that you set up through the main script.
#==============================================================================
#==============================================================================
# ** Game System
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new instance variable - diaries
# aliased method - initialize
#==============================================================================
class Game_System
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_reader :diaries
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias ma_joy_cokbok_diry_4kw1 initialize
def initialize (*args)
# Run Original Method
ma_joy_cokbok_diry_4kw1 (*args)
@diaries = [@diary]
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# EDITABLE REGION
#``````````````````````````````````````````````````````````````````````````
# Make new diaries Like this:
# name = "name of diary"
# font_name = "name of font" OR ["font_1", "font_2", ..., "font_n"]
# back_pic = "name of Background Image
# page_rects = [Rect.new (x, y, w, h), Rect.new (x, y, w, )]
# w, h : width, height
# num_rects = [[Rect.new (x, y, w, h), align], [Rect.new (x, y, w, h), align]]
# align : 0 => Left, 1 => Middle, 2 => Right
#
# You must define all of the following, and then you can make it:
# @diaries.push (Diary.new (name, font_name, back_pic, page_rects, num_rects))
#
# I should note, if you do not define arguments, then they resorts to
# the default setting you've set up. However, you can't "skip" arguments.
# If you want back_pic to be default but want to change page_rects, then
# you will need to define back_pic anyway. However, if you wanted back_pic,
# page_rects, and num_rects all to be default, then you would only need to
# define name and font_name and create it like this:
# @diaries.push (Game_Diary.new (name, font_name))
name = "Cookbook"
@diaries.push (Game_Diary.new (name))
#``````````````````````````````````````````````````````````````````````````
# END EDITABLE REGION
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
end
end
#==============================================================================
# ** Game_Interpreter
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased methods - call_diary, write_diary_entry
#==============================================================================
class Game_Interpreter
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Write Diary Entry
# entry : either an Game_DiaryEntry object or an entry ID
# diary : the Game_Diary object to write it to
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias ma_mult_diry_writeentry_6hf2 write_diary_entry
def write_diary_entry (entry, diary = $game_system.diary, *args)
diary = $game_system.diaries[diary] if diary.is_a? (Integer)
ma_mult_diry_writeentry_6hf2 (entry, diary, *args)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Call Diary
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mjoy_clldiry_multiples_8kd2 call_diary
def call_diary (diary = $game_system.diary, *args)
diary = $game_system.diaries[diary] if diary.is_a? (Integer)
mjoy_clldiry_multiples_8kd2 (diary, *args)
end
end