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.

on screen stats

pedz

Member

i realy need a script to show health and mp of chars for my custom battle system.

i only want the stats to show up on certain maps (battle maps)

look at the attachment wich exlains more. (it has been cut down to reduce file size).
 

pedz

Member

if it helps i have the script that shows one characters stats. but i just cant figure out how to get the rest of the characters stats on screen...

HUD_SHOW_ID = 5
class Window_ActorHUD < Window_Base
def initialize
super(20, 360, 180, 100)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 100
self.visible = $game_switches[HUD_SHOW_ID]
refresh
end
def refresh

reset_variables
return unless @actor
draw_actor_name(@actor, 4, -8)
draw_actor_hp(@actor, 4, 20)
draw_actor_sp(@actor, 4, 40)
end
def reset_variables
@actor = $game_party.actors[0]
@old_hp = @actor ? @actor.hp : 0
@old_maxhp = @actor ? @actor.maxhp : 1
@old_gold = $game_party.gold
end
def update
super
self.visible = $game_switches[HUD_SHOW_ID]
refresh if @actor != $game_party.actors[0] ||
$game_party.gold != @old_gold ||
@actor && (@actor.hp != @old_hp || @actor.maxhp != @old_maxhp)
end
end
class Scene_Map
alias_method :hud_main, :main
alias_method :hud_update, :update
def main
@hud = Window_ActorHUD.new
hud_main
@hud.dispose
end
def update
hud_update
@hud.update
end
end
 
Code:
@actor = $game_party.actors[0]
You can change that to:
Code:
for i in $game_party.actors
@actor = $game_party.actors[i]
end

so @actor.hp would show every actor's HP instead of just the first. From there on it's just a matter of rearranging the words and stuff.
 

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