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]Hp stays at 1 after battle...

Started by Ghero, September 19, 2008, 12:21:01 AM

0 Members and 1 Guest are viewing this topic.

Ghero

I'm trying to write a script to make any character that falls in battle HP to equal 1 after the battle.. I really don't have a clue what I'm doing and have been trying to research this simple thing xD

class Game_Actor < Game_Battler      <--- I don't know what this does but saw it in other scripts :)
if @hp = 0
  HP_PLUS = true
  end
if HP_PLUS = true
@hp = 1
end
end

that's what I have... Please help!  :mex:

modern algebra

Try this:


class Scene_Battle
  #--------------------------------------------------------------------------
  # * End Battle
  #     result : Results (0: win, 1: escape, 2:lose)
  #--------------------------------------------------------------------------
  alias ghero_hp_recover_to1_on_bttl_end_8fbf battle_end
  def battle_end(result)
    ghero_hp_recover_to1_on_bttl_end_8fbf (result)
    $game_party.members.each { |actor| actor.hp = 1 if actor.dead? }
  end
end


Unless I messed up somewhere or misthought this, that ought to work.

Ghero