Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Actor Customization V.6.0.2

Hey guys, anyways I am back. Internet got connected early. I have updated the first post with V5.00 which includes a bundle of new features (and most likely a bundle of new bugs) so post what you find. Props goes out to DerVVulfman who gave the idea of checking for the SDK thanks ^^

What is it?

Actor Customization allows the player to build their playable characters based on Points earned from Quests or levels. By default, the playable characters gain a definable amount of points every time they level up, these points can then be used to add statistics to the actors. As of Version 5.00 the Customization center is fairly decent, allowing the developer to modify things such as Messages to Custom Stat correction of actor progression.

New in Version 5.00
-- Works with SDK 2.2
-- Ability to display a Background image instead of the map
-- Ability to Display faces instead of the Actor sprite
-- New layout
-- No longer have to push a button to switch actors, instead you select what actor you wish to level-up
-- Custom Messages have been added.
-- Custom Stat Correction, now you can specify custom stat progression with different actors. No same actor has to level-up the same way.
-- A ton of bugs fixed

Screenshots:
http://img102.imageshack.us/img102/884/menu1mr4.th.png[/img]http://img102.imageshack.us/img102/2900/menu2ad5.th.png[/img]http://img102.imageshack.us/img102/7500/menu3bo4.th.png[/img]http://img249.imageshack.us/img249/1169/untitleduj7.th.jpg[/IMG]
 
And I took the liberty of indenting your code again -_-

Code:
#============================================================================
#                            Actor Customization!  
#----------------------------------------------------------------------------
# Written by Synthesize
# Version 5.00 
# July 28, 2007
# Tested with SDK 2.2
#============================================================================

#--------------------------------------------------------------------------
# * Begin Actor Customization modification section*
# Use this section to control many aspects of the script.
# May it be from Message display to Custom Actor Statistic growth
#--------------------------------------------------------------------------
  "Please distribute your points", "Not Enough Points"]  
  # Define the messages. 0=HP, 1=SP, 2=STR, 3=DEX, 4=AGI, 
  # 5=INT, 6=Default, 7=Not enough Points
  #----
  # * Custom Stat Correction * 
  # This area allows you to define custom Statistic Advancement.
  # Example, have Actor 1 get 7 HP and 3 STR but have Actor 2 receive 3 HP and 7 STR
  # Define the Custom Stat actors below.
  Actor_HP = {1 => 10, 2 => 8
  } # Define the amount of HP an actor gets per point. {actor_id => amount}. 
    # Seperate Actors with a comma (,).
  Actor_SP = {1 => 7
  } # Define the Amount of SP an actor gets per point. {actor_id => amount}
    # Seperate Actors with a comma(,)
  Actor_STR = {1 => 3, 2 => 4
  } # Define the Amount of STR an actor gets per point. {actor_id => amount}
    # Seperate Actors with a comma(,)
  Actor_DEX = {1 => 5
  } # Define the Amount of DEX an actor gets per point. {actor_id => amount}
    # Seperate Actors with a comma(,)
  Actor_AGI = {1 => 2
  } # Define the Amount of AGI an actor gets per point. {actor_id => amount}
    # Seperate Actors with a comma(,)
  Actor_INT = {1 => 1
  } # Define the Amount of INT an actor gets per point. {actor_id => amount}
    # Seperate Actors with a comma(,)
  # Note: To use the Default statistic growth simply leave an actor value blank.
end      

#--------------------------------------------------------------------------
# * Create Upgrade Points & Add Points on Level-up
#--------------------------------------------------------------------------
#----------------------------------------------------------------------------
# Begin Game_Actor Edit
#----------------------------------------------------------------------------
class Game_Actor < Game_Battler        
  # Make Upgrade Points
  attr_accessor :upgrade_points   
  alias synthesize_upgrade_points setup
  # Distribute Points among Actors 
  def setup(actor_id)
    synthesize_upgrade_points(actor_id)
    # Starting amount of points 
    @upgrade_points = 0
  end
  # Begin Level-up process 
  def exp=(exp)
    @exp = [[exp, 9999999].min, 0].max
    # Level up
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      # Add an additional level
      @level += 1
      # Add Upgrade Points to the actor that leveled
      @upgrade_points += Customize::Points_Gained
      # Learn skill
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    #Level down
    while @exp < @exp_list[@level]
      @level -= 1
    end
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
  # End Class
end
    
  #----------------------------------------------------------------------------
  # End Game_Actor Edit
  #----------------------------------------------------------------------------
  @@message_window = Customize::Messages[6]
#=======================
# END DATA_POINTS
#=======================

 #--------------------------------------------------------------------------
 # Begin SDK Check
 # The below is used as a method to check for SDK. Props to DerVVulfman.
 #--------------------------------------------------------------------------
  module SDK
    # SDK not installed
    $sdk_defined = false
    if defined?(log_alias)
      # SDK installed
    $sdk_defined = true
    end
  end
