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 Posts

Latest Profile Posts

On my journey of character rework: I had this character, she was meant to be just a princess that joins your party. And at long term she was just uninteresting... So I tweaked her to be a rebel agaisn't the royalty before meeting up with the party.

Quick tip for any other ametuer pixel artists! When trying to create a colour palette, enabling Antialiasing can speed up the process of creating different shades! Just place your lightest colour and your darkest colour next to each other, select both pixels, and stretch it out!
Revolutionizing the JRPG Industry: Knocking on Doors.

Take that, murderhobos.
Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.

Forum statistics

Threads
106,054
Messages
1,018,580
Members
137,843
Latest member
Betwixt000
Top