#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Herbs Display by Blizzard
# Version: 2.0
# Type: Herbs Viewer
# Date: 22.1.2008
# Date v2.0: 24.1.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Compatibility:
#
# 99% compatible with SDK v1.x. 90% compatible with SDK v2.x. Should be
# compatible with everything else. WILL corrupt old savegames.
#
#
# Features:
#
# - define texts that should be displayed
# - easy change of the text that is being displayed
# - returns to the scene that called it
#
# new in 2.0:
#
# - now able to unlock pages during game play
# - display pages in unlocking order or a fixed order
# - add now page title and text instead of text only
#
#
# Explanation:
#
# This script will allow you to use a herb scene that shows some text that
# you define in advance. You can change the text displayed to any other of
# the predefined texts with one command.
#
#
# Configuration:
#
# Set up the configuration below and add your pictures to the folder you
# specified. Call the scene with following syntax:
#
# $scene = Scene_Herbs.new
#
# If you want to unlock another page, simply use a "Call Script" event
# command with following syntax:
#
# $game_system.unlock_herb(PAGE_NUMBER)
#
# PAGE_NUMBER - page number to unlock
#
#
# IMPORTANT NOTE:
#
# If one of your texts is too long to fit in one page, simply split it into
# two pages into two titles and unlock all the pages that you need. You can
# also use something like
#
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#==============================================================================
# module BlizzCFG
#==============================================================================
module BlizzCFG
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# font name in which the herb should be displayed
HERB_FONTNAME = 'Arial'
# font size in which the herb should be displayed
HERB_FONTSIZE = 22
# 0 = left, 1 = center, 2 = right
HERB_FONTALIGN = 0
# if you set this to true, pages will be displayed in the order you unlock them
HERB_ORDER = false
# entries, the template is ["Title", "Text"]
HERB_ENTRIES = [
["Herbs are very good for healing people", "This is the first entry."],
["Herbs are tasty", "Don't forget that the last entry does NOT have a comma after the string."],
["Green Herbs are bitter", "This text repeats itself. This text repeats itself. This text repeats itself. This text repeats itself. This text repeats itself. This text repeats itself. Oh yeah, this is entry 2."],
["Red Herbs are Spicy", "I have copy-pasted a text here that doesn't fit into one page to demonstrate how to split a text that is simply too long to fit in one page. L3X has his own will. He destroyed his own extern controller module due to the fact that his Tech4X AI was developed enough so he could do it. He would have never done it if it wasn't for the Scord virus attack. There is no known way to manipulate this cyborg from within anymore. As a model of the limited L3X1-MU5 series he has close combat abilities beyond those of a mere" +
"human. L3X himself was not originally implement with the Tech4X AI, he was fighting during Scord War 1 with the Tech3 AI. As a reward he was upgraded with the Tech4X AI due to his excellent performance in Scord War 1. Well, since this text"],
["This text is too long (continued)", "actually exactly fits into one page, I have added those last words to simply prolong it."]
]
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
#==============================================================================
# Game_System
#==============================================================================
class Game_System
attr_reader :herb
alias init_herb_later initialize
def initialize
init_herb_later
@herb = []
end
def unlock_herb(id)
@herb.push(id-1) unless @herb.include?(id-1)
end
end
#==============================================================================
# Window_HerbsDisplay
#==============================================================================
class Window_HerbsDisplay < Window_Base
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = BlizzCFG::HERB_FONTNAME
self.contents.font.size = BlizzCFG::HERB_FONTSIZE
@index, @herb = 0, $game_system.herb.clone
@herb.sort! unless BlizzCFG::HERB_ORDER
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(4, 416, 252, 32, 'Page', 2)
self.contents.draw_text(4, 416, 292, 32, (@index+1).to_s, 2)
self.contents.draw_text(4, 416, 600, 32, '/', 1)
self.contents.draw_text(312, 416, 292, 32, @herb.size.to_s)
return if @herb.size == 0
self.contents.draw_text(4, 0, 600, 32, BlizzCFG::HERB_ENTRIES[@herb[@index]][0], 1)
text = slice_text(BlizzCFG::HERB_ENTRIES[@herb[@index]][1], 592)
text.each_index {|i| self.contents.draw_text(4, (i+1)*32+16, 600, 32, text[i], BlizzCFG::HERB_FONTALIGN)}
end
def update
super
if Input.repeat?(Input::RIGHT)
if @herb.size == 0
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.cursor_se)
@index = (@index+1) % @herb.size
refresh
end
elsif Input.repeat?(Input::LEFT)
if @herb.size == 0
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.cursor_se)
@index = (@index+@herb.size-1) % @herb.size
refresh
end
end
end
end
#==============================================================================
# Scene_Herbs
#==============================================================================
class Scene_Herbs
def initialize
@scene = $scene.class
end
def main
@window = Window_HerbsDisplay.new
Graphics.transition
loop do
Graphics.update
Input.update
@window.update
break if Input.trigger?(Input::C) || Input.trigger?(Input::B)
end
$game_system.se_play($data_system.cancel_se)
Graphics.freeze
@window.dispose
$scene = @scene.new
end
end
other instructions inside script and I deleted the slice text window base edit as it's already in the journal script so this herbs one wouldn't work on it own only with the journal as well so put it underneath