#--------------------------------------------------------------------------
# Scene_Upgrade
# This is the main scene of 'Actor Customization!'
# Editing not recommended.
#--------------------------------------------------------------------------
class Scene_Upgrade
  #--------------------------------------------------------------------------
  # Object Initalize
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0)
    # Define Actor_index. Used to draw actors and for multiple actor support
    @actor_index = actor_index
    # Define Actor Data
    @actor = $game_party.actors[@actor_index]
    @@message_window = Customize::Messages[6]   # The Default Message
    # Initiate Custom Statistics/Default Statistics
    if Customize::Actor_HP.has_key?(@actor.id)
      @hp = Customize::Actor_HP[@actor.id]
    else
      @hp = Customize::Hp_rise
    end
    # Initiate Custom Statistics/Default Statistics
    if Customize::Actor_SP.has_key?(@actor.id)
      @sp = Customize::Actor_SP[@actor.id]
    else
      @sp = Customize::Sp_rise
    end
    # Initiate Custom Statistics/Default Statistics
    if Customize::Actor_STR.has_key?(@actor.id)
      @str = Customize::Actor_STR[@actor.id]
    else
      @str = Customize::Str_rise
    end
    # Initiate Custom Statistics/Default Statistics
    if Customize::Actor_DEX.has_key?(@actor.id)
      @dex = Customize::Actor_DEX[@actor.id]
    else
      @dex = Customize::Dex_rise
    end
    # Initiate Custom Statistics/Default Statistics
    if Customize::Actor_AGI.has_key?(@actor.id)
      @agi = Customize::Actor_AGI[@actor.id]
    else
      @agi = Customize::Agi_rise
    end
    # Initiate Custom Statistics/Default Statistics
    if Customize::Actor_INT.has_key?(@actor.id)
      @int = Customize::Actor_INT[@actor.id]
    else
      @int = Customize::Int_rise
    end
  end
  #--------------------------------------------------------------------------
  # * Main Window Initialize
  #--------------------------------------------------------------------------
  def main
    # Draw background
    main_spriteset
    # Make Commands
    s1 = "Increase #{$data_system.words.hp} by #{@hp}"   
    s2 = "Increase #{$data_system.words.sp} by #{@sp}"   
    s3 = "Increase #{$data_system.words.str} by #{@str}"  
    s4 = "Increase #{$data_system.words.dex} by #{@dex}" 
    s5 = "Increase #{$data_system.words.agi} by #{@agi}"  
    s6 = "Increase #{$data_system.words.int} by #{@int}"  
    # Define Command Window
    @command_window = Window_Command.new(275, [s1, s2, s3, s4, s5, s6])
    @command_window.x = 343
    @command_window.y = 56
    @command_window.z = 9998
    @command_window.opacity = 200
    # Turn the Command Window On
    @command_window.active = true
    @upgrade_status_window = Window_UpgradeStatus.new(@actor, @hp, @sp, @str, @dex, @agi, @int)
    @upgrade_status_window.opacity= 200
    @upgrade_status_window.x = 18
    @upgrade_status_window.y = 112
    @upgrade_status_window.z = 9998
    # Set Raise Window Data
    @raise_window = Window_Feedback.new
    @raise_window.x = 18
    @raise_window.y = 56
    @raise_window.z = 9998
    @raise_window.opacity = 200
    # Set Actor Swap Window
    @actor_window = Window_ActorList.new
    @actor_window.x = 344
    @actor_window.y = 277
    @actor_window.z = 9998
    @actor_window.opacity = 200
    @actor_window.active = false
    @actor_window.index = 0
    # Check for SDK
    unless $sdk_defined
      # Graphics Transition
      Graphics.transition
      # Main Loop
      loop do
        # Update Graphics
        Graphics.update
        # Update Input
        Input.update
        # Renew
        update
        # Discontinue Loop
        if $scene != self
          break
        end
      end
      # Prepare Transition
      Graphics.freeze
    end
    # Dispose Windows
    @command_window.dispose
    @upgrade_status_window.dispose
    @raise_window.dispose
    @actor_window.dispose
    if Customize::Draw_face == true
      @face.dispose
    end
  end
  #--------------------------------------------------------------------------
  # * Spriteset Initialize
  #--------------------------------------------------------------------------
  def main_spriteset
  # Draw either the Map or a Background Image
  if Customize::Map_bg == true
    # Draw the Map
    @background = Spriteset_Map.new
  else
    # Define the Background
    @background = Sprite.new
    @background.bitmap = RPG::Cache.picture(Customize::Picture_name)
  end
  # Draw Actors Face
  if Customize::Draw_face == true
    @face = Sprite.new
    @face.bitmap = RPG::Cache.picture(@actor.name + "_face")
    @face.x = 40
    @face.y = 120
    @face.z = 9999
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Check SDK
    unless $sdk_defined
      @command_window.update
      @actor_window.update
    end
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If Actor Window active call update_actor
    if @actor_window.active
      update_actor
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Update Command *
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @actor_window.active = true
      @command_window.active = false
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 0  # Increase HP
        if @actor.upgrade_points >= 1 and @actor.maxhp <= 9998
          $game_system.se_play($data_system.decision_se)
          @@message_window = Customize::Messages[0]
          @actor.upgrade_points -= 1
          @actor.hp += @hp
          @actor.maxhp += @hp
          @upgrade_status_window.update
          @raise_window.update
        else
          @@message_window = Customize::Messages[7]
          @raise_window.update
          $game_system.se_play(RPG::AudioFile.new(Customize::Error_sound))
        end
      when 1  # # Increase SP
        if @actor.upgrade_points >= 1 and @actor.maxsp <= 9998
          $game_system.se_play($data_system.decision_se)
          @@message_window = Customize::Messages[1]
          @actor.upgrade_points -= 1
          @actor.sp += @sp
          @actor.maxsp += @sp
          @upgrade_status_window.update
          @raise_window.update
        else
          @@message_window = Customize::Messages[7]
          @raise_window.update
          $game_system.se_play(RPG::AudioFile.new(Customize::Error_sound))
        end
      when 2  # # Increase STR
        if @actor.upgrade_points >= 1 and @actor.str <= 998
          $game_system.se_play($data_system.decision_se)
          @@message_window = Customize::Messages[2]
          @actor.str += @str         
          @actor.upgrade_points -= 1
          @upgrade_status_window.update
          @raise_window.update
        else
          @@message_window = Customize::Messages[7]
          @raise_window.update
          $game_system.se_play(RPG::AudioFile.new(Customize::Error_sound))
        end
      when 3  # # Increase DEX
        if @actor.upgrade_points >= 1 and @actor.dex <= 998
          $game_system.se_play($data_system.decision_se)
          @@message_window = Customize::Messages[3]
          @actor.upgrade_points -= 1
          @actor.dex += @dex
          @upgrade_status_window.update
          @raise_window.update
        else
          @@message_window = Customize::Messages[7]
          @raise_window.update
          $game_system.se_play(RPG::AudioFile.new(Customize::Error_sound))
        end
      when 4  # # Increase AGI
        if @actor.upgrade_points >= 1 and @actor.agi <= 998
          $game_system.se_play($data_system.decision_se)
          @@message_window = Customize::Messages[4]
          @actor.upgrade_points -= 1
          @actor.agi += @agi
          @upgrade_status_window.update
          @raise_window.update
        else
          @@message_window = Customize::Messages[7]
          @raise_window.update
          $game_system.se_play(RPG::AudioFile.new(Customize::Error_sound))
        end
      when 5  # # Increase INT
        if @actor.upgrade_points >= 1 and @actor.int <= 998
          $game_system.se_play($data_system.decision_se)
          @@message_window = Customize::Messages[5]
          @actor.upgrade_points -= 1
          @actor.int += @int
          @upgrade_status_window.update
          @raise_window.update
        else
          @@message_window = Customize::Messages[7]
          @raise_window.update
          $game_system.se_play(RPG::AudioFile.new(Customize::Error_sound))
        end
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Actor Swap *
  #--------------------------------------------------------------------------
  def update_actor
    # 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)
      # Swap Actors
      $game_system.se_play($data_system.decision_se)
      @actor_index = @actor_window.index
      $scene = Scene_Upgrade.new(@actor_index)
    end
  end
end
#--------------------------------------------------------------------------
# * Begin Window Base Add-On(s)
#--------------------------------------------------------------------------
class Window_Base < Window
  def draw_synac_preview(actor,x, y, stat, value)
    if stat == 0
    @minpreview = actor.hp + value
    @maxpreview = actor.maxhp + value   
  elsif stat == 1
    @minpreview = actor.sp + value
    @maxpreview = actor.maxsp + value  
  elsif stat == 2
    @maxpreview = actor.str + value  
  elsif stat == 3
    @maxpreview = actor.dex + value  
  elsif stat == 4
    @maxpreview = actor.agi + value  
  elsif stat == 5
    @maxpreview = actor.int + value  
  end
  if stat > 1
    self.contents.font.color = crisis_color
    self.contents.draw_text(x, y, 12, 100, "=>") 
    self.contents.font.color = system_color
    self.contents.draw_text(x+24, y, 100, 100, "#{@maxpreview}") 
  else
    self.contents.font.color = crisis_color
    self.contents.draw_text(x, y, 12, 100, "=>") 
    self.contents.font.color = system_color
    self.contents.draw_text(x+24, y, 100, 100, "#{@minpreview}/#{@maxpreview}") 
    end
  end
end
#--------------------------------------------------------------------------
# * Begin Window Data
#--------------------------------------------------------------------------
#=================================
# *Status Window*
#=================================
class Window_UpgradeStatus < Window_Base
  # Initiate Actor Data
  def initialize(actor, hp, sp, str, dex, agi, int)
    # Define Window Reso.
    super(32, 32, 330, 300)
    # Set Contents
    self.contents = Bitmap.new(width - 32, height - 32)
    # Define Actor Data
    @actor = actor
    @hp = hp
    @sp = sp
    @str = str
    @dex = dex
    @agi = agi
    @int = int
    # Jump to Update
    update
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def update
    # Clear Window Contents
    self.contents.clear
    # Draw Actor Data
    if Customize::Draw_face == false
      draw_actor_graphic(@actor, 35, 50)
    end
    draw_actor_class(@actor, 85, 20)
    draw_actor_name(@actor, 80, 0)
    draw_actor_level(@actor, 176, 0)
    self.contents.font.color = system_color 
    # Draw Stat Display Preview
    if Customize::Draw_display == true
      self.contents.draw_text(85, 12, 35, 100, "Before:") 
      self.contents.draw_text(200, 12, 35, 100, "After:") 
      if @actor.upgrade_points >= 1 and @actor.maxhp <= 9998
        draw_synac_preview(@actor,176, 34, 0, @hp)
      end
      if @actor.upgrade_points >= 1 and @actor.maxsp <= 9998
        draw_synac_preview(@actor,176, 56, 1, @sp)
      end
      if @actor.upgrade_points >= 1 and @actor.str <= 998
        draw_synac_preview(@actor,176, 98, 2, @str)
      end
      if @actor.upgrade_points >= 1 and @actor.dex <= 998
        draw_synac_preview(@actor,176, 123, 3, @dex)
      end
      if @actor.upgrade_points >= 1 and @actor.agi <= 998
        draw_synac_preview(@actor,176, 148, 4, @agi)
      end
      if @actor.upgrade_points >= 1 and @actor.int <= 998
        draw_synac_preview(@actor,176, 173, 5, @int)
      end
    end
    # Draw additional Stats
    draw_actor_hp(@actor, 4, 68, 172)
    draw_actor_sp(@actor, 4, 90, 172)   
    draw_actor_parameter(@actor, 4, 132, 3)
    draw_actor_parameter(@actor, 4, 156, 4)
    draw_actor_parameter(@actor, 4, 180, 5)
    draw_actor_parameter(@actor, 4, 204, 6) 
    # Draw Point Data
    self.contents.font.color = system_color
    self.contents.draw_text(175, 205, 100, 100, "Points:")
    self.contents.font.color = normal_color
    self.contents.draw_text(165, 205, 100, 100, @actor.upgrade_points.to_s, 2)
  end
