Altering Immortal State

Status
Not open for further replies.

robinco1919

Villager
Member
Joined
Jun 25, 2013
Messages
8
Reaction score
1
First Language
English
Primarily Uses
Right. I'm sure this topic is somewhere but I can't seem to find it anywhere. So sorry if this has already been asked somewhere else.

What I'm looking for is to have a state where a target who would have been killed by an attack survives with 1 HP (think Endure, Focus Sash etc. in Pokemon games). Ideally the state would be removed upon this happening, so that a character can only survive a lethal attack once.

The default immortal state in the database will keep HP at 0 if killed, and it seems to prevent skills from being used as well.

I'm not sure whether or how this state could be altered so that it will leave the character alive at 1 HP rather than 0 HP.
 

Imemperor

Animaniac
Member
Joined
Oct 26, 2013
Messages
19
Reaction score
7
First Language
English
Primarily Uses
For focus slash: In the formula section, put 

(b.hp - 1)
 
Last edited by a moderator:

robinco1919

Villager
Member
Joined
Jun 25, 2013
Messages
8
Reaction score
1
First Language
English
Primarily Uses
I don't think you've got quite the right idea. It's not a skill to set a target's HP to 1, it's a state that will prevent ANY skill from killing the user, letting them survive at 1 HP.

Edit: I'm not sure what you're getting at. There's no formula box in the state part of the database...
 
Last edited by a moderator:

robinco1919

Villager
Member
Joined
Jun 25, 2013
Messages
8
Reaction score
1
First Language
English
Primarily Uses
Edit: I still think you've got the wrong idea. It's the state that I want to create, having an effect similar to 'resist state death' in the database. That means, no matter what skill your opponent uses, you will survive a lethal attack with 1 HP left, only if that state is applied.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,462
Reaction score
6,850
First Language
German
Primarily Uses
RMMV
you cannot create such a state (unless you resort to scripting), but you can simulate one such state.

1) copy the resist death state and rename the copy to the state you want.

2) make a common event that checks all actors for HP=0 AND state applied.

3) if the conditions are met, the CE should change HP to 1 and remove the state

Now you only have to determine when to run the common event.

It could be run at the end of each round, in that case the actor will survive all attacks in that round with 1 HP at the end.

If you want it run after each skill use, then you either need a script, or place a call for this event in any skill that should have such a result.
 

robinco1919

Villager
Member
Joined
Jun 25, 2013
Messages
8
Reaction score
1
First Language
English
Primarily Uses
Okay, thanks a lot for the response.

Now, how can I check if an actor's HP is 0? As far as I'm aware, in a conditional branch you can check for the death state but if that is being resisted then it won't work. Am I missing something?
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,728
Reaction score
282
First Language
English
Primarily Uses
RMMV
Here ya go, just whipped up this small snipplet.

class Game_Battler < Game_BattlerBase def die if state?(100) @hp = 1 remove_state(100) else @hp = 0 clear_states clear_buffs end endendJust change the 100 to whatever your state ID is in both parts.

Place it in a new slot below materials and above main. Hopefully none of your custom scripts (if any) overwrite this method. I doubt it though.
 
Last edited by a moderator:

robinco1919

Villager
Member
Joined
Jun 25, 2013
Messages
8
Reaction score
1
First Language
English
Primarily Uses
Works perfectly! Thanks so much everyone, I really appreciate your help.

Problem solved.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,462
Reaction score
6,850
First Language
German
Primarily Uses
RMMV
Now, how can I check if an actor's HP is 0? As far as I'm aware, in a conditional branch you can check for the death state but if that is being resisted then it won't work. Am I missing something?
You can use scripts (like above), script commands or the control variable command.

A lot of game data needs two steps to check because it isn't available in the conditional branches directly.

The first command would be control variable to get the game data into a variable, and then a conditional branch checking the content of the variable.

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

Okay, that's the best I can do. Looks a little strange but..err.. it's my style, yeah, very original style..
being an extreme introvert with massive anxiety... I forget this is really, REALLY frustrating for people who are the exact opposite. still, wait this out and stay home...
I hope you all are keeping safe. <3 If you need a shoulder or an ear, I have two of both and am more than willing to listen & support you! Times are weird.
My dad, super frustrated by seclusion, asking me how I live like this. I shrug. "It helps to not like what is outside."
Apparently it's not just people who are hit by corona virus. My phone has set itself to English language on its own. Not that I'm complaining... :D

Forum statistics

Threads
95,443
Messages
929,187
Members
125,685
Latest member
imnotanepicgamer
Top