[XP] Need help debugging a custom status script

Started by Shining Riku, May 06, 2014, 11:44:31 pm

Previous topic - Next topic

Shining Riku

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.

That said, I'll link my script here in this code box:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#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.

KK20

You forgot to put an 'end' for the Window_Base class.
After that, yeah, you should provide a demo if there's anything wrong. Or at the very least screen shots.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shining Riku

May 07, 2014, 12:00:41 am #2 Last Edit: May 07, 2014, 12:03:26 am by Shining Riku
Hmm, I just put the end at the end of window_base like you said, and it gave me the same error. Lemme try it again in a fresh project just in case it's an incompatibility(which is kinda weird I guess) I'll check back in a moment.

EDIT: Yeah, same error as before, syntax error on the line defining the personality window D:


KK20

Oh, you're also missing an end for the module.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shining Riku

I added that too and same error >_>;;

I've created a demo that includes all the graphics if the script theoretically works.

https://www.mediafire.com/?soutyptzewgyr4g

It includes the changes you told me to make, which for some reason still aren't working on my end bleh.
I apologize for the hassle.

KK20

May 07, 2014, 12:39:11 am #5 Last Edit: May 07, 2014, 12:42:42 am by KK20
lol didn't even see the 'if' statements in your perfectly aligned block of code.

 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 #<============================================ You're missing an end for your if-statements
 end

Go back through your code, use some spacing, and add those ends.

I guess I should also point out that, when making a comparison, you use a double equal sign (==). I would write it like this though:

 def draw_stat_knowledge(x, y)
   if [0,1,2,3,4].include?($game_variables[KNOWLEDGE])
     bitmap = RPG::Cache.picture("Knowledge" + ($game_variables[KNOWLEDGE] + 1).to_s)
     src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
     self.contents.blt(x, y, bitmap, src_rect)
    end
  end

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shining Riku

Aha! I had a gut feeling I did something weird with those elsifs. I didn't find any examples of elsif spamming lying around like that so I just rolled with it.

I try to avoid walls of text when I'm typing but it seems that etiquette hasn't carried over to my scripting yet. Thanks for being so quick to reply to me :'D I really appreciate it!

KK20

Quote from: Shining Riku on May 07, 2014, 12:45:01 am
I try to avoid walls of text when I'm typing but it seems that etiquette hasn't carried over to my scripting yet.

But...but...the script editor automatically indents for you when you press enter D:

No problem. I check CP moreso than any other website I visit.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shining Riku

May 07, 2014, 01:06:28 am #8 Last Edit: May 07, 2014, 01:10:19 am by Shining Riku
Well, seeing as I copied and pasted some code and didn't indent it afterwards...^^;;

I've updated the script, and cut out bits that I identified as being unnecessary (like using the map as a BG when technically it won't even be visible! :P )

I replaced all my code walls with the condensed versions and updated the terms, but now it's telling me the KNOWLEDGE term on line 53 is uninitialized? I can post the script again if you like.

EDIT: I went ahead and just added the script to this post:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#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, insert variables that determine personality trait levels.
 COURAGE = 12
 KNOWLEDGE = 13
 UNDERSTANDING = 14
 DILIGENCE = 15
 EXPRESSION = 16
 ORDERCHAOS = 17
 GOODEVIL = 18
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
#==============================================================================
# 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, bitmap, src_rect)
 end
 
 def draw_stat_knowledge(x, y)
   if [0,1,2,3,4].include?($game_variables[KNOWLEDGE])
     bitmap = RPG::Cache.picture("Knowledge" + ($game_variables[KNOWLEDGE] + 1).to_s)
     src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
     self.contents.blt(x, y, bitmap, src_rect)
   end
 end
 
 def draw_stat_courage(x, y)
   if [0,1,2,3,4].include?($game_variables[COURAGE])
     bitmap = RPG::Cache.picture("Courage" + ($game_variables[COURAGE] + 1).to_s)
     src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
     self.contents.blt(x, y, bitmap, src_rect)
   end
 end
 
 def draw_stat_diligence(x, y)
   if [0,1,2,3,4].include?($game_variables[DILIGENCE])
     bitmap = RPG::Cache.picture("Diligence" + ($game_variables[DILIGENCE] + 1).to_s)
     src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
     self.contents.blt(x, y, bitmap, src_rect)
   end
 end
 
 def draw_stat_expression(x, y)
   if [0,1,2,3,4].include?($game_variables[EXPRESSION])
     bitmap = RPG::Cache.picture("Expression" + ($game_variables[EXPRESSION] + 1).to_s)
     src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
     self.contents.blt(x, y, bitmap, src_rect)
   end
 end  
 
 def draw_stat_understanding(x, y)
   if [0,1,2,3,4].include?($game_variables[UNDERSTANDING])
     bitmap = RPG::Cache.picture("Understanding" + ($game_variables[UNDERSTANDING] + 1).to_s)
     src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
     self.contents.blt(x, y, bitmap, src_rect)
   end
 end
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[2].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
   @personality_window = Window_Personality.new
   Graphics.transition
   loop do
     Graphics.update
     Input.update
     update
     break if $scene != self
   end
   Graphics.freeze
   @personality_window.dispose
 end
 
 def update
   @personality_window.update
   if Input.trigger?(Input::B)
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Menu.new
   end
 end