end
#--------------------------------------------------------------------------
# Raise Window
#--------------------------------------------------------------------------
class Window_Feedback < Window_Base
  def initialize
    super(0, 0, 330, 60)
    self.contents = Bitmap.new(width - 32, height - 32)
    update
  end
  
  def update
    # Clear the Window
    self.contents.clear
    # Draw the Message ID
    self.contents.draw_text(0, 0, 300, 34, @@message_window)
  end
end 
#--------------------------------------------------------------------------
# Actor Window
#--------------------------------------------------------------------------
class Window_ActorList < Window_Selectable
  
  def initialize
    super(0, 0, 275, 85)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.active = false
    self.index = -1
    @item_max = $game_party.actors.size
    @column_max = 2
    draw_actor
    self.active = false
    self.index = 0
  end
  
  def draw_actor
   for i in 0...$game_party.actors.size
    actor = $game_party.actors[i]
      x = i * 65
      y = 50
      draw_actor_graphic(actor, x + 20, y)
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    self.cursor_rect.set(0 + index * 65, 0, 40, 54)
  end
end 

#                            
#----------------------------------------------------------------------------
# Written by Synthesize
# Additional Thanks: Icedmetal57 (Custom Stat Progression), Trickster (Bug smashing)
# DerVVulfman (SDK Module detection idea). Community for reporting bugs and support ^-^
#----------------------------------------------------------------------------
#                           Actor Customization! 
#============================================================================

What's this time for round four? :p

1)
Code:
  # Begin Level-up process 
  def exp=(exp)
    @exp = [[exp, 9999999].min, 0].max
    # Level up
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      # Add an additional level
      @level += 1
      # Add Upgrade Points to the actor that leveled
      @upgrade_points += Customize::Points_Gained
      # Learn skill
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    #Level down
    while @exp < @exp_list[@level]
      @level -= 1
    end
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
This method could have been aliased actually it is vital that you aliased this I'll tell you why further down in my post

2)
Code:
  #----------------------------------------------------------------------------
  # End Game_Actor Edit
  #----------------------------------------------------------------------------
  @@message_window = Customize::Messages[6]
#=======================
# END DATA_POINTS
#=======================
Uhh what?

3)
Code:
  module SDK
    # SDK not installed
    $sdk_defined = false
    if defined?(log_alias)
      # SDK installed
    $sdk_defined = true
    end
  end
I don't agree to use to check for SDK first off it depends on something that can change at any time (like if Seph, the person who updates SDK, changes it to log_aliases then your check fails)

Actually while looking at your script (which is the reason why I indented it btw) if you follow 1) then it will work with or without SDK since this script is only a new scene (btw the auto-update thing is only needed if the Scene inherits from Seph's Scene_Base which it does not) and a few minor edits to classes which can be aliased.

Also the global :p

but anyway a better method would be something like this

In your Setup Module...

Code:
begin
  SDK_AUTO_DETECT = SDK::Version
rescue
  SDK_AUTO_DETECT = nil
end
pretty rough but that will do the trick if SDK is detected then the constant will contain the version of SDK used then you can do stuff with that. if it is not detected then it will be nil.


4)
Code:
@@message_window = Customize::Messages[6]   # The Default Message
Ahh so now we see this again. Actaully the @@ declares a variable as a class variable. There aren't many uses for these types of variables. At least not in my normal scripting there isn't (the last time was in my skill effects script). But yeah this should be declared as instance instead as this variable will be shared among instances of this class

5)
Code:
    if Customize::Actor_HP.has_key?(@actor.id)
      @hp = Customize::Actor_HP[@actor.id]
    else
      @hp = Customize::Hp_rise
    end
This can be simplified back in your setup you can take advantage of the Hashes default property
Code:
  Actor_HP = {1 => 10, 2 => 8}
and then
Code:
Actor_HP.default = 3
If you need more examples just look at any of my scripts if the actor's id is not in that hash 3 will be returned

6)
Code:
    # Check for SDK
    unless $sdk_defined
      # Graphics Transition
      Graphics.transition
      # Main Loop
      loop do
        # Update Graphics
        Graphics.update
        # Update Input
        Input.update
        # Renew
        update
        # Discontinue Loop
        if $scene != self
          break
        end
      end
      # Prepare Transition
      Graphics.freeze
    end
Uhh what? again this scene doesn't use Scene_Base as its parent its not needed

7)
Code:
    # Check SDK
    unless $sdk_defined
      @command_window.update
      @actor_window.update
    end
Again you don't need the update stuff if the scene doesn't inherit from Scene_Base

8)
Code:
      when 1  # # Increase SP
        if @actor.upgrade_points >= 1 and @actor.maxsp <= 9998
          $game_system.se_play($data_system.decision_se)
          @@message_window = Customize::Messages[1]
          @actor.upgrade_points -= 1
          @actor.sp += @sp
          @actor.maxsp += @sp
          [COLOR=Red]
          @upgrade_status_window.update
          @raise_window.update[/COLOR]
        else
          @@message_window = Customize::Messages[7]
          [COLOR=Red]@raise_window.update[/COLOR]
          $game_system.se_play(RPG::AudioFile.new(Customize::Error_sound))
        end
don't you mean refresh?

9)
Code:
class Window_Base < Window
  def draw_synac_preview(actor,x, y, stat, value)
    if stat == 0
    @minpreview = actor.hp + value
    @maxpreview = actor.maxhp + value   
  elsif stat == 1
    @minpreview = actor.sp + value
    @maxpreview = actor.maxsp + value  
  elsif stat == 2
    @maxpreview = actor.str + value  
  elsif stat == 3
    @maxpreview = actor.dex + value  
  elsif stat == 4
    @maxpreview = actor.agi + value  
  elsif stat == 5
    @maxpreview = actor.int + value  
  end
  if stat > 1
    self.contents.font.color = crisis_color
    self.contents.draw_text(x, y, 12, 100, "=>") 
    self.contents.font.color = system_color
    self.contents.draw_text(x+24, y, 100, 100, "#{@maxpreview}") 
  else
    self.contents.font.color = crisis_color
    self.contents.draw_text(x, y, 12, 100, "=>") 
    self.contents.font.color = system_color
    self.contents.draw_text(x+24, y, 100, 100, "#{@minpreview}/#{@maxpreview}") 
    end
  end
end
The instance variables aren't necessary they should have been declared local, tip make the variables scope as high as you need it, since you aren't using these variables in any other method in Window_Base they aren't needed as instance.

10)
Code:
    # Jump to Update
    update
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def update
don't you mean refresh. Generally the refresh method draws the window's contents, update does other things like check if the windows contents changed etc, putting what you have there in the update method is asking for trouble. (Will Generate lag if this method is called every frame).

Ok I tested this in a new project It works, but with SDK it doesn't so instead of attempting to adapt it to SDK, in actuality you broke compatibility with it when it really wasn't going to clash with it in the first place -_-. so you can remove the detection stuff that is only needed if the Scene inherits from Scene_Base, and the only other thing you need to do is 1) and you are okay.
 
Code:
begin
  SDK_AUTO_DETECT = SDK::Version
rescue
  SDK_AUTO_DETECT = nil
end
Okay... a lot more elegant than the one I gave him. Hey, had to do something to detect it, right? "...like if Seph, the person who updates SDK, changes it to log_aliases then your check fails" I'll buy that. :yes: But the use of a CONSTANT?

Yep. seems to work fine.

The two unless $sdk_detects??? True. This time they 'were' unnecessary, though the SDK's auto-update system does tend to create double-updates glitches with 'other' multiple choice lists in non-SDK scripts. Remove the 'unless...' and matching 'end' for both.

The SDK has a cool automatic update feature (nice ;) ) that unfortunately causes problems with non-SDK scripts. It's not a bug. But those non-SDK scripts that edit the lists for skills, items, messages tend to go loopy when using the SDK and makes the cursor skip every other option on the list.
Custom Item systems that draw their own windows, Skill systems that do the same with their own... and etc. They have to call @item_window.update on their own when not using the SDK, but can't when using the SDK.


"And I took the liberty of indenting your code again"
And accidentally cut out the beginning of the Configuration system. ;)

"No longer have to push a button to switch actors, instead you select what actor you wish to level-up"
As in, selecting the actor then going into the menu... you now have it set up so you can go between the actors without leaving the customization window.

It isn't obvious to the player that they have to press [Esc] to get into a the smaller sub-window to change between actors.
 
Wow, I was just looking for this script and found it updated. ^^

