To learn more about how to use my script please read the instructions embedded in it.
Note:
The demo includes examples of how you can easily add entry lines to an existing date.
It will automatically create a new date entry if the current date is different from the previous one.
The Scripts - Version 1.0.5
VX
Code:
# * KDiurnalis VX
# Scripter : Kyonides Arkanthes
# v 1.0.5 - 2022-06-16
# * Non Plug & Play Script * #
# The Party's Journal Script!
# Tweak this script's CONSTANTS in order to customize the Journal Menu's GUI.
# You can find them under the KDiurnalis module.
# * Overwritten Method * #
# Scene_File#do_load
# * Script Calls * #
# - Open Journal Scene - 2 Options
# $scene = KDiurnalis::Scene.new
# KDiurnalis.open!
# - Add New Journal Page Steps - #
# -- Step 1
# Location: can be replaced with a "String" or :map for current map name.
# $game_party.add_journal_entry("Title", Location)
# -- Step 2
# Add as many Message Windows and lines of text as you wish!
# -- Step 3
# - Stop Using Message Windows as Journal Entry's Page Contents
# Simply stop adding any more message windows!
module KDiurnalis
LOAD_OPENS_JOURNAL = true
SHOW_DATES = nil
# Place the Backdrop in the Pictures directory.
# Options: "Filename" or nil
BACKDROP = "backdrop circles blue"
TITLE = "%s's Journal"
TITLE_ALIGN = 1
NO_ENTRY = "No Entry Found"
module Start
TITLE = "My New Adventure"
LOCATION = "Home"
TEXT = []
TEXT << "My history begins today."
TEXT << "I am very excited indeed."
end
PAGES_FOUND = "%s Pages Found"
PAGES_LABEL = "Page %s/%s"
PAGES_LABEL_ALIGN = 2
HELP_WIN_OPACITY = 160
# Window's Coordinates = [X, Y, Width, Height, Opacity]
LIST_WIN_COORD = [8, 76, 160, 320, 160]
DUMMY_WIN_COORD = [176, 76, 360, 84, 160]
INFO_WIN_COORD = [176, 76, 360, 320, 160]
# * End of Setup * #
extend self
attr_accessor :use_message_window
def open!() $scene = Scene.new end
def after_load_scene
LOAD_OPENS_JOURNAL ? open! : $scene = Scene_Map.new
end
def end_of_entry!() @use_message_window = nil end
alias :end_of_message! :end_of_entry!
class KDJournal
def initialize
@dates = []
date = KDDate.new
entry = KDEntry.new(Start::TITLE.dup)
entry.location = Start::LOCATION
entry.texts = Start::TEXT.dup
date.add_entry(entry)
add_date(date)
end
def add_date(date)
@dates.unshift(date)
@last_date = date
end
def map(&blk) @dates.map(&blk) end
def last() @dates[-1] end
def [](pos) @dates[pos] end
def empty?() @dates.empty? end
def any?() @dates.any? end
def size() @dates.size end
attr_reader :dates, :last_date
end
def open_last_entry
if SHOW_DATES
date = @list_window.item
@info_window.show_entries(date.entries)
else
entries = $game_party.journal_entries.map{|date| date.entries }
entries = entries.flatten
@info_window.show_entries(entries)
end
@stage = :info
end
def terminate
@help_window.dispose
@list_window.dispose
@dummy_window.dispose
@info_window.dispose
@backdrop.bitmap.dispose
@backdrop.dispose
end
def update
case @stage
when :list
update_list
when :info
update_info
end
end
def update_list
@list_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
return
elsif Input.trigger?(Input::C)
Sound.play_decision
@dummy_window.visible = false
open_last_entry
end
end
def update_info
@info_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
unless SHOW_DATES
$scene = Scene_Map.new
return
end
@info_window.visible = false
@info_window.clear
@dummy_window.visible = true
@stage = :list
end
end
end
end
class Game_Party
alias :kyon_diurnalis_gm_pty_init :initialize
def initialize
kyon_diurnalis_gm_pty_init
@journal_entries = KDiurnalis::KDJournal.new
end
def add_journal_entry(title, place)
place = $game_map.map_name if place == :map
date = @journal_entries.last_date
time = Time.now
KDiurnalis.use_message_window = true
entry = KDiurnalis::KDEntry.new(title)
entry.location = place
if date and date.same_date?(time.year, time.month, time.day)
date.add_entry(entry)
else
date = KDiurnalis::KDDate.new
date.add_entry(entry)
@journal_entries.add_date(date)
end
end
def total_journal_entries?(n)
@journal_entries.size == n
end
def last_journal_entry_pages?(n)
@journal_entries.last.entries.size == n
end
attr_reader :journal_entries
end
class Game_Map
alias :kyon_diurnalis_gm_map_setup :setup
def setup(map_id)
kyon_diurnalis_gm_map_setup(map_id)
@map_name = load_data("Data/MapInfos.rvdata")[map_id].name
end
attr_reader :map_name
end
class Game_Event
def name() @event.name end
def name=(text) @event.name = text end
end
class Game_Interpreter
alias :kyon_diurnalis_gm_int_comm_101 :command_101
def process_journal_entries
date = $game_party.journal_entries.last_date
entry = date.last_entry
codes = [101, 401]
command = @list[@index]
while codes.include?(command.code)
line = command.parameters[0]
line.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
line.gsub!(/\\E\[([0-9]+)\]/i) { $game_map.events[$1.to_i].name }
entry.texts << line if command.code == 401
@index += 1
command = @list[@index]
end
KDiurnalis.end_of_message!
false
end
def command_101
if KDiurnalis.use_message_window
process_journal_entries
else
kyon_diurnalis_gm_int_comm_101
end
end
end
class Scene_File
def do_load
file = File.open(@savefile_windows[@index].filename, "rb")
read_save_data(file)
file.close
KDiurnalis.after_load_scene
RPG::BGM.fade(1500)
Graphics.fadeout(60)
Graphics.wait(40)
return if KDiurnalis.show_last_entry
@last_bgm.play
@last_bgs.play
end
end
ACE
Code:
# * KDiurnalis ACE
# Scripter : Kyonides Arkanthes
# v 1.0.5 - 2022-06-16
# * Non Plug & Play Script * #
# The Party's Journal Script!
# Tweak this script's CONSTANTS in order to customize the Journal Menu's GUI.
# You can find them under the KDiurnalis module.
# - Open Journal Scene - 2 Options
# $scene = KDiurnalis::Scene.new
# KDiurnalis.open!
# - Add New Journal Page Steps - #
# -- Step 1
# Location: can be replaced with a "String" or :map for current map name.
# $game_party.add_journal_entry("Title", Location)
# -- Step 2
# Add as many Message Windows and lines of text as you wish!
# -- Step 3
# - Stop Using Message Windows as Journal Entry's Page Contents
# Simply stop adding any more message windows!
module KDiurnalis
LOAD_OPENS_JOURNAL = true
SHOW_DATES = nil
# Place the Backdrop in the Titles1 directory.
# Options: "Filename" or nil
BACKDROP = "backdrop circles blue"
TITLE = "%s's Journal"
TITLE_ALIGN = 1
NO_ENTRY = "No Entry Found"
module Start
TITLE = "My New Adventure"
LOCATION = "Home"
TEXT = []
TEXT << "My history begins today."
TEXT << "I am very excited indeed."
end
PAGES_FOUND = "%s Pages Found"
PAGES_LABEL = "Page %s/%s"
PAGES_LABEL_ALIGN = 2
HELP_WIN_OPACITY = 160
# Window's Coordinates = [X, Y, Width, Height, Opacity]
LIST_WIN_COORD = [8, 76, 160, 320, 160]
DUMMY_WIN_COORD = [176, 76, 360, 84, 160]
INFO_WIN_COORD = [176, 76, 360, 320, 160]
# * End of Setup * #
extend self
attr_accessor :use_message_window
def open!() SceneManager.goto(Scene) end
def after_load_scene
LOAD_OPENS_JOURNAL ? open! : SceneManager.goto(Scene_Map)
end
def end_of_entry!() @use_message_window = nil end
alias :end_of_message! :end_of_entry!
class KDJournal
def initialize
@dates = []
date = KDDate.new
entry = KDEntry.new(Start::TITLE.dup)
entry.location = Start::LOCATION
entry.texts = Start::TEXT.dup
date.add_entry(entry)
add_date(date)
end
def add_date(date)
@dates.unshift(date)
@last_date = date
end
def map(&blk) @dates.map(&blk) end
def last() @dates[-1] end
def [](pos) @dates[pos] end
def empty?() @dates.empty? end
def any?() @dates.any? end
def size() @dates.size end
attr_reader :dates, :last_date
end
def open_last_entry
if SHOW_DATES
date = @list_window.item
@info_window.show_entries(date.entries)
else
entries = $game_party.journal_entries.map{|date| date.entries }
entries = entries.flatten
@info_window.show_entries(entries)
end
@stage = :info
end
def terminate
super
@backdrop.bitmap.dispose
@backdrop.dispose
end
def update
Graphics.update
Input.update
case @stage
when :list
update_list
when :info
update_info
end
end
def update_list
@list_window.update
if Input.trigger?(:B)
Sound.play_cancel
SceneManager.call(Scene_Map)
return
elsif Input.trigger?(:C)
Sound.play_ok
@dummy_window.visible = false
open_last_entry
end
end
def update_info
@info_window.update
if Input.trigger?(:B)
Sound.play_cancel
unless SHOW_DATES
SceneManager.call(Scene_Map)
return
end
@info_window.visible = false
@info_window.clear
@dummy_window.visible = true
@stage = :list
end
end
end
end
class Game_Party
alias :kyon_diurnalis_gm_pty_init :initialize
def initialize
kyon_diurnalis_gm_pty_init
@journal_entries = KDiurnalis::KDJournal.new
end
def add_journal_entry(title, place)
place = $game_map.display_name if place == :map
date = @journal_entries.last_date
time = Time.now
KDiurnalis.use_message_window = true
entry = KDiurnalis::KDEntry.new(title)
entry.location = place
if date and date.same_date?(time.year, time.month, time.day)
date.add_entry(entry)
else
date = KDiurnalis::KDDate.new
date.add_entry(entry)
@journal_entries.add_date(date)
end
end
def total_journal_entries?(n)
@journal_entries.size == n
end
def last_journal_entry_pages?(n)
@journal_entries.last.entries.size == n
end
attr_reader :journal_entries
end
class Game_Event
def name() @event.name end
def name=(text) @event.name = text end
end
class Game_Interpreter
alias :kyon_diurnalis_gm_int_comm_101 :command_101
def process_journal_entries
@index += 1
date = $game_party.journal_entries.last_date
entry = date.last_entry
codes = [101, 401]
command = @list[@index]
while codes.include?(command.code)
if command.code == 401
line = command.parameters[0]
line.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
line.gsub!(/\\E\[([0-9]+)\]/i) { $game_map.events[$1.to_i].name }
entry.texts << line
end
@index += 1
command = @list[@index]
end
@index -= 1
KDiurnalis.end_of_message!
true
end
def command_101
if KDiurnalis.use_message_window
process_journal_entries
else
kyon_diurnalis_gm_int_comm_101
end
end
end
class Scene_Load
def on_load_success
Sound.play_load
fadeout_all
$game_system.on_after_load
KDiurnalis.after_load_scene
end
end