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

astrin24;190606 said:
Is there a way, the Customisation screen could appear after every battle?

Yes, add the following under all of the Game_Actor class. (Line 52 in newest version)

Code:
class Scene_Battle
def battle_end(result)
  $scene = Scene_Upgrade.new
  end
end

Cheers,

Syn.
 
That is not right Synthesize you are replacing the whole method battle_end in Scene_Battle which is going to cause problems if you are going to overwrite the entire method (which I don't recommend you to do) it would be this

Code:
  def battle_end(result)
[B]    # Clear in battle flag
    $game_temp.in_battle = false
    # Clear entire party actions flag
    $game_party.clear_actions
    # Remove battle states
    for actor in $game_party.actors
      actor.remove_states_battle
    end
    # Clear enemies
    $game_troop.enemies.clear
    # Call battle callback
    if $game_temp.battle_proc != nil
      $game_temp.battle_proc.call(result)
      $game_temp.battle_proc = nil
    end[/B]
    # Switch to map screen
    $scene = Scene_Upgrade.new
  end

Take special note of what I bolded that is what you are going to break with your modifications

1) the scripts will always think it is in battle the in_battle flag is not reset
2) actions will not be cleared
3) enemies will not be cleared (you may have multiple occurences of enemies if the last battle was lost)
4) States that are to be removed at the end of battle will not be removed
5) This is for the call battle command calls code that happens after battle in the event
6) May break other scripts (For example without calling the method <Game_Battler>.remove_states_battle some of my scripts will not work properly -one of those key methods I modify-)

Instead of overwriting that method alias it (use alias_method instead of alias for SDK users)

Code:
alias_method :synthesize_customization_battle_battle_end, :battle_end
def battle_end(result)
  synthesize_customization_battle_battle_end(result)
  $scene = Scene_Upgrade.new
end

This way it will ignore the $scene = Scene_Map.new and just goto the upgrade screen
 

Taylor

Sponsor

This looks cool, I might use it myself. I'm just wondering how could I manually add 'Upgrade Points' with an event? For things like rewards after minigames.
 
Jirbytaylor;191538 said:
This looks cool, I might use it myself. I'm just wondering how could I manually add 'Upgrade Points' with an event? For things like rewards after minigames.

This can be done with the following in a 'Call Script' event command:
$game_party.actors[id].upgrade_points += #

ID = The spot of the party in which you wish to add points to (Ie. 0 for First actor up to 3)

# = The numerical value of how many points you wish to add.


Cheers,

Syn.
 

Taylor

Sponsor

Thanks. Err... I tried it but it doesn't seem to work because of the length of the command.(stupid small Call script window :<) Although at first it know it's one line(deleting letters moves it to one line), when you re-open the window it becomes two lines (deleting letters does not fit it onto one line like before.)

I also found incompatability with ccoa's Advanced Weather system. If a weather includes screen flashes, like Storm with thunder, the flash appears but doesn't disapear if it flashes while the window is open. It only does when the customisation screen is closed.
 
Jirbytaylor;192549 said:
Thanks. Err... I tried it but it doesn't seem to work because of the length of the command.(stupid small Call script window :<) Although at first it know it's one line(deleting letters moves it to one line), when you re-open the window it becomes two lines (deleting letters does not fit it onto one line like before.)

I also found incompatability with ccoa's Advanced Weather system. If a weather includes screen flashes, like Storm with thunder, the flash appears but doesn't disapear if it flashes while the window is open. It only does when the customisation screen is closed.

1.) Try
Code:
$game_actors[id].upgrade_points += #
id = Actor ID specified from the database (IE. Aluxes = 1)

# = Numerical value to add.

2.) Hopefully fixed (Not tested, at school). Replace your script with the one found on the first post.

Also, I will be gone for the next two weeks (As of tomorrow) so ask questions now.

Cheers,

Syn.
 
Hey this is my first post in this forum so I figured what better way to start out than to say thanks for a great addition to my game (and any game, character customization is a must!)
So...thanks!
-Cy
 

Giam

Member

How would I stop it from using points once my attribute is maxed? Like right now with 999 strength it will still take points, how do I stop this?

Also, how would I make it so you can only level up a certain stat once another is close. Um. Example:

My INT can't be 200+ points above my AGI. Meaning once my INT is 400 and AGI is 600 I would have to lvl up my INT to lvl up my AGI.
 