Hey, I have a question...what I want is for there to be two sets of stats that you can update when you level up. Basically, there are 'in battle' stats which are used in combat, and there are 'skill stats', which are used in the field for various feats. But when you level up, I want it to be that you can spend X amount of points on combat stats, and when you're done with those, then you gain X amount of points on field stats.

What makes it difficult is that I don't want you to be able to mix and match points between the two. You have X points which can only be used on combat stats and Y points which can only be used on field stats. I tried figuring it out myself, but I'm pretty RGSS inept. Any help would be appreciated.
 
Actually it was originally aliased, I must've deleted the line by mistake, my bad. heh >.>. For indenting, you did cut off a piece of the customization section, before it was released it was a lot worse then it is now (Before I fixed it up the script was 800 and some lines =D), so I am proud xD.

@Sailerius, I PMed you.
 

Fatray

Member

I think i've found something.
In line 282 there is this: @raise_window.refresh
but behind this there must be: (@syn_message)
==> @raise_window.refresh(@syn_message)

And I have 1 question.
Everytime I lvl up after a battle!!!(only after a battle) an go to the menu screen or even in the Point distribution window there are the Exp bars pushed down: http://img57.imageshack.us/my.php?image=bild3ft2.png
Maybe someone can help me.
 
Fatray;252591 said:
I think i've found something.
In line 282 there is this: @raise_window.refresh
but behind this there must be: (@syn_message)
==> @raise_window.refresh(@syn_message)

And I have 1 question.
Everytime I lvl up after a battle!!!(only after a battle) an go to the menu screen or even in the Point distribution window there are the Exp bars pushed down: http://img57.imageshack.us/my.php?image=bild3ft2.png
Maybe someone can help me.

Thanks for reporting #1, now fixed. As for #2 what Bar script are you using?
 

Fatray

Member

I'm using this 2 scripts (I don't know wich one is exactly the one with the bars)

The first one:

Code:
 HP/SP/EXP Gauge Script v1.00
# Distribution original support URL
# http://members.jcom.home.ne.jp/cogwheel/

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
=begin
class Game_Actor < Game_Battler
  def now_exp
    return @exp - @exp_list[@level]
  end
  def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
end

#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw HP Gauge
  #--------------------------------------------------------------------------
  # Modification of the original Draw HP process
  alias :draw_actor_hp_hpsp :draw_actor_hp
  def draw_actor_hp(actor, x, y, width = 144)
    # Determine the rate of fill based on the actor's HP and HP Max
    if actor.maxhp != 0
      rate = actor.hp.to_f / actor.maxhp
    else
      rate = 0
    end
    # plus_x:     revised x-coordinate
    # rate_x:     revised X-coordinate as (%)
    # plus_y:     revised y-coordinate
    # plus_width: revised width
    # rate_width: revised width as (%)
    # height:     Vertical width
    # align1: Type 1 ( 0: left justify  1: center justify 2: right justify )
    # align2: Type 2 ( 0: Upper stuffing 1: Central arranging  2:Lower stuffing )
    # align3: Gauge type 0:Left justify 1: Right justify
    plus_x = 0
    rate_x = 0
    plus_y = 25
    plus_width = 0
    rate_width = 100
    height = 10
    align1 = 1
    align2 = 2
    align3 = 0
    # Gradation settings:  grade1: Empty gauge   grade2:Actual gauge
    # (0:On side gradation   1:Vertically gradation    2: Slantedly gradation)
    grade1 = 1
    grade2 = 0
    # Color setting. color1: Outermost framework, color2: Medium framework
    # color3: Empty framework dark color, color4: Empty framework light/write color
    color1 = Color.new(0, 0, 0, 192)
    color2 = Color.new(255, 255, 192, 192)
    color3 = Color.new(0, 0, 0, 192)
    color4 = Color.new(64, 0, 0, 192)
    # Color setting of gauge
    # Usually color setting of the time    
    color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
    color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
    # Determine the gauge's width & fill based on the actor's HP
    if actor.maxhp != 0
      hp = (width + plus_width) * actor.hp * rate_width / 100 / actor.maxhp
    else
      hp = 0
    end
    # Drawing of gauge
    gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
                width, plus_width + width * rate_width / 100,
                height, hp, align1, align2, align3,
                color1, color2, color3, color4, color5, color6, grade1, grade2)
    # Call the original Draw HP process
    draw_actor_hp_hpsp(actor, x, y, width)
  end
  #--------------------------------------------------------------------------
  # * Draw SP Gauge
  #--------------------------------------------------------------------------
  # Modification of the original Draw SP process
  alias :draw_actor_sp_hpsp :draw_actor_sp
  def draw_actor_sp(actor, x, y, width = 144)
    # Determine the rate of fill based on the actor's SP and SP Max
    if actor.maxsp != 0
      rate = actor.sp.to_f / actor.maxsp
    else
      rate = 1
    end
    # plus_x:     revised x-coordinate
    # rate_x:     revised X-coordinate as (%)
    # plus_y:     revised y-coordinate
    # plus_width: revised width
    # rate_width: revised width as (%)
    # height:     Vertical width
    # align1: Type 1 ( 0: left justify  1: center justify 2: right justify )
    # align2: Type 2 ( 0: Upper stuffing 1: Central arranging  2:Lower stuffing )
    # align3: Gauge type 0:Left justify 1: Right justify
    plus_x = 0
    rate_x = 0
    plus_y = 25
    plus_width = 0
    rate_width = 100
    height = 10
    align1 = 1
    align2 = 2
    align3 = 0
    # Gradation settings:  grade1: Empty gauge   grade2:Actual gauge
    # (0:On side gradation   1:Vertically gradation    2: Slantedly gradation)
    grade1 = 1
    grade2 = 0
    # Color setting. color1: Outermost framework, color2: Medium framework
    # color3: Empty framework dark color, color4: Empty framework light/write color
    color1 = Color.new(0, 0, 0, 192)
    color2 = Color.new(255, 255, 192, 192)
    color3 = Color.new(0, 0, 0, 192)
    color4 = Color.new(0, 64, 0, 192)
    # Color setting of gauge
    # Usually color setting of the time       
    color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
    color6 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
    # Determine the gauge's width & fill based on the actor's SP
    if actor.maxsp != 0
      sp = (width + plus_width) * actor.sp * rate_width / 100 / actor.maxsp
    else
      sp = (width + plus_width) * rate_width / 100
    end
    # Drawing of gauge
    gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
                width, plus_width + width * rate_width / 100,
                height, sp, align1, align2, align3,
                color1, color2, color3, color4, color5, color6, grade1, grade2)
    # Call the original Draw HP process
    draw_actor_sp_hpsp(actor, x, y, width)
  end
  #--------------------------------------------------------------------------
  # * Draw EXP Gauge
  #--------------------------------------------------------------------------
  # Modification of the original Draw HP process
  alias :draw_actor_exp_hpsp :draw_actor_exp
  def draw_actor_exp(actor, x, y, width = 204)
    # Determine the rate of fill based on the actor's EXP and Next EXP
    if actor.next_exp != 0
      rate = actor.now_exp.to_f / actor.next_exp
    else
      rate = 1
    end
    # plus_x:     revised x-coordinate
    # rate_x:     revised X-coordinate as (%)
    # plus_y:     revised y-coordinate
    # plus_width: revised width
    # rate_width: revised width as (%)
    # height:     Vertical width
    # align1: Type 1 ( 0: left justify  1: center justify 2: right justify )
    # align2: Type 2 ( 0: Upper stuffing 1: Central arranging  2:Lower stuffing )
    # align3: Gauge type 0:Left justify 1: Right justify
    plus_x = 0
    rate_x = 0
    plus_y = 25
    plus_width = 0
    rate_width = 100
    height = 10
    align1 = 1
    align2 = 2
    align3 = 0
    # Gradation settings:  grade1: Empty gauge   grade2:Actual gauge
    # (0:On side gradation   1:Vertically gradation    2: Slantedly gradation)
    grade1 = 1
    grade2 = 0
    # Color setting. color1: Outermost framework, color2: Medium framework
    # color3: Empty framework dark color, color4: Empty framework light/write color
    color1 = Color.new(0, 0, 0, 192)
    color2 = Color.new(255, 255, 192, 192)
    color3 = Color.new(0, 0, 0, 192)
    color4 = Color.new(64, 0, 0, 192)
    # Color setting of gauge
    # Usually color setting of the time      
    color5 = Color.new(80 * rate, 80 - 80 * rate ** 2, 80 - 80 * rate, 192)
    color6 = Color.new(240 * rate, 240 - 240 * rate ** 2, 240 - 240 * rate, 192)
    # Determine the gauge's width & fill based on the actor's Next EXP
    if actor.next_exp != 0
      exp = (width + plus_width) * actor.now_exp * rate_width /
                                                          100 / actor.next_exp
    else
      exp = (width + plus_width) * rate_width / 100
    end
    # Drawing of gauge
    gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
                width, plus_width + width * rate_width / 100,
                height, exp, align1, align2, align3,
                color1, color2, color3, color4, color5, color6, grade1, grade2)
    # Call the original Draw EXP process
    draw_actor_exp_hpsp(actor, x, y)
  end
  #--------------------------------------------------------------------------
  # * Drawing of gauge
  #--------------------------------------------------------------------------
  def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
                color1, color2, color3, color4, color5, color6, grade1, grade2)
    case align1
    when 1
      x += (rect_width - width) / 2
    when 2
      x += rect_width - width
    end
    case align2
    when 1
      y -= height / 2
    when 2
      y -= height
    end
    # Framework Drawing
    self.contents.fill_rect(x, y, width, height, color1)
    self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2)
    if align3 == 0
      if grade1 == 2
        grade1 = 3
      end
      if grade2 == 2
        grade2 = 3
      end
    end
    if (align3 == 1 and grade1 == 0) or grade1 > 0
      color = color3
      color3 = color4
      color4 = color
    end
    if (align3 == 1 and grade2 == 0) or grade2 > 0
      color = color5
      color5 = color6
      color6 = color
    end
    # Drawing of empty gauge
    self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4,
                                  color3, color4, grade1)
    if align3 == 1
      x += width - gauge
    end
    #  Drawing of actual gauge
    self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4,
                                  color5, color6, grade2)
  end
