How to make player not dead after battle.

Status
Not open for further replies.

TicklishWasabi

Veteran
Veteran
Joined
Nov 7, 2017
Messages
167
Reaction score
18
First Language
English
Primarily Uses
N/A
I was wondering if there was a way to make your player have 1hp after battle if he/she dies. Either something like If hp = 0 then +1. I would even settle for just adding 1 hp point after every battle regardless of their current hp. But I'm not sure how I would do this.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,111
Reaction score
13,715
First Language
English
Primarily Uses
RMMV
Yes, you would need to do it in script.

Add this to a new script slot. I haven't tested it, so if you get an error come back and say what it says.

Code:
Game_Actor < Game_Battler
  def on_battle_end
    self.change_hp(1) if self.hp == 0
    super
  end
end
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,528
Reaction score
14,261
First Language
English
Primarily Uses
RMVXA
If you want it so that all KO'd players are revived, but you can still lose a battle if everyone is KO'd, just go to state 1 and check remove on battle completion. That has worked for me, and now every KO'd party member has 1 HP after the fight is over.
 

TicklishWasabi

Veteran
Veteran
Joined
Nov 7, 2017
Messages
167
Reaction score
18
First Language
English
Primarily Uses
N/A
If you want it so that all KO'd players are revived, but you can still lose a battle if everyone is KO'd, just go to state 1 and check remove on battle completion. That has worked for me, and now every KO'd party member has 1 HP after the fight is over.
It worked! Thanks a ton.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,528
Reaction score
14,261
First Language
English
Primarily Uses
RMVXA
Just note that this solution still makes them gain 0 EXP if they die in battle. If you wish to change that too, remove the feature from state 1 which grants it (EXP * 0% I think?)

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D

Forum statistics

Threads
106,051
Messages
1,018,551
Members
137,837
Latest member
Dabi
Top