I have trouble with this script. It seems that when I gain a level up it works great, but it doesn't distribute points amongst all my actors. Only one of them gets all the points for the battle, even though both of them got to fight. Is their some kind of fix for this or something?
 

cyray7

Member

hey i hope this doesnt count as necroposting but i am getting this error when i start up my game:

Script 'whatever i call it' line 137: SystemStackError occurred.

stack level too deep


so what do i do? i have the newest version of this script and i alway put it above main, i have tried putting it below my other scripts, above my other scripts, and below sdk (dont know why just tried that i am desperate), but i still get this error. so what do i do?
 
I've fixed this problem a few pages ago.
Try with this:
Code:
#=================================
# Syn's Upgrade Customization V4.8.61 (3/28/07)
# Created by Synthesize
# Help from Raziel, Trickster, Icedmetal57
#=================================

module Upgrade_Points 
  Points_Gained = 3 # Amount of points gained upon leveling.
  Hp_rise = 12 # The amount of HP to raise per point
  Sp_rise = 8 # The amount of SP to raise per point
  Str_rise = 10 # The amount of STR to raise
  Dex_rise = 3 # The amount of DEX to raise
  Agi_rise = 2 # The amount of AGI to raise  
  Int_rise = 4 # The amount of INT to raise    
  Error_sound = '057-Wrong01' # Change the sound effect when Upgrade Points equals zero.
end

#=================================
# *Begin Script*
#=================================
#=================================
# *Create Points*
#=================================
class Game_Actor < Game_Battler															   
  attr_accessor :upgrade_points 
  alias stat_point_lvlup_game_actor_setup setup
  def setup(actor_id)
	  stat_point_lvlup_game_actor_setup(actor_id)
	  @upgrade_points = 0
  end
  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 += Upgrade_Points::Points_Gained
	    # Learn skill
	    for j in $data_classes[@class_id].learnings
		  if j.level == @level
		    learn_skill(j.skill_id)
      end
	  end
	end
  while @exp < @exp_list[@level]
    @level -= 1
	end
    @hp = [@hp, self.maxhp].min
	  @sp = [@sp, self.maxsp].min
  end
end

#=================================
# Begin Upgrade Code
#=================================

class Scene_Upgrade
  #--------------------------------------------------------------------------
  # Object Initalize
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0)
	  @actor_index = actor_index
  end
  def main
    @spriteset = Spriteset_Map.new
    s1 = "Increase Health by #{Upgrade_Points::Hp_rise} "
	  s2 = "Increase Magic by #{Upgrade_Points::Sp_rise} "
	  s3 = "Increase Strength by #{Upgrade_Points::Str_rise} "
	  s4 = "Increase Dexterity by #{Upgrade_Points::Dex_rise} "
	  s5 = "Increase Agility by #{Upgrade_Points::Agi_rise} "
	  s6 = "Increase Intellegence by #{Upgrade_Points::Int_rise} "
	  # Set Command Window Data
	  @command_window = Window_Command.new(260, [s1, s2, s3, s4, s5, s6])
	  @command_window.x = 46
	  @command_window.y = 112
	  @command_window.z = 9999
	  @command_window.opacity = 200
	  @command_window.active = true
	  # Set Player Data
	  @actor = $game_party.actors[@actor_index]
	  @status_window = Window_Upgrade.new(@actor)
	  @status_window.opacity= 200
	  @status_window.x = 304
	  @status_window.y = 56
	  @status_window.z = 9999
	  # Set Raise Window Data
	  @raise_window = Window_Raise.new
	  @raise_window.x = 46
	  @raise_window.y = 56
	  @raise_window.z = 9999
	  @raise_window.opacity = 200
	  @raise_window.visible = false	
	  # Set Actor Tab Window Data
	  @actor_window = Window_ActorTab.new(@actor)
	  @actor_window.x = 304
	  @actor_window.y = 0
	  @actor_window.z = 9999
	  @actor_window.opacity = 200
	  @actor_window.visible = true 
	  # Set Controls Window
	  @controls_window = Window_Controls.new
	  @controls_window.opacity= 200
	  @controls_window.x = 46
	  @controls_window.y = 333
	  @controls_window.z = 9999
	  @controls_window.visible = true
	  # 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
    @status_window.dispose
    @raise_window.dispose
    @controls_window.dispose
    @spriteset.dispose
    @actor_window.dispose
  end
  #--------------------------------------------------------------------------
  # Update
  #--------------------------------------------------------------------------
  def update
    @command_window.update
    @raise_window.update
    if Input.trigger?(Input::R)
      $game_system.se_play($data_system.cursor_se)
	    @actor_index += 1
	    @actor_index %= $game_party.actors.size
	    $scene = Scene_Upgrade.new(@actor_index)
	    return
	  end
	  if Input.trigger?(Input::L)
	    $game_system.se_play($data_system.cursor_se)
	    @actor_index += $game_party.actors.size - 1
	    @actor_index %= $game_party.actors.size
	    $scene = Scene_Upgrade.new(@actor_index)
	    return
	  end
  	# If command window is active: call update_command
  	if @command_window.active
  	  update_command
      return
      # End IF
    end
	# End Def
  end
