Making an "execute" skill

Hello!

First post, and I couldn't find anything about this anywhere online. Is there a way to make a skill that would "execute" an enemy? (Insta-kill an enemy at or under, say, 10% health, which some downsides for balancing purposes)

Totally alright if not, was just an interesting idea! I've attached the source of inspiration, if that helps at all.
instakill is simply applying the death state.

to make it conditional you'll need either damage formula coding or scripts.
instakill is simply applying the death state.

to make it conditional you'll need either damage formula coding or scripts.
I see. How would I go about this formula/script with the example of 10% or lower?
Do you want the skill to deal damage like a normal attack, and only execute if HP is under 10%, or is it supposed to only execute?
Do you want the skill to deal damage like a normal attack, and only execute if HP is under 10%, or is it supposed to only execute?
Only execute. I have to balance it out somehow, and that's a good start.
I'm not a scripter, only knowing some basic commands, so I can only give you a start. This is what worked for me in the damage formula:

if b.hp_rate<0.1; b.hp=0; end

This will reduce the target's HP to 0, resulting in death (if their HP is 10% or less, or now that I look at it, maybe it's just less than, so you'll need <=0.1 if you want to include 10%). For some reason, when I used b.add_state(1), which would add death, nothing happened (maybe I used wrong vocabulary?).

You have to have some kind of damage selected to be able to use a formula like this, so you have to deal with the battle messages etc. I bypass that by using Hime's formula effects script. But still there is a message that there was no effect, so you'll need to play with that a bit (or someone here will tell you what to do).

I don't know how well you know the maker, so I apologize if I'm talking down to you.
I'm not a scripter, only knowing some basic commands, so I can only give you a start. This is what worked for me in the damage formula:

if b.hp_rate<0.1; b.hp=0; end

This will reduce the target's HP to 0, resulting in death (if their HP is 10% or less, or now that I look at it, maybe it's just less than, so you'll need <=0.1 if you want to include 10%). For some reason, when I used b.add_state(1), which would add death, nothing happened (maybe I used wrong vocabulary?).

You have to have some kind of damage selected to be able to use a formula like this, so you have to deal with the battle messages etc. I bypass that by using Hime's formula effects script. But still there is a message that there was no effect, so you'll need to play with that a bit (or someone here will tell you what to do).

I don't know how well you know the maker, so I apologize if I'm talking down to you.
Not at all! I appreciate the start. I just picked it up this weekend, so I'm feeling my way around it. I can probably just tell the formula to do 1 base damage, I'll have to do some testing.
I'd advise against directly using b.hp=0; in the damage formula box - autobattle AI might evaluate the skill to decide if it should be used, which may result in all potential target's hp being reduced to 0 even if the skill wasn't used.

What I'd suggest instead would be something like
b.hp_rate < 0.1 ? 99999 : 1
In other words, if b's hp rate < 10%, deal 99999 damage; otherwise, deal 1 damage. (You may need to adjust the values to fit your game, but the general idea is there)
Just leaving my two cents here...

Ruby:
b.hp_rate < 0.11 ? b.hp : 1
@kyonides so simple and so elegant :LZSjoy: Do you know why the add state command didn't work? Did I write it wrong?
Extra setup for Kyonides' damage formula.
The skill should have zero variance. Set it to a certain hit. And use no element.
That way, it won't have damage variance and deals exactly at the target's current HP value. Or you can just use AphoticAmaranth 's 999999 damage value and forget about those extra setups.
What I don't like about the 9999999 result for the damage formula is the slight possibility that someone might have made a mod that allows the battle script to always show the maximum damage dealt. That could break the illusion of judging an enemy by finding it "guilty" of anything if its HP is running low. Yeah, I know that card was just an illustration of how the might is supposed to work and not an actual in game judgment or trial of sorts.
And if we want to make the list complete, @TheoAllen forgot the SP-Parameter traits for physical and magical damage.

those can also reduce the b.hp to be non-lethal, although many games don't use them at all.
But like the element rates and the variance they will be used after damage formula calculation
I did mention setting it to a certain hit. PDR and MDR won't affect it.
Alright, so, what my rpg maker newbie brain is getting is...
Just leaving my two cents here...

Ruby:
b.hp_rate < 0.11 ? b.hp : 1
Set the variance to 0, make it a certain hit?
And just... do damage and not worry about PDR/MDR/all that?
Well, if you wanna make it fail for any other reason than having low HP, then go for PDR and MDR. Otherwise, it makes no sense to let those variables influence the outcome at all.
Well, I was hoping to include about 30% base chance to fail, if I can't think of anything else to balance it. I also haven't even started on MP/TP costs yet, which could also help a bit more.
Man, making an insta-kill is hard.
Just like me to start off with something excessively hard. Shrug.
I suggest you familiarize yourself with the damage logic and how the skills work, because everything can be modified to one effect or another.
know what you can't possibly change for being those values hardcoded in the editor, and around that see what you can change.

changing one thing in one skill may lead you to change something else in the program, and break what you've previously changed, and then some.
It has success rate.
1701214010521.png

use this.
It has success rate.
View attachment 285570
use this.
Right. I was wondering if using this would mean I would have to use PDR/MDR like kyonides said. I can't think a reason why, but never hurts to double check when its a program you're not familiar with. Programming spaghetti and all that.

Original thread: https://forums.rpgmakerweb.com/threads/making-an-execute-skill.163342/