Issues revolving on Insta Death

Read on the forums a few times about how to make insta death and it seems as though the only way to make it effective is to put under enemy trait state rate 0% on knockout. That said, I noticed it did not work, for the skill I used on the enemy with 100% knockout automatically kills them. I have yanfly plugins that revolve around stats and buff, along with state categories.

Are those the reason why this happens?
I'm a little confused because you start saying you're TRYING to make insta-death and then make it sound like you want the enemy to be RESISTANT to insta-death. I've responded as if you're trying to make the enemy RESIST insta-death.

If that's the case, you're using the wrong trait; you should be giving the trait "State Resist: Knockout", or you can give them the Immortal State in a battle event at the beginning of the battle (it does the same thing; the benefit of the Immortal approach being that it's easier to remove the Immortal State if you need to).

Theoretically, what you're using SHOULD work, because all the State Rate traits get multiplied together, and multiplied by some other numbers, to determine the chance of the state being applied, and a random number is compared against that. I'm guessing there's a weird rounding error at play here where Javascript isn't returning 0 when it multiplies all the numbers together. (I couldn't find anything in Buffs & States Core or State Categories that would affect this calculation.)
If I give them state resist knockout though they become immortal. State rate for knockout * 0 is not registered or recognized, and nothing shows about an error via console. Hence why I thought to bring concern on the boards and figure out why it isn't working for me, but is able to work for others. Spent half my day figuring out the issue and came across a code, but the problem with the code is that it either kills or does nothing. Damage output isn't an option. This makes the insta kill skill I made broken.
@Aurawhisperer
As @Llareian said to get an insta-death restiant enemy you need an enemy that has state resist insta-death.

However, make an insta-death state, DO NOT make an enemy resitant to knockout, or you won't be able to kill them.

Since you have Yanfly Buff States Core do this:

Make a state called Insta-death and insert this notetag:

<Custom Apply Effect>
b.addState(1);
</Custom Apply Effect>

Then make your enemies resisant to the insta-death state.

And make your skills apply the insta-death state not knockout.
upload_2017-12-21_20-4-59.png


I get this error with the custom effect you recommend me putting in
It should be "target.addState(1)", not "b". "a" and "b" should be "user" or "origin" and "target" instead. But i prefer this:
Code:
<Custom Apply Effect>
target.setHp(0);
</Custom Apply Effect>
It will set your target HP to 0, so it is dead obviously (Unless you have a way to make it live even with 0 HP).
But remember this will only happen when you apply a specific state to your target. If you want to make your skill to be an instant-kill one, just put "b.setHp(0)" into damage formula box.
Well the catch is to check whether they are resistant to the attacks additional state or not, hence insta kill. If they are, they take regular damage. If not, it's like you said, insta death.

Earlier today I went lunatic and came up with this formula.

<Damage Formula>
if(!target.isStateAffected(1)){
target.setHp(0);
} else {
value = 8 * a.atk - 1.5 * b.def;
}
//event ends. Create action sequence.

That didn't work though :/

Edit: And my goodness, your idea worked. Wow... to think so technical and not realizing just changing the HP to 0 would work...

Heh heh... 4 hours of my life wasted. Good grief xD thank you though. I'm documenting this formula, and keeping it on the tabs in case I forget. This is a dire important formula!
I do see why it did not work. You checked if your target was affected by state 1 (death). But it is obvious that your target only takes damage if it is dead (affected by state 1). This is not how you should check your target's resistance.
I think i can handle this so just tell me more detail about your idea of this skill. Generally, I can get that it deals normal damage if target's specific state rate (Death - State ID 1 for example) is less than 100%, or kills the target instantly if Death state rate is 100% or higher, right?
If it is the idea, then put this into your skill note box:
Code:
<damage formula>
var deathState = 1;
if (user.stateRate(deathState) >= 1 && !user.isStateResist(deathState)){
value = 8 * user.atk - 1.5 * target.def; //user and target, not "a" and "b"
}
else{
target.setHp(0);}
</damage formula>
I'm not sure if it works, but give it a try.
I do see why it did not work. You checked if your target was affected by state 1 (death). But it is obvious that your target only takes damage if it is dead (affected by state 1). This is not how you should check your target's resistance.
I think i can handle this so just tell me more detail about your idea of this skill. Generally, I can get that it deals normal damage if target's specific state rate (Death - State ID 1 for example) is less than 100%, or kills the target instantly if Death state rate is 100% or higher, right?
If it is the idea, then put this into your skill note box:
Code:
<damage formula>
var deathState = 1;
if (user.stateRate(deathState) >= 1 && !user.isStateResist(deathState)){
value = 8 * user.atk - 1.5 * target.def; //user and target, not "a" and "b"
}
else{
target.setHp(0);}
</damage formula>
I'm not sure if it works, but give it a try.

Logically that seems to work, though I got it working just fine. The code you put up is very identical to mine, except I didn't do the checking between the two. Instead, I made a state to where the user is immune to 0 hp automatically and if having that state, they take regular damage. If not resist, regular damage is ignored and forces hp to 0, automatically killing them which did work.

Original thread: https://forums.rpgmakerweb.com/threads/issues-revolving-on-insta-death.88759/