RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

[Resolved] Window_Help Flaw/Bug!

Started by blazinhandle, March 07, 2007, 12:14:19 AM

0 Members and 1 Guest are viewing this topic.

blazinhandle

I'm modifying Window_Help and realized a problem that the system doesn't refresh the enemy name for the enemy selection. What I mean is that when you select the first enemy in a troop it'll display say "Ghost" but (if you have a troop with more than one type of enemy) when you move the enemy cursor/selection to the second enemy say "Angel", the window will still say "Ghost." Mind you, that this has nothing to do with anything i've modified...it's just a flaw or bug, if you will, in the system.

How this affects me (besides the small fact that I'm a perfectionist and can't stand to have such an error in my game) is that I am modifying the window to display the enemy's HP & SP. So the problem lies in that when a player selects a different enemy, other than the first one, it will display the first enemy's (again the "Ghost's") HP & SP even though the cursor is currently on the second enemy ("Angel").

Any ideas on how to fix this?...b/c it's driving me insane!

here's the script:

#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
#  This window shows skill and item explanations along with actor status.
#==============================================================================

class Window_Help < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # * Set Text
  #  text  : text string displayed in window
  #  align : alignment (0..flush left, 1..center, 2..flush right)
  #--------------------------------------------------------------------------
  def set_text(text, align = 0)
    # If at least one part of text and alignment differ from last time
    if text != @text or align != @align
      # Redraw text
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
      @text = text
      @align = align
      @actor = nil
    end
    self.visible = true
  end
  #--------------------------------------------------------------------------
  # * Set Actor
  #     actor : status displaying actor
  #--------------------------------------------------------------------------
  def set_actor(actor)
    if actor != @actor
      self.contents.clear
      draw_actor_name(actor, 4, 0)
      draw_actor_state(actor, 140, 0)
      draw_actor_hp(actor, 284, 0)
      draw_actor_sp(actor, 460, 0)
      @actor = actor
      @text = nil
      self.visible = true
    end
  end
  #--------------------------------------------------------------------------
  # * Set Enemy
  #     enemy : name and status displaying enemy
  #--------------------------------------------------------------------------
  def set_enemy(enemy)
    text = enemy.name
    state_text = make_battler_state_text(enemy, 112, false)
    if state_text != ""
      text += "  " + state_text
    end
    set_text(text, 1)
  end
end

italianstal1ion

huh, mine refreshes when you have your cursor move from monster to monster..
besides the window doesn't refresh there, somewhere in scene_battle it will say something like Window_help set text = "(monster name)"

Couldnt help you with displaying HP/SP, shouldnt be too hard though...

blazinhandle

yeah sorry lol. i solved it : ) sorry i tend to jump ahead and ask before trying it extensively myself.  ::)