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.

[FILLED]HP/MAXHP and SP/MAXSP during Window_BattleStatus

Status
Not open for further replies.

Shiro

Member

Greetings greetings!

I hope this is not a difficult, but it should be something a beginner scripter can do (I'm a bit annoyed I couldn't figure it myself).

But let's get straight to the point. During the battles, the typical HP/SP is set up like this.

Aluxes
HP: 50
SP: 50

BUT... I want it something like this...

Aluxes
HP: 50/50
SP: 50/50

That way during battle, if you have 32 HP left... it'll show up "HP 32/50"

I always figured that this should have been something Enterbrain would have left in, because it's nice to figure out how much percent is left of your life anyway.

If you guys are too busy, then it's fine, don't worry about it. But if you guys can do it, awesome! :)

Thank you!!
 
Here you go:
Code:
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
#  This window displays the status of all party members on the battle screen.
#==============================================================================

class Window_BattleStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4
      draw_actor_name(actor, actor_x, 0)
      self.contents.draw_text(actor_x, 32, 150, 32, "#{$data_system.words.hp} #{actor.hp}/#{actor.maxhp}")
      self.contents.draw_text(actor_x, 64, 150, 32, "#{$data_system.words.sp} #{actor.sp}/#{actor.maxsp}")
      if @level_up_flags[i]
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
      else
        draw_actor_state(actor, actor_x, 96)
      end
    end
  end
end

Just place it in a new script above main.
 
This topic has been resolved. If Shiro or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
Status
Not open for further replies.

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