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.

Skill cost

e

Sponsor

Alright. I'm not going to code it all up for you, but here's how I would go about doing it :

First of all, open up your script editor, and select the following script : Window_Skill
On line 75, you will see the following line of code :

Code:
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)

Simply comment it (add a "#" in front of it), or remove it altogether and it will not write the skill SP cost anymore. That should take care of your first problem.

Moving on to the next one: showing (and updating) the SP cost at the bottom right corner in a window by itself. Note: my goal here is to help you, but also make sure you learn something. This isn't the script requests section.

If you follow these steps, you should be able to create a window that will be displayed at the bottom right corner.

Step 1) Create a new script named "Window_SkillCost". Inside, create a new class named "Window_SkillCost" which extends the class "Window_Help". ( class Window_SkillCost < Window_Help )

Step 2) In your Window_SkillCost class, create a "initialize" method. If you need help, try to look at Window_Help and see how its initialize method is done. Yours should be very similar. You should only have to modify the coordinates (x and y) and the size of the window.

Step 3) In your Window_SkillCost class, create a set_text method as follows :
Code:
def set_text(text, align = 1)
   # Code here
end

This method will hold the code that will be used to draw the SP cost. For example you might call it like this : skill_cost_window.set_text(skill.sp_cost.to_s)

Step 4) Once your set_text method is done, go back into the Window_Skill class. Here, you have to add a new class variable which will hold a reference to a Window_SkillCost object. Then, in the draw_item method, you will call that class variable's set_text method with the current selected skill's sp cost. To obtain the current selected skill from the Window_Skill class, use the following line :

Code:
current_skill = self.skill

-----------------------
So, basically, what'd you have would be :

Code:
class Window_SkillCost < Window_Help
   def initialize
      super
      # Set your coordinates and width/height
      # e.g. : self.x = 32
      #          self.y = 32
      
      # Delete your current contents object and create a new one
      self.contents.dispose
      self.contents = Bitmap.new( self.width - 32, self.height - 32 )
   end

   def set_text(text, align = 1)
      # Code to display text goes here
   end
end

That's the bare bones of your Window_SkillCost class.

In the Window_Skill class, remember, you need to edit the following methods : initialize and refresh.

In initialize, you'd add :

Code:
@window_sc = Window_SkillCost.new

And in the refresh method, before the end, you'd add :

Code:
@window_sc.set_text(self.skill.sp_cost.to_s)

Hopefully you can work the kinks out yourself. If you can't find the solution by yourself, than feel free to ask more questions.
 
It's saying it's an undefined method for 'set_text' when I try to call: @window_sc.set_text(self.skill.sp_cost.to_s). I defined it in the initialize section and a set_text method is in the Window_SkillCost class.
 
Code:
class Window_AbilityCost < Window_Help
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
  def initialize

    super(0, 0, 605, 300)
    self.x = 32
    self.y = 96
    
    self.contents.dispose
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
  
  end
  
  #--------------------------------------------------------------------------
  # * Set Text
  #  text  : text string displayed in window
  #  align : alignment (0..flush left, 1..center, 2..flush right)
  #--------------------------------------------------------------------------
  def set_text(text, align = 1)
    
      AbilityCost_Window.set_text(skill.sp_cost.to_s)

  end
  
end



class Window_Ability < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    actor : actor
  #--------------------------------------------------------------------------
  def initialize(actor)

    # If in battle, move window to center of screen
    # and make it semi-transparent
    if $game_temp.in_battle
       
    super(0, 0, 605, 300)
        @actor = actor
    @column_max = 2
    refresh
    self.index = 0
      self.windowskin = RPG::Cache.windowskin("gold_leaf.png")
      self.x = 0
      self.y = 64
      self.width = 640
  #  self.height = 256
      self.height = 415
      self.back_opacity = 200
      self.z = 1000
    else
   
        super(0, 128, 640, 352)
 
  # super(0, 0, 605, 300)
 
    @actor = actor
    @column_max = 2
    refresh
    self.index = 0

   
  @AbilityCost_Win = Window_AbilityCost.new
    @AbilityCost_Win.visible = true

   
  end

 
  end

#--------------------------------------------------------------------------
  # * Acquiring Skill
  #--------------------------------------------------------------------------
  def skill
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...@actor.skills.size
      skill = $data_skills[@actor.skills]
      if skill != nil
        @data.push(skill)
      end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
   
  @AbilityCost_Win.set_text(self.skill.sp_cost.to_s)
   
  end
 

e

Sponsor

That's your problem right here!

