RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RESOLVED]Hp stays at 1 after battle...

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 84
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:
« Last Edit: September 19, 2008, 12:47:44 AM by Ghero »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Try this:

Code: [Select]
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.

**
Rep: +0/-0Level 84
Thank you!