end

#------------------------------------------------------------------------------
# New routine added to the Bitmap class. 
#============================================================================== 

class Bitmap
#-------------------------------------------------------------------------- 
# * Rectangle Gradation Indicator
#   color1: Start color 
#   color2: Ending color 
#   align: 0: On side gradation 
#          1: Vertically gradation 
#          2: The gradation (intense concerning slantedly heavily note) 
#-------------------------------------------------------------------------- 
  def gradation_rect(x, y, width, height, color1, color2, align = 0)
    if align == 0
      for i in x...x + width
        red   = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
        green = color1.green +
                (color2.green - color1.green) * (i - x) / (width - 1)
        blue  = color1.blue +
                (color2.blue - color1.blue) * (i - x) / (width - 1)
        alpha = color1.alpha +
                (color2.alpha - color1.alpha) * (i - x) / (width - 1)
        color = Color.new(red, green, blue, alpha)
        fill_rect(i, y, 1, height, color)
      end
    elsif align == 1
      for i in y...y + height
        red   = color1.red +
                (color2.red - color1.red) * (i - y) / (height - 1)
        green = color1.green +
                (color2.green - color1.green) * (i - y) / (height - 1)
        blue  = color1.blue +
                (color2.blue - color1.blue) * (i - y) / (height - 1)
        alpha = color1.alpha +
                (color2.alpha - color1.alpha) * (i - y) / (height - 1)
        color = Color.new(red, green, blue, alpha)
        fill_rect(x, i, width, 1, color)
      end
    elsif align == 2
      for i in x...x + width
        for j in y...y + height
          red   = color1.red + (color2.red - color1.red) *
                  ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          green = color1.green + (color2.green - color1.green) *
                  ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          blue  = color1.blue + (color2.blue - color1.blue) *
                  ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          alpha = color1.alpha + (color2.alpha - color1.alpha) *
                  ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          color = Color.new(red, green, blue, alpha)
          set_pixel(i, j, color)
        end
      end
    elsif align == 3
      for i in x...x + width
        for j in y...y + height
          red   = color1.red + (color2.red - color1.red) *
                ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          green = color1.green + (color2.green - color1.green) *
                ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          blue  = color1.blue + (color2.blue - color1.blue) *
                ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          alpha = color1.alpha + (color2.alpha - color1.alpha) *
                ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
          color = Color.new(red, green, blue, alpha)
          set_pixel(i, j, color)
        end
      end
    end
  end
end
=end

and the second:

Code:
#===========================================================================
# *** HP/MP/ATB/LimitBreak bar Slanted Style Compatible with RTAB ***
# *** Version 2.1
#---------------------------------------------------------------------------
# by Clive 
# based on Cogwheel's Bars and Sephiroth Spawn's Slanted Bars.
#---------------------------------------------------------------------------
# ----- GREAT THANKS to DerVVulfman for solving the lag problem
#------This is a plug and play script so it should work without any problem!
#=============================================================================

# If using with Limit Break, must paste BELOW the Limit Break script as it re-
# writes the 'Gauge drawing' system.  Will cause an error if not properly put.

# If used with Trickster's STEAL SCRIPT version 6 R1 (revision 1), then the
# height of RTAB's AT Bar (Draw Actor ATG) may not be smaller than 5 pixels 
# due to a float-to-float error.  A height of 6 pixels is the smallest.


#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get the current EXP
  #--------------------------------------------------------------------------
  def now_exp
    return @exp - @exp_list[@level]
  end
  #--------------------------------------------------------------------------
  # * Get the next level's EXP
  #--------------------------------------------------------------------------
  def next_exp
    return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  end
end


#==============================================================================
# ** Window_Base 
#------------------------------------------------------------------------------
#  This class is for all in-game windows.
#==============================================================================