end
 


Yeah, "Uninitialized constant Window_Base::KNOWLEDGE" line 53

Nice thing is it plugs right into the demo, derp. When it works it should show everything.  :^_^':

KK20

Right, you'll need to declare the module that your constant comes from.

if [0,1,2,3,4].include?($game_variables[Personality::KNOWLEDGE])

If you removed your module but left the constants as is, floating freely, your current code shouldn't error.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shining Riku

IT WORKS, YESSSSS.

Thanks so much for your help 8D I think I can take it from here. I still have a few more features to add and graphical stuff to iron out but if you'd like to see it in action, here ya go:

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#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, insert variables that determine personality trait levels.
  COURAGE = 12
  KNOWLEDGE = 13
  UNDERSTANDING = 14
  DILIGENCE = 15
  EXPRESSION = 16
  ORDERCHAOS = 17
  GOODEVIL = 18
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
end
#==============================================================================
# Game_System
#==============================================================================

#==============================================================================
# Window_Base
#==============================================================================
class Window_Base
 
  def draw_actor_status(x, y)
    bitmap = RPG::Cache.picture("#{$game_actors[1].character_name}_person")
    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, bitmap, src_rect)
  end
 
  def draw_stat_knowledge(x, y)
    if [0,1,2,3,4].include?($game_variables[Personality::KNOWLEDGE])
      bitmap = RPG::Cache.picture("Knowledge" + ($game_variables[Personality::KNOWLEDGE] + 1).to_s)
      src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
      self.contents.blt(x, y, bitmap, src_rect)
    end
  end
 
  def draw_stat_courage(x, y)
    if [0,1,2,3,4].include?($game_variables[Personality::COURAGE])
      bitmap = RPG::Cache.picture("Courage" + ($game_variables[Personality::COURAGE] + 1).to_s)
      src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
      self.contents.blt(x, y, bitmap, src_rect)
    end
  end
 
  def draw_stat_diligence(x, y)
    if [0,1,2,3,4].include?($game_variables[Personality::DILIGENCE])
      bitmap = RPG::Cache.picture("Diligence" + ($game_variables[Personality::DILIGENCE] + 1).to_s)
      src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
      self.contents.blt(x, y, bitmap, src_rect)
    end
  end
 
  def draw_stat_expression(x, y)
    if [0,1,2,3,4].include?($game_variables[Personality::EXPRESSION])
      bitmap = RPG::Cache.picture("Expression" + ($game_variables[Personality::EXPRESSION] + 1).to_s)
      src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
      self.contents.blt(x, y, bitmap, src_rect)
    end
  end 
 
  def draw_stat_understanding(x, y)
    if [0,1,2,3,4].include?($game_variables[Personality::UNDERSTANDING])
      bitmap = RPG::Cache.picture("Understanding" + ($game_variables[Personality::UNDERSTANDING] + 1).to_s)
      src_rect= Rect.new(0, 0, bitmap.width, bitmap.height)
      self.contents.blt(x, y, bitmap, src_rect)
    end
  end
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[2].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
    @personality_window = Window_Personality.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    Graphics.freeze
    @personality_window.dispose
  end
 
  def update
    @personality_window.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new
    end
  end


end
 


I can't thank you enough asfghdjs ;-;