Code:
#--------------------------------------------------------------------------
  # * Set Text
  #  text  : text string displayed in window
  #  align : alignment (0..flush left, 1..center, 2..flush right)
  #--------------------------------------------------------------------------
  def set_text(text, align = 1)
    
      AbilityCost_Window.set_text(skill.sp_cost.to_s)

  end

The method set_text just calls itself!

To write text in a bitmap, you do :

Code:
self.contents.draw_text(x, y, width, height, text)

Or something near enough. Just rewrite your Window_AbilityCost's set_text method to draw into its self.contents Bitmap directly! Good luck!
 
It's still saying the same error about set_text being an undefined method. I commented everything out of the set_text method and just left it as a blank method to see if it would at least recognize it, but it doesn't.
 

e

Sponsor

The Window_Ability's initialize method is calling refresh BEFORE you instantiate your @Ability_CostWin variable. Try to move the instantiation of the variable above, so that'd you get :

Code:
class Window_Ability < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
  def initialize(actor)

    # If in battle, move window to center of screen
    # and make it semi-transparent
    if $game_temp.in_battle
         
    super(0, 0, 605, 300)
        @actor = actor
    @column_max = 2
    refresh
    self.index = 0
      self.windowskin = RPG::Cache.windowskin("gold_leaf.png")
      self.x = 0
      self.y = 64
      self.width = 640
   #   self.height = 256
      self.height = 415
      self.back_opacity = 200
      self.z = 1000
    else
   
        super(0, 128, 640, 352)
 
  # super(0, 0, 605, 300)

    @AbilityCost_Win = Window_AbilityCost.new
    @AbilityCost_Win.visible = true 

    @actor = actor
    @column_max = 2
    refresh
    self.index = 0
   
  end

 
  end

Also, I just noticed you had a fork in your initialize method; you'll have to correct the refresh method accordingly, such as :

Code:
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...@actor.skills.size
      skill = $data_skills[@actor.skills]
      if skill != nil
        @data.push(skill)
      end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
   
    # Update the text ONLY if we aren't in battle and the window is defined
    @AbilityCost_Win.set_text(self.skill.sp_cost.to_s) unless $game_temp.in_battle and defined? @AbilityCost_Win
   
  end
 
Ahh, that was the problem. The position of the instantiation was wrong. As for the fork, I'm cleaning up that code, as I was testing some things out. I actually have a separate Window_Ability class specifically for battles since the layout and things are different.
Thank you for the help!
 
One last thing.. When the cursor hovers over a different skill name, the SP_Cost doesn't change in correspondence. Where would I need to go to place some sort of updater code for the SP cost to change depending on what skill is currently highlighted?
 

e

Sponsor

Ah, it seems the update is handled by your parent class, Window_Selectable.

In order to have it handled by Window_AbilityCost, you'd have to add this method to the Window_AbilityCost class :

Code:
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    old_index = @index
    super
    @AbilityCost_Win.set_text(self.skill.sp_cost.to_s) unless $game_temp.in_battle if defined? @AbilityCost_Win if old_index != @index
  end
 
It still doesn't work. The numbers only change if I switch to the next character via the R and L (Q & A keys) buttons. But even then, the cursor will only hover over the first skill and the numbers will change, but if I move the cursor to another skill on that same character, the skill cost numbers don't change.
I tried creating a AbilityCost window from the Scene_Skill class and see if it would work, but it doesn't.
 

e

Sponsor

What version are you using? RMXP or RMVX? I have no idea if this'd work in RMVX, seeing as I've never used it.

If it's in RMXP, it should work; I tried it myself. If your Window_AbilityCost is a descendant (extends) of the class Window_Selectable, then you shouldn't have any problem. If you overload the update method, call its parent's update and see if the index has changed (which means that we aren't checking the same skill as before), then it should work. Of course, I now realize that there is a fork when in battle, but theoretically it should still work.

Tell you what, post everything you've got. The classes Window_AbilityCost and Window_Ability inside [ code ] brackets.
 
I'm using XP.

Window_AbilityCost
Code:
class Window_AbilityCost < Window_Help
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
  def initialize

    super
    self.x = 40
    self.y = 175
    
    self.contents.dispose
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
  end
  
  #--------------------------------------------------------------------------
  # * Set Text
  #  text  : text string displayed in window
  #  align : alignment (0..flush left, 1..center, 2..flush right)
  #--------------------------------------------------------------------------
  def set_text(text, align = 0)
      
    self.contents.font.size = 30
    self.contents.draw_text(0, 0, 204, 32, text, 0)

 end
 
 
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
   
    old_index = @index
    super
    @AbilityCost_Win.set_text(self.skill.sp_cost.to_s) unless $game_temp.in_battle if defined? @AbilityCost_Win if old_index != @index

  end
  
