Well, I'm not sure if it still works as it originally did, but it works how I imagined it works
#------------------------------------------------------------------------------#
# #
# Simple Biography System #
# Author: HungrySnake #
# #
# Requested by: DM Thanatos #
# #
# Instructions: #
# #
# I made this system so you don't need to spend variables. You can add an #
# Actor/NPC or anyone else by doing this: #
# New Event Command => 3th Tab => Advanced => Script... #
# Write: add_char_bio(name) #
# name = The name of the Actor/NPC or anthing else you wanna add (within #
# quotes). #
# #
# Make sure that you add the People to the biography scene in a specific #
# order: I.E. Ulrika is the second (in this case) actor in the ACTORS hash, #
# so I gotta add Ulrika as the Second person in-game. If you add (example) #
# Benett as the second person in-game, Benett will get the Biography of #
# Ulrika. #
# #
# Finally to call the Scene: #
# New Event Command => 3th Tab => Advanced => Script... #
# Write: $scene = Scene_Biography.new #
# #
# -----------------------------------------------------------------------------#
module BG
module Config
# --------------------------------------#
# Automatically show the biography of #
# the character as they get highlighted #
# --------------------------------------#
AUTO_SHOW_BIO = true
# -------------------------------------------------------------------------#
# The Array beneath is used to store the Characters' names in. If you #
# wanna add some new characters, insert them in the Array beneath but #
# make sure that the Item's number and the Hash number are the same. #
# Example: Ralph's number in the Array = 0, that's why Ralph gets #
# the number 0 in the ACTORS hash. #
# -------------------------------------------------------------------------#
ACTOR_ARRAY = ["Pots"]
CATA_STRING = "Biography" # Text to show to "Catalogue" string
CATA_COLOR = Color.new(0,180,180) # Color of the Catalogue string
ACTORS = { # << Don't delete!
# ---------------------------------------------------#
# Instructions: #
# #
# To create a new Array within the hash: #
# 3 => [ #
# Facegraphicfilename,facegraphicindex #
# "Your text here", #
# "Second line text", #
# "Ect", #
# ] #
# #
# Facegraphicfilename = The filename located in the #
# "Faces" folder, you can use default RTP faces too: #
# Like "Actor1" or "People1" ect. #
# facegraphicindex: The index of the face in the #
# facegraphicfile: I.E. Ralph has the index of 0 in #
# the "Actor1" file, Ulrika has the index of num 3 #
# ect. #
# #
# To start a new line you add a ',' after the quote. #
# When you want to add a new, empty line, you write: #
# "", #
# I've added the biographies of 2 character below. #
#----------------------------------------------------#
0 => [ # << Get's 0 because Ralph is the first person in the
# << array (counting in Ruby starts by zero).
"Actor1",0,
"Pots Talos is the son of the Keeper of",
"Truth, second highest esteem next to",
"the Keeper of Magic. Pots possesses",
"no magical talent, a shame to his",
"Father, instead turning to the ways of",
"the Rogue, and making a living by ",
"working for the Orgard Thieves guild.", # Empty Line
], # Remember to add a ',' after the biography of a character is finished
1 => [ # << Get's 1 because Ulrika is the second person which is
# << added to the array (with an event command).
"Evil",4,
#-------------------------------------<<<<<<<<<<<<<<<<<<<<
"Virgil Dal'Laman Mythos was born in a",
"small village south of the Solisteri ",
"Forest. Never being considered strong", # Empty Line
"or very handsome, he began his quiet",
"study of magic. Over the years Virgil",
"became quite adept at sorcery, to the",
"horror of his village. After a great",
"tragedy, Virgil began his quest to ",
"learn great magic.",
], # Remember to add a ',' after the biography of a character is finished
2 => [ # << Get's 2 because Rudolf is the second person which is
# << added to the array (with an event command).
] # Since this is (in this case) the last array in the hash, this one
# doesn't get's a ',' at the end. If you add a third array, make sure
# that you add a ',' to this one. The same goes if you add a fourth
# array, then you should put a ',' at the end of the third array.
} # << Don't delete!
# --------------------------------------------------------#
# Instructions Replacing: #
# #
# To replace the biography and the face of the character #
# make sure that there is another array created in the #
# hash beneath. #
# #
# To replace the biography: #
# New Event Command => 3th tab => Script... #
# Write: replace_char_bio(actorsid,replaceid) #
# actorsid = The number of the actor in the hash above. #
# replaceid = The number of the actor in the hash #
# beneath #
# #
# E.X. Replacing Ralph: #
# replace_char_bio(0,0) #
# The values on both sides are the same, so they get the #
# same number. #
# --------------------------------------------------------#
ACTORS_REPLACE = { # << Don't delete!
3 => [ # I just start counting by zero, I could set this constant to another
# number, but then the code in the event would be:
# replace_char_bio(0,randomnum)
# And of course, randomnum would then be a variable.
"Actor1",6,
#-------------------------------------<<<<<<<<<<<<<<<<<<<<
"Belkas Swordhand IV is the heir to",
"the Miner's End Mythril Mines, and",
"is known to be erratic, unorganized,",
"and most of all stubborn. Belkas is",
"usually tailed by his two goons, Arne,",
"and Jemman. He seems to be up to",
"something, after seeing his behavior",
"in the capital.",
], # Remember to add a ',' after the biography of a character is finished
4 => [
"facecses",0,
#-------------------------------------<<<<<<<<<<<<<<<<<<<<
"Raziel the Summoner is one of the",
"Gauf and a specialist in Time magic",
"and summoning. His magic is dwarfed",
"in comparison to Zacharael's, but to",
"the magic in the present day, fighting",
"Raziel would be comparible to fight-",
"ing more than half of the Circle of",
"Twelve. He was killed in battle by",
"the Children of Light while attempt-",
"ing to summon an Abyssal army to",
"raze Greyhem to the ground.",
], # Remember to add a ',' after the biography of a character is finished
5 => [ # << Get's 1 because Ulrika is the second person which is
# << added to the array (with an event command).
"Evil",4,
#-------------------------------------<<<<<<<<<<<<<<<<<<<<
"Virgil Dal'Laman Mythos was born in a",
"small village south of the Solisteri ",
"Forest. Never being considered strong", # Empty Line
"or very handsome, he began his quiet",
"study of magic. After a great tragedy",
"Virgil began his quest to further his",
"knowledge in greater magic. Virgil is",
"currently in Sorbithia helping the",
"Circle of Twelve repair the damage",
"wrought by Zacharael.",
], # Remember to add a ',' after the biography of a character is finished
6 => [
"Actor2",0,
#-------------------------------------<<<<<<<<<<<<<<<<<<<<
"Quathorn Vaias is an Adept at the",
"schools in Sorbithia, he has made new",
"discoveries in magic that are so",
"advanced that he is considered a",
"prodigy. He is able to call creatures",
"from other planes, much like Raziel,",
"a feat that hasn't been seen in",
"hundreds of years. He is most likely",
"the Warpriest, Amon'Quel, reborn.",
],
7 => [
"Evil",6,
#-------------------------------------<<<<<<<<<<<<<<<<<<<<
"Carlo Scarpa's was the Master of the",
"Adept on the Circle of Twelve, to the",
"dismay of Griswold and Vaeviticus, it",
"turns out that he was Zacharael, and",
"when the Children of Light opened the",
"Tower of Amon'Quel, he saw his oppur-",
"tunity. After revealing himself he",
"was responsible for the deaths of five",
"students, and the Master of the Red,",
"Kahr Valen.",
], # Remember to add a ',' after the biography of a character is finished
8 => [
"Evil",3,
#-------------------------------------<<<<<<<<<<<<<<<<<<<<
"Kahr Vahlen was the Master of the Red",
"on the Circle of Twelve. Holding the",
"position for over five years now, Kahr",
"was charged with the training of the",
"Adept in the ways of enhancing ones",
"abilities with spells. He was murdered",
"by Zacharael when he revealed himself.",
], # Remember to add a ',' after the biography of a character is finished
9 => [
"Noir10",0,
#-------------------------------------<<<<<<<<<<<<<<<<<<<<
"Ledonel was known as the Warmage",
"of Porthulsti, the only person to",
"rival his magic was Zacharael. ",
"Ledonel and Amon'Quel were key",
"members in Arthur's Rebellion and",
"responsible for creating Sorbithia",
"and Eldrethen. He went mad after",
"Eldrethen turned into the City of",
"the Dead, and attempted to destroy",
"the Children of Light, but was ult-",
"imately defeated in his tower.",
] # Remember to add a ',' after the biography of a character is finished
# unless it's the last one in the hash.
} # << Don't delete!
end
end
class Game_System
alias ma_biography_initialize initialize unless $@
attr_accessor :actor_array
attr_accessor :actor_text
def initialize(*args)
@actor_array = BG::Config::ACTOR_ARRAY.clone
@actor_text = BG::Config::ACTORS.clone
return ma_biography_initialize(*args)
end
end
class Game_Interpreter
def add_char_bio(name)
$game_system.actor_array.push name
end
def replace_char_bio(actorsid,replaceid)
$game_system.actor_text[actorsid] = BG::Config::ACTORS_REPLACE[replaceid]
end
end
class Scene_Biography < Scene_Base
include BG::Config
def start
create_menu_background
super
create_actor_commandwindow
create_text_window
@last_actor_window_index = @actor_window.index
@auto_show_bio = AUTO_SHOW_BIO
draw_actor_stuff if @auto_show_bio
end
def create_actor_commandwindow
@actor_window = Window_Command.new(180,$game_system.actor_array)
@actor_window.index = 0
@actor_window.y = 24 + 32
@actor_window.height = Graphics.height - (24+32)
end
def create_text_window
@window_textbio = Window_Base.new(180, 0, 544 - 180, Graphics.height)
@text_window = Window_Base.new(0, 0, 180, 24 + 32)
@text_window.contents.font.color = CATA_COLOR
@text_window.contents.draw_text((180/2) - (120/2), 0, 120, 24, CATA_STRING)
end
def update_actor_command_window
if Input.trigger?(Input::B)
return $scene = Scene_Map.new
end
if @auto_show_bio
if @last_actor_window_index != @actor_window.index
@last_actor_window_index = @actor_window.index
draw_actor_stuff
end
else
if Input.trigger?(Input::C)
Sound.play_decision
draw_actor_stuff
end
end
end
def draw_actor_stuff
@window_textbio.contents.clear
index = @actor_window.index
txtarr = $game_system.actor_text[index]
tx_width = @window_textbio.contents.width
@window_textbio.draw_face(txtarr[0],txtarr[1],@window_textbio.width/2-48,0)
for i in 2..txtarr.size
y = i * 24 + (96 - 24)
@window_textbio.contents.draw_text(0, y, tx_width, 24, txtarr[i])
end
end
def update
@window_textbio.update
@actor_window.update
@text_window.update
update_actor_command_window
update_menu_background
end
def terminate
@window_textbio.dispose
@actor_window.dispose
@text_window.dispose
dispose_menu_background
end
end
I've added some functionality so it now lets you automatically show the biography of the character highlighted ( I found it wasteful to continuously click on the actors just to get their biography up ), and changed the display text algorithm so it doesn't redraw the actor's face for every line of text, dramatically reducing the load times.
I've tried to keep it so the add_char_bio and replace_char_bio should be the same, so you don't have to redo the events that are already working.
Well, I think it's the same