I've been working on a status scene that displays the player's personality traits and their levels, much like the Status screens in Persona 3 and Persona 4. I'm not much of a scripter, honestly so I'm kind of flailing around.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#Persona Style Personality Status (P.S.P.S) Module by ShiningRiku
#Version: 1.0
#Type: Status/Menu Addon
#Date v1.0: 6.5.2014
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#BLAHBLAHBLAHBLAH
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#==============================================================================
# module Personality
#==============================================================================
module Personality
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# basic config
COURAGE = 12
KNOWLEDGE = 13
UNDERSTANDING = 14
DILIGENCE = 15
EXPRESSION = 16
ORDERCHAOS = 17
GOODEVIL = 18
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#==============================================================================
# Game_System
#==============================================================================
#==============================================================================
# Window_Base
#==============================================================================
class Window_Base
def draw_actor_status(x, y)
bitmap = RPG::Cache.picture("#{$game_actors[1].character_name}_person", hue)
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
end
def draw_stat_background(x, y)
bitmap = RPG::Cache.picture("1PersonBG")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap1, src_rect)
end
def draw_stat_knowledge(x, y)
if $game_variables[KNOWLEDGE] = 0
bitmap = RPG::Cache.picture("Knowledge1")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[KNOWLEDGE] = 1
bitmap = RPG::Cache.picture("Knowledge2")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[KNOWLEDGE] = 2
bitmap = RPG::Cache.picture("Knowledge3")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[KNOWLEDGE] = 3
bitmap = RPG::Cache.picture("Knowledge4")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[KNOWLEDGE] = 4
bitmap = RPG::Cache.picture("Knowledge5")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
end
def draw_stat_courage(x, y)
if $game_variables[COURAGE] = 0
bitmap = RPG::Cache.picture("Courage1")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[COURAGE] = 1
bitmap = RPG::Cache.picture("Courage2")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[COURAGE] = 2
bitmap = RPG::Cache.picture("Courage3")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[COURAGE] = 3
bitmap = RPG::Cache.picture("Courage4")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[COURAGE] = 4
bitmap = RPG::Cache.picture("Courage5")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
end
def draw_stat_diligence(x, y)
if $game_variables[DILIGENCE] = 0
bitmap = RPG::Cache.picture("Diligence1")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[DILIGENCE] = 1
bitmap = RPG::Cache.picture("Diligence2")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[DILIGENCE] = 2
bitmap = RPG::Cache.picture("Diligence3")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[DILIGENCE] = 3
bitmap = RPG::Cache.picture("Diligence4")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[DILIGENCE] = 4
bitmap = RPG::Cache.picture("Diligence5")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
end
def draw_stat_expression(x, y)
if $game_variables[EXPRESSION] = 0
bitmap = RPG::Cache.picture("Expression1")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[EXPRESSION] = 1
bitmap = RPG::Cache.picture("Expression2")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[EXPRESSION] = 2
bitmap = RPG::Cache.picture("Expression3")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[EXPRESSION] = 3
bitmap = RPG::Cache.picture("Expression4")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[EXPRESSION] = 4
bitmap = RPG::Cache.picture("Expression5")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
end
def draw_stat_understanding(x, y)
if $game_variables[DILIGENCE] = 0
bitmap = RPG::Cache.picture("Understanding1")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[DILIGENCE] = 1
bitmap = RPG::Cache.picture("Understanding2")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[DILIGENCE] = 2
bitmap = RPG::Cache.picture("Understanding3")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[DILIGENCE] = 3
bitmap = RPG::Cache.picture("Understanding4")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
elsif $game_variables[DILIGENCE] = 4
bitmap = RPG::Cache.picture("Understanding5")
src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(x, y, bitmap, src_rect)
end
#==============================================================================
# Window_Personality
#==============================================================================
class Window_Personality < Window_Base
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(224, 0, 120, 32, $game_actors[1].name, 1)
self.contents.draw_text(224, 0, 150, 32, $game_actors[61].name, 1)
draw_stat_background(0, 0)
draw_stat_knowledge(0, 0)
draw_stat_courage(0, 0)
draw_stat_diligence(0, 0)
draw_stat_expression(0, 0)
draw_stat_understanding(0, 0)
draw_actor_status(0, 0)
draw_actor_hp($game_actors[1], 400, 92, 172)
draw_actor_sp($game_actors[1], 400, 122, 172)
end
end
#==============================================================================
# Scene_Personality
#==============================================================================
class Scene_Personality
def main
@spriteset = Spriteset_Map.new if MAP_BACKGROUND
@personality_window = Window_Personality.new
Graphics.transition
loop do
Graphics.update
Input.update
update
break if $scene != self
end
Graphics.freeze
@spriteset.dispose if MAP_BACKGROUND
@personality_window.dispose
end
def update
@personality_window.update
if MAP_BACKGROUND && (Input.trigger?(Input::A) || Input.trigger?(Input::C))
Graphics.freeze
$game_system.se_play($data_system.cursor_se)
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new
end
end
end
First off, this is a learning experience for me, and as far as working standalone script goes this is my first work. Iunno if it's optimized with the way I'm doing things.
I'm probably missing things and some of the code I'm learning from in Blizzard's scripts, the settings haven't been finalized and cuz of syntax errors I haven't actually gotten it to run ingame yet.
Currently it tells me I have a syntax error on line 171, right where I start defining how the actual window works :C
My work here is roughly the equivalent of a blind person driving a car, so it's pretty...interesting to say in the least!
Idunno what else to add, this is my first time making a script, let alone requesting aid in debugging >_>;;
I can set up a demo with sample graphics since this script is so heavy on pictures if that will help.