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

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!
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.
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!
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?
@ksjp17 I'm pretty sure it can be.

Original thread: https://forums.rpgmakerweb.com/threads/draw-in-place-of-hp-mp-values.66350/