#=================================
# *Update Command*
#=================================
  def update_command
		@raise_window.update
		if Input.trigger?(Input::B)
	    # Play Cancel SE
	    $game_system.se_play($data_system.cancel_se)
	    # Load Map
	    $scene = Scene_Map.new
	    return
    end
    if Input.trigger?(Input::C)
	    # Branch by command window cursor position
      case @command_window.index
      when 0
        if @actor.upgrade_points > 0 and @actor.maxhp < 9999
          $game_system.se_play($data_system.decision_se)
          @actor.maxhp += Upgrade_Points::Hp_rise
          @actor.hp += Upgrade_Points::Hp_rise
          @actor.upgrade_points -= 1 
          @status_window.refresh
          @raise_window.visible = true     
        else
          @raise_window.visible = false
          $game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
        end
      when 1
        if @actor.upgrade_points > 0 and @actor.maxsp < 9999
          $game_system.se_play($data_system.decision_se)
          @actor.maxsp += Upgrade_Points::Sp_rise
          @actor.sp += Upgrade_Points::Sp_rise
          @actor.upgrade_points -= 1 
          @status_window.refresh        
          @raise_window.visible = true     
        else
          @raise_window.visible = false
          $game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
        end
	    when 2
        if @actor.upgrade_points > 0 and @actor.str < 9999
          $game_system.se_play($data_system.decision_se)
          @actor.str += Upgrade_Points::Str_rise
          @actor.upgrade_points -= 1 
          @status_window.refresh        
          @raise_window.visible = true
        else
          @raise_window.visible = false
          $game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
        end
      when 3
        if @actor.upgrade_points > 0 and @actor.dex < 9999
          $game_system.se_play($data_system.decision_se)
          @actor.dex += Upgrade_Points::Dex_rise
          @actor.upgrade_points -= 1 
          @status_window.refresh        
          @raise_window.visible = true     
        else
          @raise_window.visible = false
          $game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
        end
      when 4
        if @actor.upgrade_points > 0 and @actor.agi < 9999
          $game_system.se_play($data_system.decision_se)
          @actor.agi += Upgrade_Points::Agi_rise
          @actor.upgrade_points -= 1 
          @status_window.refresh        
          @raise_window.visible = true     
        else
          @raise_window.visible = false
          $game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
        end
	    when 5
        if @actor.upgrade_points > 0 and @actor.int < 9999
          $game_system.se_play($data_system.decision_se)
          @actor.int += Upgrade_Points::Int_rise
          @actor.upgrade_points -= 1 
          @status_window.refresh        
          @raise_window.visible = true     
        else
          @raise_window.visible = false
          $game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
        end
      end
    end
	end
end
#============================================================
# Begin Windows
#============================================================