class Window_Base < Window  
  
  #==========================================================================
  # * Draw Slant Bar(by SephirothSpawn)
  #==========================================================================
  def draw_slant_bar(x, y, min, max, width = 152, height = 6,
      bar_color = Color.new(150, 0, 0, 255),
      end_color = Color.new(255, 255, 60, 255))
    # Draw Border
    for i in 0..height
      self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
    end
    # Draw Background
    for i in 1..(height - 1)
      r = 100 * (height - i) / height + 0 * i / height
      g = 100 * (height - i) / height + 0 * i / height
      b = 100 * (height - i) / height + 0 * i / height
      a = 255 * (height - i) / height + 255 * i / height
      self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
    end
    # Draws Bar
    for i in 1..( (min.to_f / max.to_f) * width - 1)
      for j in 1..(height - 1)
        r = bar_color.red * (width - i) / width + end_color.red * i / width
        g = bar_color.green * (width - i) / width + end_color.green * i / width
        b = bar_color.blue * (width - i) / width + end_color.blue * i / width
        a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
        self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
      end
    end
  end
  
  #==========================================================================
  # * Draw HP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #==========================================================================
  alias :draw_actor_hp_hpsp :draw_actor_hp
  def draw_actor_hp(actor, x, y, width = 144)   
    draw_slant_bar(x, y + 12, actor.hp, actor.maxhp, width, 6, 
      bar_color = Color.new(150, 0, 0, 255), 
      end_color = Color.new(255, 255, 60, 255))
    draw_actor_hp_hpsp(actor, x, y, width)
   end
  #==========================================================================
  # * Draw SP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #==========================================================================
  alias :draw_actor_sp_hpsp :draw_actor_sp
  def draw_actor_sp(actor, x, y, width = 144)
    draw_slant_bar(x, y + 12, actor.sp, actor.maxsp, width, 6,
      bar_color = Color.new(0, 0, 155, 255), 
      end_color = Color.new(255, 255, 255, 255))
    draw_actor_sp_hpsp(actor, x, y, width)
  end
  #==========================================================================
  # * Draw EXP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #==========================================================================
  alias raz_bars_base_exp draw_actor_exp  
  def draw_actor_exp(actor, x, y)
    if actor.level == 99
      draw_slant_bar(x, y + 18, 1, 1, 190, 6, bar_color = Color.new(0, 100, 0, 255), end_color = Color.new(0, 255, 0, 255))
    else
      draw_slant_bar(x, y + 18, actor.now_exp, actor.next_exp, 190, 6, bar_color = Color.new(0, 100, 0, 255), end_color = Color.new(255, 255, 255, 255))
    end
    raz_bars_base_exp(actor, x, y)
  end
  #==========================================================================
  # * Draw Parameter
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     type  : parameter type (0-6)
  #==========================================================================
  alias raz_bars_base_parameter draw_actor_parameter  
  def draw_actor_parameter(actor, x, y, type)
    case type
    when 0
      para_color1 = Color.new(100,0,0)
      para_color2 = Color.new(255,0,0)
      para_begin = actor.atk
    when 1
      para_color1 = Color.new(100,100,0)
      para_color2 = Color.new(255,255,0)
      para_begin = actor.pdef
    when 2
      para_color1 = Color.new(100,0,100)
      para_color2 = Color.new(255,0,255)
      para_begin = actor.mdef
    when 3
      para_color1 = Color.new(50,0,100)
      para_color2 = Color.new(50,0,255)
      para_begin = actor.str
    when 4
      para_color1 = Color.new(0,100,0)
      para_color2 = Color.new(0,255,0)
      para_begin = actor.dex
    when 5
      para_color1 = Color.new(50,0,50)
      para_color2 = Color.new(255,0,255)
      para_begin = actor.agi
    when 6
      para_color1 = Color.new(0,100,100)
      para_color2 = Color.new(0,255,255)
      para_begin = actor.int
    end
    draw_slant_bar(x, y + 18, para_begin, 999, 155, 4, bar_color = para_color1,
      end_color = para_color2)
    raz_bars_base_parameter(actor, x, y, type)
  end
  #=========================================================================
  # * Draw Actor ATG
  #     actor : Actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #=========================================================================
  def draw_actor_atg(actor, x, y, width = 144, height = 6)
    if @at_gauge == nil
      # plus_x:     revised x-coordinate
      # rate_x:     revised X-coordinate as (%)
      # plus_y:     revised y-coordinate
      # plus_width: revised width
      # rate_width: revised width as (%)
      # height:     Vertical width
      # align1: Type 1 ( 0: left justify  1: center justify 2: right justify )
      # align2: Type 2 ( 0: Upper stuffing 1: Central arranging  2:Lower stuffing )
      # align3: Gauge type 0:Left justify 1: Right justify
      @plus_x = 0
      @rate_x = 0
      @plus_y = 16
      @plus_width = 0
      @rate_width = 100
      @width = @plus_width + width * @rate_width / 100
      @height = 6
      @align1 = 0
      @align2 = 1
      @align3 = 0
      # Gradation settings:  grade1: Empty gauge   grade2:Actual gauge
      # (0:On side gradation   1:Vertically gradation    2: Slantedly gradation)
      grade1 = 1
      grade2 = 0
      # Color setting. color1: Outermost framework, color2: Medium framework
      # color3: Empty framework dark color, color4: Empty framework light/write color
      color1 = Color.new(0, 0, 0)
      color2 = Color.new(255, 255, 192)
      color3 = Color.new(0, 0, 0, 192)
      color4 = Color.new(0, 0, 64, 192)
      # Color setting of gauge
      # Usually color setting of the time
      color5 = Color.new(0, 64, 80)
      color6 = Color.new(255, 255, 255)#(0, 128, 160)
      # When gauge is MAX, color setting
      color7 = Color.new(80, 0, 0)
      color8 = Color.new(255, 255,255) #(240,0,0)
      # Color setting at time of cooperation skill use
      color9 = Color.new(80, 64, 32)
      color10 = Color.new(255, 255, 255) #(240, 192, 96)
      # Color setting at time of skill permanent residence
      color11 = Color.new(80, 0, 64)
      color12 = Color.new(255,255, 255) #(240, 0, 192)
      # Drawing of gauge
      gauge_rect_at(@width, @height, @align3, color1, color2, color3, color4,
          color5, color6, color7, color8, color9, color10, color11, color12,
          grade1, grade2)
    end
    # Variable at substituting the width of the gauge which is drawn
    if actor.rtp == 0
      at = (width + @plus_width) * actor.atp * @rate_width / 10000
    else
      at = (width + @plus_width) * actor.rt * @rate_width / actor.rtp / 100
    end
    # AT Width Check
    if at > width
      at = width
    end
    # Revision such as the left stuffing central posture of gauge
    case @align1
    when 1
      x += (@rect_width - width) / 2
    when 2
      x += @rect_width - width
    end
    case @align2
    when 1
      y -= @height / 2
    when 2
      y -= @height
    end
    # Draw Border
    for i in 0..height
      self.contents.fill_rect(x + 1.5 + i, y + 12 + height - i, width - 2 , 3,
        Color.new(50, 50, 50, 255))
    end
    # Draw Background
    for i in 1..(height - 1)
      r = 100 * (height - i) / height + 0 * i / height
      g = 100 * (height - i) / height + 0 * i / height
      b = 100 * (height - i) / height + 0 * i / height
      a = 255 * (height - i) / height + 255 * i / height
      self.contents.fill_rect(x + 1.5 + i, y + 12 + height - i, width - 3, 3, 
        Color.new(r, b, g, a))
    end
    # Rect_X control
    if @align3 == 0
      rect_x = 0
    else
      x += @width - at - 1
      rect_x = @width - at - 1
    end

    # Color setting of gauge
    if at == width 
    #Gauge drawing at the time of MAX
      for i in 0..height
        self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y -i + 
        @plus_y, @at_gauge, Rect.new(rect_x, @height * 2, at, @height))
      end
    else
      if actor.rtp == 0
        for i in 0..height
          # Usually gauge drawing of the time
          self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y- i + 
            @plus_y, @at_gauge,Rect.new(rect_x, @height, at, @height))
        end
      else
        if actor.spell == true
          for i in 0..height
            #Gauge drawing at time of cooperation skill use
            self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y - i + 
              @plus_y, @at_gauge, Rect.new(rect_x, @height * 3, at, @height))
          end
        else
          for i in 0..height              
            # Gauge drawing at time of skill permanent residence
            self.contents.blt(x + i + @plus_x + @width * @rate_x / 100, y - i +
              @plus_y, @at_gauge, Rect.new(rect_x, @height * 4, at, @height))
          end
        end
      end
    end
  end
  #=========================================================================
  # * Draw Actor Limit Break Bar
  #     actor : Actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #=========================================================================
  def draw_actor_lb(actor, x, y, width = 144)
    rate = actor.limitbreak.to_f / LB_MAX
    plus_x = 0
    rate_x = 0
    plus_y = 15
    plus_width = 0
    rate_width = 100
    height = 7
    lb = (width + plus_width) * actor.limitbreak * rate_width / 100 / LB_MAX
    # Drawing of gauge
    if actor.limitbreak == LB_MAX
      # Draw Silver Blue Bar
      draw_slant_bar(x + plus_x + width * rate_x / 100, y + plus_y, lb, width,
        width, height, od_color1 = Color.new(0,80,200,192), 
        od_color2 = Color.new(255,255,255,192))
    else
      # Draw Green Bar
      draw_slant_bar(x + plus_x + width * rate_x / 100, y + plus_y, lb, width,
        width, height, od_color1 = Color.new(31, 128, 0, 128), 
        od_color2 = Color.new(255, 255, 191))
    end
  end  
end
 
Quick Question, how do you give characters points? Like, say you have a character join the party had level 20. Since they hadn't been there to level up, it'd be nice if you could give them 100 points to distribute.
 
Sorry for the late replies, got busy >.>

Anyways:

@Fatray; The first one is enclosed in =begin and =end tags. Tried it anyways and it works, same with the second. So try the script posted on the site and not in the demo.

@Kaze950; This can be done with the following in a call Script window:
Code:
$game_actors[x].upgrade_points += y
x = Actors ID from the Database to add Y points to
y = The amount of Ability points to add.
 
ok slight problem with the script, i have multiple combat events in my game, (aka after you finish one fight you move on to the next, like a 5 tier fight from one event) and if a charactor levels up it restarts the whole event. (I have it set to call the points spending screen after each time you level up).

Now i imagine i could split the events into multiple events that trigger off switches when the prior fight finishes, but was hoping there was instead an easy fix with this code to keep it from doing that?
 
you mean like all of the scripts i use? or just your script? not sure i understand? but here's how i have your script?
Code:
#============================================================================
#                            Actor Customization!  
#----------------------------------------------------------------------------
# Written by Synthesize
# Version 5.021
# July 28, 2007
# Tested with SDK 2.2
#============================================================================

