I thought this script by Rune was really useful, but I really wanted it to include the characters' battler images, so I took a suggestion by Mr. Wiggles, added a few features, and made it easier to use.
=begin
=================================
Character biography script (revised with pictures)
By Rune
Revision 1.3 by statesman88
Expanded from Mr. Wiggles' revision
=================================
Introduction
=================================
This is a script that calls a window that displays different
aspects about a character... like their age, height, weight,
gender etc. These can be changed though. This script is
free to use and edit as long as credit is given to me.
=================================
Edits
=================================
-1.3: Fixed $defaultfontsize error
-Deleted Biography subsection, since I don't think you need
a Biography and a History
-Added the battler image of the actor. If the image is small
enough, it will be doubled in size. (To be doubled, the
original image must fit within one of two boxes: 224x144
px OR 112x208 px.)
=================================
Instructions
=================================
Insert this script above main, and call it Scene_Biography.
Then, ctrl + f to search for the different aspects of
characters you wish to change, so for a character's age,
you would search biog_age, and for gender you would
search, biog_gender. Each aspect is listed in the
character's order in the database, and the different stats
of each character are set at default to (what I think of)
the default 8 characters.
Once the script is in your game, you may wish to add it
to your menu. To do so... in Scene_Menu make a new
option, and add it into the comand_window list. Then go
down to the first time it says "when 0", 'when 1" etc and
copy and paste the status, equip or skill responses. Then
go all the way down to where it says "when 1", "when 2"
etc, and type this.
$game_system.se_play($data_system.decision_se)
$scene = Scene_Biography.new(@status_window.index)
If you don't know how to do that then just tell me, and
i'll help you out, and if you need any more help,
PM me ;)
=================================
Any last words?
=================================
Again PM me if you need any help in changing the text or
anything like that, though even non-scripters should be
able to do that. And enjoy ;)
=end
class Window_Base
def biog_color
return Color.new(0, 255, 160)
end
def draw_actor_name(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, actor.name)
end
end
class Window_Biography < Window_Base
def initialize(actor)
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = Font.default_name
self.contents.font.size = Font.default_size
# Rune's code; may be for compatibility with a certain message system?
# self.contents.font.name = $defaultfonttype
# self.contents.font.size = $defaultfontsize
@actor = actor
refresh
end
def refresh
self.contents.font.color = biog_color
self.contents.draw_text(0, 0, 80, 32, "Name:")
self.contents.draw_text(0, 32, 80, 32, "Age:")
self.contents.draw_text(0, 64, 80, 32, "Gender:")
self.contents.draw_text(0, 96, 80, 32, "Race:")
self.contents.draw_text(0, 128, 80, 32, "Height:")
self.contents.draw_text(0, 160, 80, 32, "Weight:")
self.contents.draw_text(0, 192, 80, 32, "Weapon:")
self.contents.draw_text(0, 224, 80, 32, "From:")
self.contents.draw_text(0, 256, 80, 32, "Specialty:")
self.contents.draw_text(0, 288, 80, 32, "History:")
self.contents.font.color = normal_color
draw_actor_name(@actor, 96, 0)
biog_age
biog_gender
biog_race
biog_height
biog_weight
biog_weapon
biog_from
biog_specialty
biog_history
biog_pic
end
def biog_age
case(@actor.id)
when 1
self.contents.draw_text(96, 32, 64, 32, "19")
when 2
self.contents.draw_text(96, 32, 64, 32, "21")
when 3
self.contents.draw_text(96, 32, 64, 32, "30")
when 4
self.contents.draw_text(96, 32, 64, 32, "20")
when 5
self.contents.draw_text(96, 32, 64, 32, "17")
when 6
self.contents.draw_text(96, 32, 64, 32, "25")
when 7
self.contents.draw_text(96, 32, 64, 32, "19")
when 8
self.contents.draw_text(96, 32, 64, 32, "22")
end
end
def biog_gender
case(@actor.id)
when 1
self.contents.draw_text(96, 64, 64, 32, "Male")
when 2
self.contents.draw_text(96, 64, 64, 32, "Male")
when 3
self.contents.draw_text(96, 64, 64, 32, "Male")
when 4
self.contents.draw_text(96, 64, 96, 32, "Female")
when 5
self.contents.draw_text(96, 64, 96, 32, "Female")
when 6
self.contents.draw_text(96, 64, 96, 32, "Male")
when 7
self.contents.draw_text(96, 64, 96, 32, "Female")
when 8
self.contents.draw_text(96, 64, 96, 32, "Female")
end
end
def biog_race
case(@actor.id)
when 1
self.contents.draw_text(96, 96, 96, 32, "Human")
when 2
self.contents.draw_text(96, 96, 96, 32, "Human")
when 3
self.contents.draw_text(96, 96, 96, 32, "Dwarf")
when 4
self.contents.draw_text(96, 96, 96, 32, "Human")
when 5
self.contents.draw_text(96, 96, 96, 32, "Elf")
when 6
self.contents.draw_text(96, 96, 96, 32, "Human")
when 7
self.contents.draw_text(96, 96, 96, 32, "Human")
when 8
self.contents.draw_text(96, 96, 96, 32, "Human")
end
end
def biog_height
case(@actor.id)
when 1
self.contents.draw_text(96, 128, 64, 32, "5' 11''")
when 2
self.contents.draw_text(96, 128, 64, 32, "6' 1''")
when 3
self.contents.draw_text(96, 128, 64, 32, "3' 4''")
when 4
self.contents.draw_text(96, 128, 64, 32, "5' 7''")
when 5
self.contents.draw_text(96, 128, 64, 32, "2' 9''")
when 6
self.contents.draw_text(96, 128, 64, 32, "6' 0''")
when 7
self.contents.draw_text(96, 128, 64, 32, "5' 8''")
when 8
self.contents.draw_text(96, 128, 64, 32, "5' 9''")
end
end
def biog_weight
case(@actor.id)
when 1
self.contents.draw_text(96, 160, 128, 32, "11 st 4 lbs")
when 2
self.contents.draw_text(96, 160, 128, 32, "11 st 7 lbs")
when 3
self.contents.draw_text(96, 160, 128, 32, "6 st 7 lbs")
when 4
self.contents.draw_text(96, 160, 128, 32, "10 st 12 lbs")
when 5
self.contents.draw_text(96, 160, 128, 32, "6 st 0 lbs")
when 6
self.contents.draw_text(96, 160, 128, 32, "11 st 6 lbs")
when 7
self.contents.draw_text(96, 160, 128, 32, "11 st 1 lbs")
when 8
self.contents.draw_text(96, 160, 128, 32, "11 st 2 lbs")
end
end
def biog_weapon
case(@actor.id)
when 1
self.contents.draw_text(96, 192, 128, 32, "Sword")
when 2
self.contents.draw_text(96, 192, 128, 32, "Spear")
when 3
self.contents.draw_text(96, 192, 96, 32, "Axe")
when 4
self.contents.draw_text(96, 192, 160, 32, "Knives/Daggers")
when 5
self.contents.draw_text(96, 192, 160, 32, "Bow/Arrows")
when 6
self.contents.draw_text(96, 192, 96, 32, "Guns")
when 7
self.contents.draw_text(96, 192, 96, 32, "Mace")
when 8
self.contents.draw_text(96, 192, 96, 32, "Rod")
end
end
def biog_from
case(@actor.id)
when 1
self.contents.draw_text(96, 224, 160, 32, "Random Town")
when 2
self.contents.draw_text(96, 224, 160, 32, "Random Castle")
when 3
self.contents.draw_text(96, 224, 160, 32, "Random City")
when 4
self.contents.draw_text(96, 224, 160, 32, "Random Village")
when 5
self.contents.draw_text(96, 224, 160, 32, "Random Elf Village")
when 6
self.contents.draw_text(96, 224, 160, 32, "Random City")
when 7
self.contents.draw_text(96, 224, 160, 32, "Random Village")
when 8
self.contents.draw_text(96, 224, 160, 32, "Random Town")
end
end
def biog_specialty
case(@actor.id)
when 1
self.contents.draw_text(96, 256, 160, 32, "Swordplay")
when 2
self.contents.draw_text(96, 256, 160, 32, "Lanceplay")
when 3
self.contents.draw_text(96, 256, 160, 32, "Axeplay")
when 4
self.contents.draw_text(96, 256, 160, 32, "Robbery")
when 5
self.contents.draw_text(96, 256, 160, 32, "Archery")
when 6
self.contents.draw_text(96, 256, 160, 32, "Gunnery")
when 7
self.contents.draw_text(96, 256, 160, 32, "White magic")
when 8
self.contents.draw_text(96, 256, 160, 32, "Black Magic")
end
end
def biog_history
case(@actor.id)
when 1
self.contents.draw_text(96, 288, 288, 32, "Insert first line of history here")
self.contents.draw_text(96, 320, 288, 32, "Insert second line of history here")
self.contents.draw_text(96, 352, 288, 32, "Insert third line of history here")
self.contents.draw_text(96, 384, 288, 32, "Insert fourth line of history here")
self.contents.draw_text(96, 416, 288, 32, "Insert fifth line of history here")
when 2
self.contents.draw_text(96, 288, 288, 32, "Insert first line of history here")
self.contents.draw_text(96, 320, 288, 32, "Insert second line of history here")
self.contents.draw_text(96, 352, 288, 32, "Insert third line of history here")
self.contents.draw_text(96, 384, 288, 32, "Insert fourth line of history here")
self.contents.draw_text(96, 416, 288, 32, "Insert fifth line of history here")
when 3
self.contents.draw_text(96, 288, 288, 32, "Insert first line of history here")
self.contents.draw_text(96, 320, 288, 32, "Insert second line of history here")
self.contents.draw_text(96, 352, 288, 32, "Insert third line of history here")
self.contents.draw_text(96, 384, 288, 32, "Insert fourth line of history here")
self.contents.draw_text(96, 416, 288, 32, "Insert fifth line of history here")
when 4
self.contents.draw_text(96, 288, 288, 32, "Insert first line of history here")
self.contents.draw_text(96, 320, 288, 32, "Insert second line of history here")
self.contents.draw_text(96, 352, 288, 32, "Insert third line of history here")
self.contents.draw_text(96, 384, 288, 32, "Insert fourth line of history here")
self.contents.draw_text(96, 416, 288, 32, "Insert fifth line of history here")
when 5
self.contents.draw_text(96, 288, 288, 32, "Insert first line of history here")
self.contents.draw_text(96, 320, 288, 32, "Insert second line of history here")
self.contents.draw_text(96, 352, 288, 32, "Insert third line of history here")
self.contents.draw_text(96, 384, 288, 32, "Insert fourth line of history here")
self.contents.draw_text(96, 416, 288, 32, "Insert fifth line of history here")
when 6
self.contents.draw_text(96, 288, 288, 32, "Insert first line of history here")
self.contents.draw_text(96, 320, 288, 32, "Insert second line of history here")
self.contents.draw_text(96, 352, 288, 32, "Insert third line of history here")
self.contents.draw_text(96, 384, 288, 32, "Insert fourth line of history here")
self.contents.draw_text(96, 416, 288, 32, "Insert fifth line of history here")
when 7
self.contents.draw_text(96, 288, 288, 32, "Insert first line of history here")
self.contents.draw_text(96, 320, 288, 32, "Insert second line of history here")
self.contents.draw_text(96, 352, 288, 32, "Insert third line of history here")
self.contents.draw_text(96, 384, 288, 32, "Insert fourth line of history here")
self.contents.draw_text(96, 416, 288, 32, "Insert fifth line of history here")
when 8
self.contents.draw_text(96, 288, 288, 32, "Insert first line of history here")
self.contents.draw_text(96, 320, 288, 32, "Insert second line of history here")
self.contents.draw_text(96, 352, 288, 32, "Insert third line of history here")
self.contents.draw_text(96, 384, 288, 32, "Insert fourth line of history here")
self.contents.draw_text(96, 416, 288, 32, "Insert fifth line of history here")
end
end
def biog_pic
bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
@biogpicwidth = bitmap.width * 2
@biogpicheight = bitmap.height * 2
# Prepare to align image with upper right corner (32 pixel margin)
@biogpicx = 602 - @biogpicwidth
@bigbiogpicx = 602 - bitmap.width
# Checks whether the image is small enough to be doubled; it will
# only use stretch_blt if it fits into 224x144 px OR 112x208 px
# before being enlarged.
if @biogpicwidth > 224 then
if @biogpicheight > 288 then
self.contents.blt(@bigbiogpicx, 32, bitmap.width, bitmap.height)
else
if @biogpicwidth > 448 then
self.contents.blt(@bigbiogpicx, 32, bitmap.width, bitmap.height)
else
self.contents.stretch_blt(Rect.new(@biogpicx, 32, @biogpicwidth, @biogpicheight), bitmap, Rect.new(0, 0, bitmap.width, bitmap.height))
end
end
else
if @biogpicheight > 416 then
self.contents.blt(@bigbiogpicx, 32, bitmap.width, bitmap.height)
else
self.contents.stretch_blt(Rect.new(@biogpicx, 32, @biogpicwidth, @biogpicheight), bitmap, Rect.new(0, 0, bitmap.width, bitmap.height))
end
end
end
end
class Scene_Biography
def initialize(actor_index = 0)
@actor_index = actor_index
end
def main
@actor = $game_party.actors[@actor_index]
@biog_window = Window_Biography.new(@actor)
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@biog_window.dispose
end
def update
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(3)
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Biography.new(@actor_index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Biography.new(@actor_index)
return
end
end
end
EDIT: I attached a screenshot of the biography page. Also, I here's an example of how I customized my Scene_Menu to add the Biographies command. I removed the "steps taken" window to make room, but there's a little black space... there's probably a more elegant way to do this. For myself, I plan to add another menu option referencing a Quests script, or something like that. I'm largely providing this so that beginners can copy and paste, as long as nothing else has edited the Scene_Menu script.
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# This class performs menu screen processing.
#==============================================================================
# Modified Scene_Menu
class Scene_Menu
#--------------------------------------------------------------------------
# * Object Initialization
# menu_index : command cursor's initial position
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make command window
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Biographies"
s6 = "Save"
s7 = "End Game"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
@command_window.index = @menu_index
# If number of party members is 0
if $game_party.actors.size == 0
# Disable items, skills, equipment, and status
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# If save is forbidden
if $game_system.save_disabled
# Disable save
@command_window.disable_item(4)
end
# Make play time window
@playtime_window = Window_PlayTime.new
@playtime_window.x = 0
@playtime_window.y = 320
# Make steps window
# @steps_window = Window_Steps.new
# @steps_window.x = 0
# @steps_window.y = 320
# Make gold window
@gold_window = Window_Gold.new
@gold_window.x = 0
@gold_window.y = 416
# Make status window
@status_window = Window_MenuStatus.new
@status_window.x = 160
@status_window.y = 0
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
@playtime_window.dispose
# @steps_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
@playtime_window.update
# @steps_window.update
@gold_window.update
@status_window.update
# If command window is active: call update_command
if @command_window.active
update_command
return
end
# If status window is active: call update_status
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If command other than save or end game, and party members = 0
if $game_party.actors.size == 0 and @command_window.index < 4
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0 # item
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to item screen
$scene = Scene_Item.new
when 1 # skill
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # biographies
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 5 # save
# If saving is forbidden
if $game_system.save_disabled
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to save screen
$scene = Scene_Save.new
when 6 # end game
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to end game screen
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Make command window active
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 1 # skill
# If this actor's action limit is 2 or more
if $game_party.actors[@status_window.index].restriction >= 2
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to skill screen
$scene = Scene_Skill.new(@status_window.index)
when 2 # equipment
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to equipment screen
$scene = Scene_Equip.new(@status_window.index)
when 3 # status
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to status screen
$scene = Scene_Status.new(@status_window.index)
when 4 # biographies
$game_system.se_play($data_system.decision_se)
$scene = Scene_Biography.new(@status_window.index)
end
return
end
end
end
EDIT 2 (Important): I fixed a mistake I made on my menu example, so it now works when you have more than one character in the party. Also, I revised the script to go back to the menu screen when you hit B, rather than going back to the map. Finally, I fixed a bug in the referencing of some battler files.