#=================================
# *Status Window*
#=================================

  class Window_Upgrade < Window_Base
  def initialize(actor)
	super(32, 32, 315, 416)
	self.contents = Bitmap.new(width - 32, height - 32)
  	self.contents.font.name = "Arial" # Font used in Raise Window
	self.contents.font.size = 18 # Font Size in Raise Window
	@actor = actor
	self.opacity = 200
	refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
	self.contents.clear
	draw_actor_graphic(@actor, 122, 60)
	draw_actor_class(@actor, 176, 3)
	draw_actor_level(@actor, 6, 3)
	draw_actor_state(@actor, 95, 48)
  if @actor.upgrade_points >= 1
   self.contents.font.color = system_color
     if @actor.hp < 9999
    self.contents.draw_text(170, 70, 100, 100, "=>") 
  end
    if @actor.sp < 9999  
    self.contents.draw_text(170, 94, 100, 100, "=>")  
  end
    if @actor.str < 999
    self.contents.draw_text(170, 158, 100, 100, "=>")  
  end
    if @actor.dex < 999
    self.contents.draw_text(170, 182, 100, 100, "=>")  
  end  
    if @actor.agi < 999
    self.contents.draw_text(170, 206, 100, 100, "=>")  
  end    
    if @actor.int < 999
    self.contents.draw_text(170, 230, 100, 100, "=>")  
    end      
   self.contents.font.color = normal_color    
  @hp_preview = @actor.hp + Upgrade_Points::Hp_rise
  @mhp_preview = @actor.maxhp +  Upgrade_Points::Hp_rise  
  if @actor.hp < 9999
  self.contents.draw_text(200, 70, 100, 100, "#{@hp_preview}/#{@mhp_preview}")
end
  @sp_preview = @actor.sp + Upgrade_Points::Sp_rise  
  @msp_preview = @actor.maxsp + Upgrade_Points::Sp_rise 
  if @actor.sp < 9999  
    self.contents.draw_text(200, 94, 100, 100, "#{@sp_preview}/#{@msp_preview}")    
  end
  @str_preview = @actor.str + Upgrade_Points::Str_rise  
  if @actor.str < 999  
    self.contents.draw_text(200, 158, 100, 100, "#{@str_preview}")    
  end  
  @dex_preview = @actor.dex + Upgrade_Points::Dex_rise  
  if @actor.dex < 999  
    self.contents.draw_text(200, 182, 100, 100, "#{@dex_preview}")    
  end    
  @agi_preview = @actor.agi + Upgrade_Points::Agi_rise  
  if @actor.agi < 999  
    self.contents.draw_text(200, 206, 100, 100, "#{@agi_preview}")    
  end    
  @int_preview = @actor.int + Upgrade_Points::Int_rise    
  if @actor.int < 999  
    self.contents.draw_text(200, 230, 100, 100, "#{@int_preview}")    
  end      
end
	draw_actor_hp(@actor, 4, 104, 172)
	draw_actor_sp(@actor, 4, 128, 172)
  draw_actor_exp(@actor, 4, 152)    
	draw_actor_parameter(@actor, 4, 192, 3)
	draw_actor_parameter(@actor, 4, 216, 4)
	draw_actor_parameter(@actor, 4, 240, 5)
	draw_actor_parameter(@actor, 4, 264, 6) 
	x = contents.text_size("Points:").width
	text = "Points:"
	text2 = "#{@actor.upgrade_points}"
	self.contents.font.color = system_color
	self.contents.draw_text(190, 360, x, 32, text)
	self.contents.font.color = normal_color
	self.contents.draw_text(200+x, 360, (self.width/2), 32, text2.to_s)
  end
end

#--------------------------------------------------------------------------
# Raise Window
#-------------------------------------------------------------------------- 
class Window_Raise< Window_Base
  def initialize
	super(0, 0, 260, 60)
	self.contents = Bitmap.new(width - 32, height - 32)
	self.contents.font.name = "Arial" # Font used in Raise Window
	self.contents.font.size = 21 # Font Size in Raise Window
	refresh
  end
  def refresh
	self.contents.clear
	self.contents.font.color = system_color
	self.contents.draw_text(4, 0, 180, 30, "Attribute Increased.")
end 
end
#=================================

#--------------------------------------------------------------------------
# ActorTab Window
#-------------------------------------------------------------------------- 
class Window_ActorTab< Window_Base
  def initialize(actor)
	super(0, 0, 120, 60)
  @actor = actor
	self.contents = Bitmap.new(width - 32, height - 32)
	self.contents.font.name = "Arial" # Font used in Raise Window
	self.contents.font.size = 21 # Font Size in Raise Window
	refresh
  end
  def refresh
	self.contents.clear
	draw_actor_name(@actor, 4, 3)
end 
end
#=================================


