Request: an Endure State

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
624
Reaction score
159
First Language
English
Primarily Uses
RMMZ
I am looking for a way to do an Endure State (I dont want the actor to just gain 1 HP right after dying).

Ex:

Actor has "Endure" state. Actor gets hit by 120 damage while he has 110 HP left. The "Endure" State prevents his death, and puts him at 1 HP left. However, the next attack brings him to 0.

I ultimately want the Actor with the state to Endure an attack with 1 HP left, but if they have only 1 HP left, they die after damage.
 

DreamX

Veteran
Veteran
Joined
May 30, 2015
Messages
816
Reaction score
826
First Language
English
Primarily Uses
Does the built-in immortal state not work for that?
 

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
624
Reaction score
159
First Language
English
Primarily Uses
RMMZ
Well, Immortal just makes them never die, I just want this to prevent reducing HP to 0, unless they only have 1 HP.
 

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
624
Reaction score
159
First Language
English
Primarily Uses
RMMZ

SirCumferance

Veteran
Veteran
Joined
Jul 17, 2012
Messages
51
Reaction score
11
First Language
English
Primarily Uses
RMMV
You already tried tinkering with the Autolife plugin? Just have the note tag be <autolife: 1> and BOOM!, Bobs your uncle.
 

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
624
Reaction score
159
First Language
English
Primarily Uses
RMMZ
It's not how I want it to work.. I want the character NOT to die, but just be left with 1 HP.
 

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
624
Reaction score
159
First Language
English
Primarily Uses
RMMZ

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
624
Reaction score
159
First Language
English
Primarily Uses
RMMZ
Looks like it will be perfect! (It would be even better if there was some type of popup or something that mentioned that the hit was endured, but that would be only a luxury.)
 

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
624
Reaction score
159
First Language
English
Primarily Uses
RMMZ
Dont worry about it then. The endure looks good!
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
http://forums.rpgmakerweb.com/index.php?/topic/51758-state-damage-modifiers/

Using this plugin, you can note-tag a state with

<state damage modifier> return b.hp - 1</state damage modifier>Which will change the damage to your current HP minus 1, which will effectively leave just 1 HP.Note the explicit "return", because now you are actually writing javascript yourself.

So let's say you wanted the state to be removed if the damage is actually greater than your HP.

You can write some code to check this, and also remove the state if necessary.

<state damage modifier>if (d > b.hp) { b.removeState(23)}return b.hp - 1</state damage modifier>Assuming 23 was the ID of your endure state.Depending on your scripting proficiency, you could do literally anything with that formula.
 

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
624
Reaction score
159
First Language
English
Primarily Uses
RMMZ
Well, it seems as if it conflicts with my own personal plugin that takes a function placed in the damage formula box and spits out the damage value, among doing other things. However, I believe I can take the formulas used in the notetags that you have provided can actually be placed in my personal function and make it work.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
That's strange? Because this formula is evaluated separately from the skill's damage formula.
 

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
624
Reaction score
159
First Language
English
Primarily Uses
RMMZ
Under further investigation, I cannot actually do what my plan was, so I had to figure out what exactly was conflicting.

The troublemaker seems to be QuasiParamPlus, which I am using for a hcr (hp cost rate) for yanfly hp costs until an official hcr is released through her plugins.

When your plugin is above QuasiParamPlus, the endure stuff/formulas in notetags does not get applied.

When your plugin is under QuasiParamPlus, the endure works perfect, but when I attack a normal monster, the monster disappears and damage pops up as 0...

I also cannot turn the QuasiParamPlus plugin off, because then I cannot use skills in battle....
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Sorry, the formula I provided was wrong.


It doesn't take into account who is the attacker and who is the defender.


This happens because both the attacker AND defender's states are all factored into the damage modifier.


Let me find a better formula.
 
Last edited by a moderator:

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
624
Reaction score
159
First Language
English
Primarily Uses
RMMZ
Oh thank goodness. I was getting frustrated looking through all my plugins seeing what was causing issues.. xD
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Ok so the plugin was doing the right thing: it checked the attacker's states to see if there were any damage modifiers. Then it checked the defender's states to see if there were any modifiers.

My formula was based on an older version of the plugin which assumes only the defender's states were checked.

The final version would require you to actually *check* whether state is affected on the target, since the same damage modifier is used for when you're attacking and when you're defending.

Code:
if (b.isStateAffected(23)) {  b.removeState(23)  return b.hp - 1}else {  return d;}
Which actually might be a problem.
 
Last edited by a moderator:

wrigty12

Just a QAer playing with Javascript
Veteran
Joined
Jan 11, 2014
Messages
624
Reaction score
159
First Language
English
Primarily Uses
RMMZ
Yay! Works like a dream now. I also had to place it under most of my plugins, probably due to the aliasing of the makeDamageValue function.

Thanks a bunch!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,847
Messages
1,016,968
Members
137,561
Latest member
JaCrispy85
Top