Draw "?" in Place of HP/MP Values?

Badweather4cast

Master Eventer
Veteran
Joined
Jun 27, 2016
Messages
38
Reaction score
37
First Language
English
Primarily Uses
RMVXA
Hello again!


I was wondering if there was some way to have the HP/MP values of the main character appear as question marks in the main menu? In my game, the player wakes up with no memory of who he is or where he came from, so he probably wouldn't know anything about his health values, so they'd appear as unknowns. Eventually, however, he does talk to a character who enlightens him on this, so they'd have to switch back to showing the values at this point. Is there a script or something that makes this possible, or am I missing something basic?


Thank you!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
This should work - in a new script slot below Materials - assuming you only have one character in the party, or that the actual figures are revealed before any additional characters join.  If you will have more than one character and only want to show ??? on one of them, this won't work.


Note - untested ...

Code:
class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw HP
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::hp_a)
    if $game_switches[15]
      draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
        hp_color(actor), normal_color)
    else
      draw_current_and_max_values(x, y, width, '?', '?', 
        hp_color(actor), normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw MP
  #--------------------------------------------------------------------------
  def draw_actor_mp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::mp_a)
    if $game_switches[15]
      draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
        mp_color(actor), normal_color)
    else
      draw_current_and_max_values(x, y, width, '?', '?',
        mp_color(actor), normal_color)
    end
  end
end


There are two lines where I've used $game_switches[15].  Determine what switch you're going to use, name it so you don't accidentally use it for something else, and change the 15 to whatever switch number you've selected (no leading zeros).  When the switch is off, which it will be by default at the start of the game, the ? will show instead of numbers.  At the point you want them to remember, turn the switch on, and the correct figures will show.


And if you want it to show more than one question mark (???? / ???? rather than ? / ? for example), just change the 4 instances above.
 
Last edited by a moderator:

Badweather4cast

Master Eventer
Veteran
Joined
Jun 27, 2016
Messages
38
Reaction score
37
First Language
English
Primarily Uses
RMVXA
It works like a charm!


Also, yep, he remembers this before any other characters join the party, so no problem there. :)


Awesome as always, Shaz, thank you so much for helping me!
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.


Can this be closed now?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
@ksjp17 I'm pretty sure it can be.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,539
Members
137,834
Latest member
EverNoir
Top