end


Window_Ability
Code:
class Window_Ability < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
  def initialize(actor)

    # If in battle, move window to center of screen
    # and make it semi-transparent
    if $game_temp.in_battle
         
    super(0, 0, 605, 300)
        @actor = actor
    @column_max = 2
    refresh
    self.index = 0
      self.windowskin = RPG::Cache.windowskin("gold_leaf.png")
      self.x = 0
      self.y = 64
      self.width = 640
   #   self.height = 256
      self.height = 415
      self.back_opacity = 200
      self.z = 1000
    else
    
        super(0, 128, 640, 352)

    @AbilityCost_Win = Window_AbilityCost.new
    @AbilityCost_Win.visible = true
        
  # super(0, 0, 605, 300)
  
    @actor = actor
    @column_max = 2
    refresh
    self.index = 0

  
    
  end

  
  end
  #--------------------------------------------------------------------------
  # * Acquiring Skill
  #--------------------------------------------------------------------------
  def skill
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...@actor.skills.size
      skill = $data_skills[@actor.skills[i]]
      if skill != nil
        @data.push(skill)
      end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end

  #  @AbilityCost_Win.set_text(skill.sp_cost.to_s) 
    
  @AbilityCost_Win.set_text(self.skill.sp_cost.to_s) unless $game_temp.in_battle and defined? @AbilityCost_Win

  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if @actor.skill_can_use?(skill.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    current_skill = self.skill
    
   # self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_help
    
   # @AbilityCost_Win.update
    
  if $game_temp.in_battle == true   
    @help_window.windowskin = RPG::Cache.windowskin("gold_leaf.png")
    @help_window.x = 0
    @help_window.width = 640
    @help_window.back_opacity = 200
    @help_window.set_text(self.skill == nil ? "" : self.skill.description)
        
  else
    @help_window.x = 0
    @help_window.width = 640
    @help_window.back_opacity = 200
    @help_window.set_text(self.skill == nil ? "" : self.skill.description)
    
    end
  end
end


Scene_Skill (I also added this so you can see where I defined the Window_Ability class.

Code:
class Scene_Skill
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor_index : actor index
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0, equip_index = 0)
    @actor_index = actor_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Get actor
    @actor = $game_party.actors[@actor_index]
    # Make help window, status window, and skill window
    @help_window = Window_AbilityHelp.new
    
    @help_window.y = 250
    
    @status_window = Window_SkillStatus.new(@actor)
    @skill_window = Window_Ability.new(@actor)
    # Associate help window
    @skill_window.help_window = @help_window
    
    @skill_window.x = 200
    @skill_window.visible = true
    
    # Make target window (set to invisible / inactive)
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @status_window.dispose
    @skill_window.dispose
    @target_window.dispose
     
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @help_window.update
    @status_window.update
    @skill_window.update
    @target_window.update
        
    # If skill window is active: call update_skill
    if @skill_window.active
      update_skill
      return
    end
    # If skill target is active: call update_target
    if @target_window.active
      update_target
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (if skill window is active)
  #--------------------------------------------------------------------------
  def update_skill
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(1)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get currently selected data on the skill window
      @skill = @skill_window.skill
      # If unable to use
      if @skill == nil or not @actor.skill_can_use?(@skill.id)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # If effect scope is ally
      if @skill.scope >= 3
        # Activate target window
        @skill_window.active = false
        @target_window.x = (@skill_window.index + 1) % 2 * 304
        @target_window.visible = true
        @target_window.active = true
        # Set cursor position to effect scope (single / all)
        if @skill.scope == 4 || @skill.scope == 6
          @target_window.index = -1
        elsif @skill.scope == 7
          @target_window.index = @actor_index - 10
        else
          @target_window.index = 0
        end
      # If effect scope is other than ally
      else
        # If common event ID is valid
        if @skill.common_event_id > 0
          # Common event call reservation
          $game_temp.common_event_id = @skill.common_event_id
          # Play use skill SE
          $game_system.se_play(@skill.menu_se)
          # Use up SP
          @actor.sp -= @skill.sp_cost
          # Remake each window content
          @status_window.refresh
          @skill_window.refresh
          @target_window.refresh
          # Switch to map screen
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
    # If R button was pressed
    if Input.trigger?(Input::R)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To next actor
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      # Switch to different skill screen
      $scene = Scene_Skill.new(@actor_index)
      return
    end
    # If L button was pressed
    if Input.trigger?(Input::L)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To previous actor
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      # Switch to different skill screen
      $scene = Scene_Skill.new(@actor_index)
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when target window is active)
  #--------------------------------------------------------------------------
  def update_target
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Erase target window
      @skill_window.active = true
      @target_window.visible = false
      @target_window.active = false
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If unable to use because SP ran out
      unless @actor.skill_can_use?(@skill.id)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # If target is all
      if @target_window.index == -1
        # Apply skill use effects to entire party
        used = false
        for i in $game_party.actors
          used |= i.skill_effect(@actor, @skill)
        end
      end
      # If target is user
      if @target_window.index <= -2
        # Apply skill use effects to target actor
        target = $game_party.actors[@target_window.index + 10]
        used = target.skill_effect(@actor, @skill)
      end
      # If single target
      if @target_window.index >= 0
        # Apply skill use effects to target actor
        target = $game_party.actors[@target_window.index]
        used = target.skill_effect(@actor, @skill)
      end
      # If skill was used
      if used
        # Play skill use SE
        $game_system.se_play(@skill.menu_se)
        # Use up SP
        @actor.sp -= @skill.sp_cost
        # Remake each window content
        @status_window.refresh
        @skill_window.refresh
        @target_window.refresh
        # If entire party is dead
        if $game_party.all_dead?
          # Switch to game over screen
          $scene = Scene_Gameover.new
          return
        end
        # If command event ID is valid
        if @skill.common_event_id > 0
          # Command event call reservation
          $game_temp.common_event_id = @skill.common_event_id
          # Switch to map screen
          $scene = Scene_Map.new
          return
        end
      end
      # If skill wasn't used
      unless used
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
      end
      return
    end
  end