#--------------------------------------------------------------------------
# Controls Window
#-------------------------------------------------------------------------- 
class Window_Controls < Window_Base
  def initialize
	super(0, 0, 260, 60)
	self.contents = Bitmap.new(width - 32, height - 32)
	self.contents.font.name = "Arial" # Font used in Raise Window
	self.contents.font.size = 20 # Font Size in Raise Window
	refresh
  end
  def refresh
	self.contents.clear
	self.contents.font.color = system_color
	self.contents.draw_text(4, 0, 200, 30, "Q: Shift <-   W: Shift->  ")
  end
end 
#=================================
 

vrdi

Member

Okay, I noticed a problem with it, when you maximize one of the stats, you can still add to it, which...y'know, shouldn't really happen....
 
vrdi said:
Okay, I noticed a problem with it, when you maximize one of the stats, you can still add to it, which...y'know, shouldn't really happen....
I make this version of the script try it and let me know.
Code:
#=================================
# Syn's Upgrade Customization V4.8.61 (3/28/07)
# Created by Synthesize
# Help from Raziel, Trickster, Icedmetal57
# Revised Version by The Sleeping Leonhart (7/9/07)
#=================================

module Upgrade_Points 
  Points_Gained = 3 # Amount of points gained upon leveling.
  Hp_rise = 12 # The amount of HP to raise per point
  Sp_rise = 8 # The amount of SP to raise per point
  Str_rise = 10 # The amount of STR to raise
  Dex_rise = 3 # The amount of DEX to raise
  Agi_rise = 2 # The amount of AGI to raise  
  Int_rise = 4 # The amount of INT to raise 
  Hp_limit = 9999 # The max amount of HP
  Sp_limit = 999 # The max amount of SP
  Str_limit = 999 # The max amount of STR
  Dex_limit = 999 # The max amount of DEX
  Agi_limit = 999 # The max amount of AGI
  Int_limit = 999 # The max amount of INT
  Error_sound = '057-Wrong01' # Change the sound effect when Upgrade Points equals zero.
end

#=================================
# *Begin Script*
#=================================
#=================================
# *Create Points*
#=================================
class Game_Actor < Game_Battler															   
  attr_accessor :upgrade_points 
  alias stat_point_lvlup_game_actor_setup setup
  def setup(actor_id)
	  stat_point_lvlup_game_actor_setup(actor_id)
	  @upgrade_points = 0
  end
  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 += Upgrade_Points::Points_Gained
	    # Learn skill
	    for j in $data_classes[@class_id].learnings
		  if j.level == @level
		    learn_skill(j.skill_id)
      end
	  end
	end
  while @exp < @exp_list[@level]
    @level -= 1
	end
    @hp = [@hp, self.maxhp].min
	  @sp = [@sp, self.maxsp].min
  end
end

#=================================
# Begin Upgrade Code
#=================================

class Scene_Upgrade
  #--------------------------------------------------------------------------
  # Object Initalize
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0)
	  @actor_index = actor_index
  end
  def main
    @spriteset = Spriteset_Map.new
    s1 = "Increase Health by #{Upgrade_Points::Hp_rise} "
	  s2 = "Increase Magic by #{Upgrade_Points::Sp_rise} "
	  s3 = "Increase Strength by #{Upgrade_Points::Str_rise} "
	  s4 = "Increase Dexterity by #{Upgrade_Points::Dex_rise} "
	  s5 = "Increase Agility by #{Upgrade_Points::Agi_rise} "
	  s6 = "Increase Intellegence by #{Upgrade_Points::Int_rise} "
	  # Set Command Window Data
	  @command_window = Window_Command.new(260, [s1, s2, s3, s4, s5, s6])
	  @command_window.x = 46
	  @command_window.y = 112
	  @command_window.z = 9999
	  @command_window.opacity = 200
	  @command_window.active = true
	  # Set Player Data
	  @actor = $game_party.actors[@actor_index]
	  @status_window = Window_Upgrade.new(@actor)
	  @status_window.opacity= 200
	  @status_window.x = 304
	  @status_window.y = 56
	  @status_window.z = 9999
	  # Set Raise Window Data
	  @raise_window = Window_Raise.new
	  @raise_window.x = 46
	  @raise_window.y = 56
	  @raise_window.z = 9999
	  @raise_window.opacity = 200
	  @raise_window.visible = false	
	  # Set Actor Tab Window Data
	  @actor_window = Window_ActorTab.new(@actor)
	  @actor_window.x = 304
	  @actor_window.y = 0
	  @actor_window.z = 9999
	  @actor_window.opacity = 200
	  @actor_window.visible = true 
	  # Set Controls Window
	  @controls_window = Window_Controls.new
	  @controls_window.opacity= 200
	  @controls_window.x = 46
	  @controls_window.y = 333
	  @controls_window.z = 9999
	  @controls_window.visible = true
	  # 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
    @status_window.dispose
    @raise_window.dispose
    @controls_window.dispose
    @spriteset.dispose
    @actor_window.dispose
  end
  #--------------------------------------------------------------------------
  # Update
  #--------------------------------------------------------------------------
  def update
    @command_window.update
    @raise_window.update
    if Input.trigger?(Input::R)
      $game_system.se_play($data_system.cursor_se)
	    @actor_index += 1
	    @actor_index %= $game_party.actors.size
	    $scene = Scene_Upgrade.new(@actor_index)
	    return
	  end
	  if Input.trigger?(Input::L)
	    $game_system.se_play($data_system.cursor_se)
	    @actor_index += $game_party.actors.size - 1
	    @actor_index %= $game_party.actors.size
	    $scene = Scene_Upgrade.new(@actor_index)
	    return
	  end
  	# If command window is active: call update_command
  	if @command_window.active
  	  update_command
      return
      # End IF
    end
	# End Def
  end