#--------------------------------------------------------------------------
# * Begin Actor Customization modification section*
# Use this section to control many aspects of the script.
# May it be from Message display to Custom Actor Statistic growth
#--------------------------------------------------------------------------
module Customize
  # *General Settings*
  Points_Gained = 5   # Amount of points gained upon leveling up.
  Map_bg = true  # Display the map as the BG? true = yes. false = no; display a picture instead
  Draw_display = true   # Display Statistic advancement preview?
  Draw_face = false   # Draw Face or Character Sprite?. True= face, false; sprite
  Error_sound = '057-Wrong01' # Change the sound effect when insufficient supply
  Picture_name = 'sky'   # Name of your background. Leave blank if not used.
  #----
  # *Messages Control Center*
  # There are a total of seven messages, below you can customize each one
  Messages = ['HP has Increased', 'SP has Increased', 'Strength has Increased',
  'Dexterity has Increased', 'Agility has Increased', "Intellegence has Increased",
  "Please distribute your points", "Not Enough Points"]  
  # Define the messages. 0=HP, 1=SP, 2=STR, 3=DEX, 4=AGI, 
  # 5=INT, 6=Default, 7=Not enough Points
  #----
  # This area allows you to define custom Statistic Advancement.
  # Example, have Actor 1 get 7 HP and 3 STR but have Actor 2 receive 3 HP and 7 STR
# Define the Custom Stat actors below.
  Actor_HP = {5 => 10, 2 => 8
  } # Define the amount of HP an actor gets per point. {actor_id => amount}. 
    # Seperate Actors with a comma (,).
  Actor_HP.default = 3 # Change this to set the default growth
  Actor_SP = {1 => 7
  } # Define the Amount of SP an actor gets per point. {actor_id => amount}
    # Seperate Actors with a comma(,)
  Actor_SP.default = 3 # Change this to set the default growth
  Actor_STR = {1 => 3, 2 => 4
  } # Define the Amount of STR an actor gets per point. {actor_id => amount}
    # Seperate Actors with a comma(,)
  Actor_STR.default = 1 # Change this to set the default growth
  Actor_DEX = {1 => 5
  } # Define the Amount of DEX an actor gets per point. {actor_id => amount}
    # Seperate Actors with a comma(,)
  Actor_DEX.default = 1 # Change this to set the default growth
  Actor_AGI = {1 => 2
  } # Define the Amount of AGI an actor gets per point. {actor_id => amount}
    # Seperate Actors with a comma(,)
  Actor_AGI.default = 1 # Change this to set the default growth
  Actor_INT = {1 => 1
  } # Define the Amount of INT an actor gets per point. {actor_id => amount}
    # Seperate Actors with a comma(,)
  Actor_INT.default = 1 # Change this to set the default growth
  # Note: To use the Default statistic growth simply leave an actor value blank.
  end      

#--------------------------------------------------------------------------
# * Create Upgrade Points & Add Points on Level-up
#--------------------------------------------------------------------------
class Game_Actor < Game_Battler        
    # Make Upgrade Points
    attr_accessor :upgrade_points   
    alias synthesize_upgrade_points setup
    # Distribute Points among Actors 
    def setup(actor_id)
    synthesize_upgrade_points(actor_id)
    # Starting amount of points 
    @upgrade_points = 0
  end

  alias syn_ac_add_points exp=
  def exp=(exp)
    @exp = [[exp, 9999999].min, 0].max
    # Level up
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      @upgrade_points += Customize::Points_Gained
      $scene = Scene_Upgrade.new 
      # Learn skill
      for j in $data_classes[@class_id].learnings
      if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
  syn_ac_add_points(exp)
    end
 end
  #----------------------------------------------------------------------------
  # End Game_Actor Edit
  #----------------------------------------------------------------------------

 #--------------------------------------------------------------------------
 # Scene_Upgrade
 # This is the main scene of 'Actor Customization!'
 # Editing not recommended.
 #--------------------------------------------------------------------------
  class Scene_Upgrade
  #--------------------------------------------------------------------------
  # Object Initalize
  #--------------------------------------------------------------------------
    def initialize(actor_index = 0)
      # Define Actor_index. Used to draw actors and for multiple actor support
      @actor_index = actor_index
      # Define Actor Data
      @actor = $game_party.actors[@actor_index]
      @hp = Customize::Actor_HP[@actor.id]
      @sp = Customize::Actor_SP[@actor.id]
      @str = Customize::Actor_STR[@actor.id]
      @dex = Customize::Actor_DEX[@actor.id]
      @agi = Customize::Actor_AGI[@actor.id]
      @int = Customize::Actor_INT[@actor.id]
      @syn_message = Customize::Messages[6]   # The Default Message
  end
  #--------------------------------------------------------------------------
  # * Main Window Initialize
  #--------------------------------------------------------------------------
  def main
    # Draw background
      main_spriteset
    # Make Commands
      s1 = "Increase #{$data_system.words.hp} by #{@hp}"   
      s2 = "Increase #{$data_system.words.sp} by #{@sp}"   
      s3 = "Increase #{$data_system.words.str} by #{@str}"  
      s4 = "Increase #{$data_system.words.dex} by #{@dex}" 
      s5 = "Increase #{$data_system.words.agi} by #{@agi}"  
      s6 = "Increase #{$data_system.words.int} by #{@int}"  
      # Define Command Window
      @command_window = Window_Command.new(275, [s1, s2, s3, s4, s5, s6])
      @command_window.x = 343
      @command_window.y = 56
      @command_window.z = 9998
      @command_window.opacity = 200
      # Turn the Command Window On
      @command_window.active = true
	    @upgrade_status_window = Window_UpgradeStatus.new(@actor, @hp, @sp, @str, @dex, @agi, @int)
      @upgrade_status_window.opacity= 200
      @upgrade_status_window.x = 18
	    @upgrade_status_window.y = 112
	    @upgrade_status_window.z = 9998
      # Set Raise Window Data
      @raise_window = Window_Feedback.new(@syn_message)
      @raise_window.x = 18
      @raise_window.y = 56
      @raise_window.z = 9998
      @raise_window.opacity = 200
      # Set Actor Swap Window
      @actor_window = Window_ActorList.new
      @actor_window.x = 344
      @actor_window.y = 277
      @actor_window.z = 9998
      @actor_window.opacity = 200
      @actor_window.active = false
      @actor_window.index = 0
      # Graphics Transition
      Graphics.transition
      # Main Loop
      loop do
      # Update Graphics
      Graphics.update
      # Update Input
      Input.update
      # Renew
      update
      # Discontinue Loop
      if $scene != self
        break
      end
    end
      # Prepare Transition
      Graphics.freeze
     # Dispose Windows
      @command_window.dispose
      @upgrade_status_window.dispose
      @raise_window.dispose
      @actor_window.dispose
      @background.dispose
      if Customize::Draw_face == true
        @face.dispose
    end
  end
  #--------------------------------------------------------------------------
  # * Spriteset Initialize
  #--------------------------------------------------------------------------
  def main_spriteset
    # Draw either the Map or a Background Image
    if Customize::Map_bg == true
    # Draw the Map
    @background = Spriteset_Map.new
  else
    # Define the Background
    @background = Sprite.new
    @background.bitmap = RPG::Cache.picture(Customize::Picture_name)
  end
    # Draw Actors Face
  if Customize::Draw_face == true
    @face = Sprite.new
    @face.bitmap = RPG::Cache.picture(@actor.name + "_face")
    @face.x = 40
    @face.y = 120
    @face.z = 9999
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
      @command_window.update
      @actor_window.update
    # If command window is active: call update_command
      if @command_window.active
      update_command
      return
    end
    # If Actor Window active call update_actor
    if @actor_window.active
      update_actor
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Update Command *
  #--------------------------------------------------------------------------
  def update_command
   # If B button was pressed
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @actor_window.active = true
      @command_window.active = false
      return
    end
      # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 0  # Increase HP
        if @actor.upgrade_points >= 1 and @actor.maxhp <= 9998
          $game_system.se_play($data_system.decision_se)
          @syn_message = Customize::Messages[0]
          @actor.upgrade_points -= 1
          @actor.hp += @hp
          @actor.maxhp += @hp
          @upgrade_status_window.refresh
          @raise_window.refresh(@syn_message)
        else
          @syn_message = Customize::Messages[7]
          @raise_window.refresh(@syn_message)
          $game_system.se_play(RPG::AudioFile.new(Customize::Error_sound))
        end
      when 1  # # Increase SP
        if @actor.upgrade_points >= 1 and @actor.maxsp <= 9998
          $game_system.se_play($data_system.decision_se)
          @syn_message = Customize::Messages[1]
          @actor.upgrade_points -= 1
          @actor.sp += @sp
          @actor.maxsp += @sp
          @upgrade_status_window.refresh
          @raise_window.refresh(@syn_message)
        else
          @syn_message = Customize::Messages[7]
          @raise_window.refresh(@syn_message)
          $game_system.se_play(RPG::AudioFile.new(Customize::Error_sound))
        end
      when 2  # # Increase STR
        if @actor.upgrade_points >= 1 and @actor.str <= 998
          $game_system.se_play($data_system.decision_se)
          @syn_message = Customize::Messages[2]
          @actor.str += @str         
          @actor.upgrade_points -= 1
          @upgrade_status_window.refresh
          @raise_window.refresh(@syn_message)
        else
          @syn_message = Customize::Messages[7]
          @raise_window.refresh(@syn_message)
          $game_system.se_play(RPG::AudioFile.new(Customize::Error_sound))
        end
      when 3  # # Increase DEX
        if @actor.upgrade_points >= 1 and @actor.dex <= 998
          $game_system.se_play($data_system.decision_se)
          @syn_message = Customize::Messages[3]
          @actor.upgrade_points -= 1
          @actor.dex += @dex
          @upgrade_status_window.refresh
          @raise_window.refresh(@syn_message)
        else
          @syn_message = Customize::Messages[7]
          @raise_window.refresh(@syn_message)
          $game_system.se_play(RPG::AudioFile.new(Customize::Error_sound))
        end
      when 4  # # Increase AGI
        if @actor.upgrade_points >= 1 and @actor.agi <= 998
          $game_system.se_play($data_system.decision_se)
          @syn_message = Customize::Messages[4]
          @actor.upgrade_points -= 1
          @actor.agi += @agi
          @upgrade_status_window.refresh
          @raise_window.refresh(@syn_message)
        else
          @syn_message = Customize::Messages[7]
          @raise_window.refresh(@syn_message)
          $game_system.se_play(RPG::AudioFile.new(Customize::Error_sound))
        end
      when 5  # # Increase INT
        if @actor.upgrade_points >= 1 and @actor.int <= 998
          $game_system.se_play($data_system.decision_se)
          @syn_message = Customize::Messages[5]
          @actor.upgrade_points -= 1
          @actor.int += @int
          @upgrade_status_window.refresh
          @raise_window.refresh(@syn_message)
        else
          @syn_message = Customize::Messages[7]
          @raise_window.refresh(@syn_message)
          $game_system.se_play(RPG::AudioFile.new(Customize::Error_sound))
        end
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Actor Swap *
  #--------------------------------------------------------------------------
  def update_actor
    # 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)
      # Swap Actors
      $game_system.se_play($data_system.decision_se)
      @actor_index = @actor_window.index
      $scene = Scene_Upgrade.new(@actor_index)
  end
 end