end
 

e

Sponsor

Oh geez, my bad! The method update doesn't go in the Window_AbilityCost class, but in the Window_Ability class! Once again, I'm sorry about it.

Class : Window_AbilityCost
Code:
class Window_AbilityCost < Window_Help
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
  def initialize

    super
    self.x = 40
    self.y = 175
    
    self.contents.dispose
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
  end
  
  #--------------------------------------------------------------------------
  # * Set Text
  #  text  : text string displayed in window
  #  align : alignment (0..flush left, 1..center, 2..flush right)
  #--------------------------------------------------------------------------
  def set_text(text, align = 0)
      
    self.contents.font.size = 30
    self.contents.draw_text(0, 0, 204, 32, text, 0)

 end
end

Class : Window_Ability :
Code:
class Window_Ability < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
  def initialize(actor)

    # If in battle, move window to center of screen
    # and make it semi-transparent
    if $game_temp.in_battle
         
    super(0, 0, 605, 300)
        @actor = actor
    @column_max = 2
    refresh
    self.index = 0
      self.windowskin = RPG::Cache.windowskin("gold_leaf.png")
      self.x = 0
      self.y = 64
      self.width = 640
   #   self.height = 256
      self.height = 415
      self.back_opacity = 200
      self.z = 1000
    else
    
        super(0, 128, 640, 352)

    @AbilityCost_Win = Window_AbilityCost.new
    @AbilityCost_Win.visible = true
        
  # super(0, 0, 605, 300)
  
    @actor = actor
    @column_max = 2
    refresh
    self.index = 0

  
    
  end

  
  end
  #--------------------------------------------------------------------------
  # * Acquiring Skill
  #--------------------------------------------------------------------------
  def skill
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...@actor.skills.size
      skill = $data_skills[@actor.skills[i]]
      if skill != nil
        @data.push(skill)
      end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end

  #  @AbilityCost_Win.set_text(skill.sp_cost.to_s) 
    
  @AbilityCost_Win.set_text(self.skill.sp_cost.to_s) unless $game_temp.in_battle and defined? @AbilityCost_Win

  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if @actor.skill_can_use?(skill.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    current_skill = self.skill
    
   # self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    old_index = @index
    super
    @AbilityCost_Win.set_text(self.skill.sp_cost.to_s) unless $game_temp.in_battle if defined? @AbilityCost_Win if old_index != @index
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_help
    
   # @AbilityCost_Win.update
    
  if $game_temp.in_battle == true   
    @help_window.windowskin = RPG::Cache.windowskin("gold_leaf.png")
    @help_window.x = 0
    @help_window.width = 640
    @help_window.back_opacity = 200
    @help_window.set_text(self.skill == nil ? "" : self.skill.description)
        
  else
    @help_window.x = 0
    @help_window.width = 640
    @help_window.back_opacity = 200
    @help_window.set_text(self.skill == nil ? "" : self.skill.description)
    
    end
  end
end
 

e

Sponsor

Yes, in the set_text method of your Window_AbilityCost class, insert at the top :

Code:
self.contents.clear

That will clear everything inside your contents Bitmap.
 

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