#=================================
# *Update Command*
#=================================
  def update_command
		@raise_window.update
		if Input.trigger?(Input::B)
	    # Play Cancel SE
	    $game_system.se_play($data_system.cancel_se)
	    # Load Map
	    $scene = Scene_Map.new
	    return
    end
    if Input.trigger?(Input::C)
	    # Branch by command window cursor position
      case @command_window.index
      when 0
        if @actor.upgrade_points > 0 and @actor.maxhp < Upgrade_Points::Hp_limit
          $game_system.se_play($data_system.decision_se)
          @actor.maxhp += Upgrade_Points::Hp_rise
          @actor.hp += Upgrade_Points::Hp_rise
          if @actor.hp > Upgrade_Points::Hp_limit
            @actor.hp = Upgrade_Points::Hp_limit
          end
          if @actor.maxhp > Upgrade_Points::Hp_limit
            @actor.maxhp = Upgrade_Points::Hp_limit
          end
          @actor.upgrade_points -= 1 
          @status_window.refresh
          @raise_window.visible = true     
        else
          @raise_window.visible = false
          $game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
        end
      when 1
        if @actor.upgrade_points > 0 and @actor.maxsp < Upgrade_Points::Sp_limit
          $game_system.se_play($data_system.decision_se)
          @actor.maxsp += Upgrade_Points::Sp_rise
          @actor.sp += Upgrade_Points::Sp_rise
          if @actor.sp > Upgrade_Points::Sp_limit
            @actor.sp = Upgrade_Points::Sp_limit
          end
          if @actor.maxsp > Upgrade_Points::Sp_limit
            @actor.maxsp = Upgrade_Points::Sp_limit
          end
          @actor.upgrade_points -= 1 
          @status_window.refresh        
          @raise_window.visible = true     
        else
          @raise_window.visible = false
          $game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
        end
	    when 2
        if @actor.upgrade_points > 0 and @actor.str < Upgrade_Points::Str_limit
          $game_system.se_play($data_system.decision_se)
          @actor.str += Upgrade_Points::Str_rise
          if @actor.str > Upgrade_Points::Str_limit
            @actor.str = Upgrade_Points::Str_limit
          end
          @actor.upgrade_points -= 1 
          @status_window.refresh        
          @raise_window.visible = true
        else
          @raise_window.visible = false
          $game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
        end
      when 3
        if @actor.upgrade_points > 0 and @actor.dex < Upgrade_Points::Dex_limit
          $game_system.se_play($data_system.decision_se)
          @actor.dex += Upgrade_Points::Dex_rise
          if @actor.dex > Upgrade_Points::Dex_limit
            @actor.dex = Upgrade_Points::Dex_limit
          end
          @actor.upgrade_points -= 1 
          @status_window.refresh        
          @raise_window.visible = true     
        else
          @raise_window.visible = false
          $game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
        end
      when 4
        if @actor.upgrade_points > 0 and @actor.agi < Upgrade_Points::Agi_limit
          $game_system.se_play($data_system.decision_se)
          @actor.agi += Upgrade_Points::Agi_rise
          if @actor.agi > Upgrade_Points::Agi_limit
            @actor.agi = Upgrade_Points::Agi_limit
          end
          @actor.upgrade_points -= 1 
          @status_window.refresh        
          @raise_window.visible = true     
        else
          @raise_window.visible = false
          $game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
        end
	    when 5
        if @actor.upgrade_points > 0 and @actor.int < Upgrade_Points::Int_limit
          $game_system.se_play($data_system.decision_se)
          @actor.int += Upgrade_Points::Int_rise
          if @actor.int > Upgrade_Points::Int_limit
            @actor.int = Upgrade_Points::Int_limit
          end
          @actor.upgrade_points -= 1 
          @status_window.refresh        
          @raise_window.visible = true     
        else
          @raise_window.visible = false
          $game_system.se_play(RPG::AudioFile.new(Upgrade_Points::Error_sound))
        end
      end
    end
	end
