Question about hiding MP bar in battle

● ARCHIVED · READ-ONLY
Started by lucofthewind 7 posts View original ↗
  1. So I made a quick snipplet that would hide mp and tp. 

    class Window_Base < Window def draw_actor_mp(actor, x, y, width = 0) end def draw_actor_tp(actor, x, y, width = 0) endendMy only problem is I only want it hidden in battle, not in menus. Anyone got a minute to help?
  2. I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


    There's a $game_party.in_battle? method that tells you whether you're in battle or not, so just add a condition to the beginning of each of those methods with a return if the condition is true (or false).


    Check the Game_Party (or it might be in Game_Unit) script though - I'm not at my own PC and don't have Ace available, so it might not be quite the right name.
  3. if $game_party.in_battleclass Window_Base < Window def draw_actor_mp(actor, x, y, width = 0) end def draw_actor_tp(actor, x, y, width = 0) endendWhen you say condition, do you mean something like this?
  4. No. Put the condition inside the methods.

    class Window_Base < Window def draw_actor_mp(actor, x, y, width = 0) return if $game_party.in_battle (existing content of the method is here) end def draw_actor_tp(actor, x, y, width = 0) return if $game_party.in_battle (existing content of the method is here) endendOr look at some scripts that use aliasing, and write a new script that uses aliasing rather than modifying the original scripts.And if you run that and it gives an error, it's probably because in_battle is not the exact name of the method.
  5. Yea, sadly it didn't work, got a error:
     

    Line 11: Syntax Error occurred.

    unexpected $end, expecting keyword_end

    Going to keep playing with it, see what I can get. Thanks for your help so far!
  6. Window Base is the Superclass for all Windows. And all other windows inherit the methods, that means, that all classes that have Window_Base as a Superclass will also have all Methods from Window_Base.

    Iif you dont want to show the tp and mp bars in battle, just write your code in Window_BattleStatus:

    You could make this:

    class Window_BattleStatus def draw_actor_mp(actor, x, y, width = 0) return end def draw_actor_tp(actor, x, y, width = 0) return endendor you could change this methods in Window_BattleStatus:

    #-------------------------------------------------------------------------- # * Draw Gauge Area (with TP) #-------------------------------------------------------------------------- def draw_gauge_area_with_tp(rect, actor) draw_actor_hp(actor, rect.x + 0, rect.y, 72) draw_actor_mp(actor, rect.x + 82, rect.y, 64) draw_actor_tp(actor, rect.x + 156, rect.y, 64) end #-------------------------------------------------------------------------- # * Draw Gauge Area (without TP) #-------------------------------------------------------------------------- def draw_gauge_area_without_tp(rect, actor) draw_actor_hp(actor, rect.x + 0, rect.y, 134) draw_actor_mp(actor, rect.x + 144, rect.y, 76) endto this:

    Code:
      #--------------------------------------------------------------------------  # * Draw Gauge Area (with TP)  #--------------------------------------------------------------------------  def draw_gauge_area_with_tp(rect, actor)    draw_actor_hp(actor, rect.x + 0, rect.y, 72)    #draw_actor_mp(actor, rect.x + 82, rect.y, 64)    #draw_actor_tp(actor, rect.x + 156, rect.y, 64)  end  #--------------------------------------------------------------------------  # * Draw Gauge Area (without TP)  #--------------------------------------------------------------------------  def draw_gauge_area_without_tp(rect, actor)    draw_actor_hp(actor, rect.x + 0, rect.y, 134)    #draw_actor_mp(actor, rect.x + 144,  rect.y, 76)  end
  7. You didn't paste it EXACTLY that way, did you? Like, where I said (existing content of the method is here) you didn't ACTUALLY put that into the script, did you? You did understand that you're just meant to insert that one line that says "return if ..." into the existing script, but not actually change anything else?