NINES'S PROFILE

Search

WIP music...

http://rpgmaker.net/users/Nines/locker/chasing_dawn_WIP.mp3

A song I'm working on for my project. My headphones are crapping out on me so the mastering sucks. That and it is a Work In Progress.

Constructive criticism is welcome.

(RMXP) Display current / max values for HP/SP on the combat screen?

I suck at scripting. I've never really worked with a class-based language before, so I really don't know what I'm doing. There's one tiny little modification I'd like to put into my game though, and it seems like it should be a fairly straight-foreward copy+paste sorta deal. As far as I can tell though, it's probably a little more complicated than it seems (big suprise there!).

So basically, what I want is to display both the current and max values for my actors' HP and SP during battle, rather than just current values. The same way it's displayed in the menu.

What I tried doing first was copying the following lines of code from Window_Base:
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)

..and pasting it into Window_BattleStatus like so:
actor = $game_party.actors
actor_x = i * 160 + 4
draw_actor_name(actor, actor_x, 0)
draw_actor_hp(actor, actor_x, 32, 120)
--> self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
--> self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
draw_actor_sp(actor, actor_x, 64, 120)
--> self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
--> self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)

When I enter a battle, I get an error saying "Undefined local variable: hp_x".
So I need to define hp_x (and sp_x too I'm assuming) as...something? That's where I'm stumped. I dunno, I'm probably going about this entirely the wrong way. Suggestions, anybody?
Pages: 1