end
#============================================================
# Begin Windows
#============================================================


#=================================
# *Status Window*
#=================================

  class Window_Upgrade < Window_Base
  def initialize(actor)
	super(32, 32, 315, 416)
	self.contents = Bitmap.new(width - 32, height - 32)
  	self.contents.font.name = "Arial" # Font used in Raise Window
	self.contents.font.size = 18 # Font Size in Raise Window
	@actor = actor
	self.opacity = 200
	refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
	self.contents.clear
	draw_actor_graphic(@actor, 122, 60)
	draw_actor_class(@actor, 176, 3)
	draw_actor_level(@actor, 6, 3)
	draw_actor_state(@actor, 95, 48)
  if @actor.upgrade_points >= 1
   self.contents.font.color = system_color
     if @actor.hp < Upgrade_Points::Hp_limit
    self.contents.draw_text(170, 70, 100, 100, "=>") 
  end
    if @actor.sp < Upgrade_Points::Sp_limit 
    self.contents.draw_text(170, 94, 100, 100, "=>")  
  end
    if @actor.str < Upgrade_Points::Str_limit
    self.contents.draw_text(170, 158, 100, 100, "=>")  
  end
    if @actor.dex < Upgrade_Points::Dex_limit
    self.contents.draw_text(170, 182, 100, 100, "=>")  
  end  
    if @actor.agi < Upgrade_Points::Agi_limit
    self.contents.draw_text(170, 206, 100, 100, "=>")  
  end    
    if @actor.int < Upgrade_Points::Int_limit
    self.contents.draw_text(170, 230, 100, 100, "=>")  
    end      
   self.contents.font.color = normal_color    
  @hp_preview = @actor.hp + Upgrade_Points::Hp_rise
  @mhp_preview = @actor.maxhp +  Upgrade_Points::Hp_rise  
  if @actor.maxhp < Upgrade_Points::Hp_limit
    if @hp_preview < Upgrade_Points::Hp_limit
      if @mhp_preview < Upgrade_Points::Hp_limit
        self.contents.draw_text(200, 70, 100, 100, "#{@hp_preview}/#{@mhp_preview}")
      else
        self.contents.draw_text(200, 70, 100, 100, "#{@hp_preview}/#{Upgrade_Points::Hp_limit}")
      end
    else
      self.contents.draw_text(200, 70, 100, 100, "#{Upgrade_Points::Hp_limit}/#{Upgrade_Points::Hp_limit}")
    end
  end
  @sp_preview = @actor.sp + Upgrade_Points::Sp_rise  
  @msp_preview = @actor.maxsp + Upgrade_Points::Sp_rise 
  if @actor.maxsp < Upgrade_Points::Sp_limit
    if @sp_preview < Upgrade_Points::Sp_limit
      if @msp_preview < Upgrade_Points::Sp_limit
        self.contents.draw_text(200, 94, 100, 100, "#{@sp_preview}/#{@msp_preview}")
      else
        self.contents.draw_text(200, 94, 100, 100, "#{@sp_preview}/#{Upgrade_Points::Sp_limit}")
      end
    else
      self.contents.draw_text(200, 94, 100, 100, "#{Upgrade_Points::Sp_limit}/#{Upgrade_Points::Sp_limit}")
    end
  end
  @str_preview = @actor.str + Upgrade_Points::Str_rise  
  if @actor.str < Upgrade_Points::Str_limit  
    if @str_preview < Upgrade_Points::Str_limit 
      self.contents.draw_text(200, 158, 100, 100, "#{@str_preview}")
    else
      self.contents.draw_text(200, 158, 100, 100, "#{Upgrade_Points::Str_limit }")
    end   
  end  
  @dex_preview = @actor.dex + Upgrade_Points::Dex_rise  
  if @actor.dex < Upgrade_Points::Dex_limit
    if @dex_preview < Upgrade_Points::Dex_limit 
      self.contents.draw_text(200, 182, 100, 100, "#{@dex_preview}")
    else
      self.contents.draw_text(200, 182, 100, 100, "#{Upgrade_Points::Dex_limit }")
    end 
  end    
  @agi_preview = @actor.agi + Upgrade_Points::Agi_rise  
  if @actor.agi < Upgrade_Points::Agi_limit 
    if @agi_preview < Upgrade_Points::Agi_limit 
      self.contents.draw_text(200, 206, 100, 100, "#{@agi_preview}")
    else
      self.contents.draw_text(200, 206, 100, 100, "#{Upgrade_Points::Agi_limit }")
    end    
  end    
  @int_preview = @actor.int + Upgrade_Points::Int_rise    
  if @actor.int < Upgrade_Points::Int_limit 
    if @int_preview < Upgrade_Points::Int_limit 
      self.contents.draw_text(200, 230, 100, 100, "#{@int_preview}")
    else
      self.contents.draw_text(200, 230, 100, 100, "#{Upgrade_Points::Int_limit }")
    end
  end      