end

#--------------------------------------------------------------------------
# * Begin Window Data
#--------------------------------------------------------------------------
#=================================
# *Status Window*
#=================================
  class Window_UpgradeStatus < Window_Base
    # Initiate Actor Data
  def initialize(actor, hp, sp, str, dex, agi, int)
    # Define Window Reso.
	super(32, 32, 330, 300)
  # Set Contents
	self.contents = Bitmap.new(width - 32, height - 32)
  # Define Actor Data
	@actor = actor
  @hp = hp
  @sp = sp
  @str = str
  @dex = dex
  @agi = agi
  @int = int
  # Jump to Update
	refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    # Clear Window Contents
	self.contents.clear
  # Draw Actor Data
  if Customize::Draw_face == false
    draw_actor_graphic(@actor, 35, 50)
  end
  draw_actor_class(@actor, 85, 20)
  draw_actor_name(@actor, 80, 0)
	draw_actor_level(@actor, 176, 0)
  self.contents.font.color = system_color 
  # Draw Stat Display Preview
  if Customize::Draw_display == true
      self.contents.draw_text(85, 12, 35, 100, "Before:") 
      self.contents.draw_text(200, 12, 35, 100, "After:") 
      if @actor.upgrade_points >= 1 and @actor.maxhp <= 9998
        draw_synac_preview(@actor,176, 34, 0, @hp)
      end
        if @actor.upgrade_points >= 1 and @actor.maxsp <= 9998
        draw_synac_preview(@actor,176, 56, 1, @sp)
      end
      if @actor.upgrade_points >= 1 and @actor.str <= 998
        draw_synac_preview(@actor,176, 98, 2, @str)
      end
        if @actor.upgrade_points >= 1 and @actor.dex <= 998
        draw_synac_preview(@actor,176, 123, 3, @dex)
      end
      if @actor.upgrade_points >= 1 and @actor.agi <= 998
        draw_synac_preview(@actor,176, 148, 4, @agi)
      end
      if @actor.upgrade_points >= 1 and @actor.int <= 998
        draw_synac_preview(@actor,176, 173, 5, @int)
        end
      end
      # Draw additional Stats
	draw_actor_hp(@actor, 4, 68, 172)
	draw_actor_sp(@actor, 4, 90, 172)   
	draw_actor_parameter(@actor, 4, 132, 3)
	draw_actor_parameter(@actor, 4, 156, 4)
	draw_actor_parameter(@actor, 4, 180, 5)
	draw_actor_parameter(@actor, 4, 204, 6) 
  # Draw Point Data
  self.contents.font.color = system_color
  self.contents.draw_text(175, 205, 100, 100, "Points:")
  self.contents.font.color = normal_color
  self.contents.draw_text(165, 205, 100, 100, @actor.upgrade_points.to_s, 2)
end
  #=======================================================
  # Draw SC Preview
  #=======================================================
    def draw_synac_preview(actor,x, y, stat, value)
      if stat == 0
      minpreview = actor.hp + value
      maxpreview = actor.maxhp + value   
    elsif stat == 1
      minpreview = actor.sp + value
      maxpreview = actor.maxsp + value  
    elsif stat == 2
      maxpreview = actor.str + value  
    elsif stat == 3
      maxpreview = actor.dex + value  
    elsif stat == 4
      maxpreview = actor.agi + value  
    elsif stat == 5
      maxpreview = actor.int + value  
    end
    if stat > 1
      self.contents.font.color = crisis_color
      self.contents.draw_text(x, y, 12, 100, "=>") 
      self.contents.font.color = system_color
      self.contents.draw_text(x+24, y, 100, 100, "#{maxpreview}") 
    else
      self.contents.font.color = crisis_color
      self.contents.draw_text(x, y, 12, 100, "=>") 
      self.contents.font.color = system_color
      self.contents.draw_text(x+24, y, 100, 100, "#{minpreview}/#{maxpreview}") 
      end
    end
end
#--------------------------------------------------------------------------
# Raise Window
#--------------------------------------------------------------------------
class Window_Feedback < Window_Base
  def initialize(syn_message)
    super(0, 0, 330, 60)
    @syn_message = syn_message
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh(@syn_message)
  end
  def refresh(syn_message)
    @syn_message = syn_message
    # Clear the Window
    self.contents.clear
    # Draw the Message ID
    self.contents.draw_text(0, 0, 300, 34, @syn_message)
  end
end 
#--------------------------------------------------------------------------
# Actor Window
#--------------------------------------------------------------------------
class Window_ActorList < Window_Selectable
  
  def initialize
    super(0, 0, 275, 85)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.active = false
    self.index = -1
    @item_max = $game_party.actors.size
    @column_max = 2
    draw_actor
    self.active = false
    self.index = 0
  end
  
  def draw_actor
   for i in 0...$game_party.actors.size
    actor = $game_party.actors[i]
      x = i * 65
      y = 50
      draw_actor_graphic(actor, x + 20, y)
    end
    end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    self.cursor_rect.set(0 + index * 65, 0, 40, 54)
  end
end 

#                            
#----------------------------------------------------------------------------
# Written by Synthesize
# Additional Thanks: Icedmetal57 (Custom Stat Progression), Trickster (Bug smashing)
# DerVVulfman (SDK Module detection idea & Alias help). Community for reporting bugs and support ^-^
#----------------------------------------------------------------------------
#                           Actor Customization! 
#============================================================================
 
Alright I tried it out, tried both the script you posted and my old one and I have no problems with or without the SDK. Are you using a CBS? and how is your event set-up? I made a quick event and tried all of the triggers with no problems.
 
not using a cbs at all only thing else that has to do with levelling at all is a refresh hp / sp on level up, but that's it.
event is setup kinda like
text choice "are you ready?"
if yes
battle process
if win
text
battle process
if win
text
transfer to map location
if lose
game over
if lose
game over
if no
branch end
 
it only starts repeating if the charactors level up after a battle and when they level up it sends it back to the beginning of the event and starts from step one. after you get through it like five times then you can finally get through it cause none of them level during the encounter

edit: you have a messenger or something i can get ahold of you on so as not to keep waiting forum space?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top