end
	draw_actor_hp(@actor, 4, 104, 172)
	draw_actor_sp(@actor, 4, 128, 172)
  draw_actor_exp(@actor, 4, 152)    
	draw_actor_parameter(@actor, 4, 192, 3)
	draw_actor_parameter(@actor, 4, 216, 4)
	draw_actor_parameter(@actor, 4, 240, 5)
	draw_actor_parameter(@actor, 4, 264, 6) 
	x = contents.text_size("Points:").width
	text = "Points:"
	text2 = "#{@actor.upgrade_points}"
	self.contents.font.color = system_color
	self.contents.draw_text(190, 360, x, 32, text)
	self.contents.font.color = normal_color
	self.contents.draw_text(200+x, 360, (self.width/2), 32, text2.to_s)
  end
end

#--------------------------------------------------------------------------
# Raise Window
#-------------------------------------------------------------------------- 
class Window_Raise< Window_Base
  def initialize
	super(0, 0, 260, 60)
	self.contents = Bitmap.new(width - 32, height - 32)
	self.contents.font.name = "Arial" # Font used in Raise Window
	self.contents.font.size = 21 # Font Size in Raise Window
	refresh
  end
  def refresh
	self.contents.clear
	self.contents.font.color = system_color
	self.contents.draw_text(4, 0, 180, 30, "Attribute Increased.")
end 
end
#=================================

#--------------------------------------------------------------------------
# ActorTab Window
#-------------------------------------------------------------------------- 
class Window_ActorTab< Window_Base
  def initialize(actor)
	super(0, 0, 120, 60)
  @actor = actor
	self.contents = Bitmap.new(width - 32, height - 32)
	self.contents.font.name = "Arial" # Font used in Raise Window
	self.contents.font.size = 21 # Font Size in Raise Window
	refresh
  end
  def refresh
	self.contents.clear
	draw_actor_name(@actor, 4, 3)
end 
end
#=================================


#--------------------------------------------------------------------------
# Controls Window
#-------------------------------------------------------------------------- 
class Window_Controls < Window_Base
  def initialize
	super(0, 0, 260, 60)
	self.contents = Bitmap.new(width - 32, height - 32)
	self.contents.font.name = "Arial" # Font used in Raise Window
	self.contents.font.size = 20 # Font Size in Raise Window
	refresh
  end
  def refresh
	self.contents.clear
	self.contents.font.color = system_color
	self.contents.draw_text(4, 0, 200, 30, "Q: Shift <-   W: Shift->  ")
  end
end 
#=================================
 
I keep on getting on error message saying : *Script "Custum LVL" line 137 systemstackerror occured stack level too deep* Is it because i'm using trickster's big bag of skill effects?
 

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