How to set enemy HP

I've been wondering how to do a skill that set the enemy HP to an specified value...

Like Maximum Impact Skill = Set the enemy team HP to 100, all the members of your party dies but the user of this skill.

Or something like that.

Any help?
Please note, this is an English language site, all posts should be in English and only in English.
You can set the target's HP to 100 by using b.hp = 100 in the formula box before entering the damage (0), so: "b.hp = 100; 0" and you can do this to all the enemies by changing the Scope of the skill.

KOing all party members but the user is more complicated; you would want to add a state to the user (a.add_state(32)) then have the skill run a Common Event that looks at each party member and if they don't have the state, it KOs them, then at the end it removes the State from the entire party.
Please note, this is an English language site, all posts should be in English and only in English.
Okay, spanish translation deleted.

Oh, understood...let me test it...

Don't know why, but the skill kills the enemy instead of setting de hp to 100 o.o

There are some pics ingame and a pic on the skill config

 

It damages 100 HP and does the death state 😮

iwqAVfk.png


The common event just kills all my party members except one.

BZXK2OC.png




I don't have any damage modifiers scripts btw
You have to enter something for damage, as you are using a damage formula. add ; 0 to the end of your formula and it should work as the last number input will be used as the damage formula by default so it's likely that what is happening is the engine is using the 100 as the damage dealt right after changing the hp since you didn't actually provide a damage formula, which insures the enemy dies regardless of hp.

 "b.hp = 100; 0" 
Don't know why, but the skill kills the enemy instead of setting de hp to 100 o.o
That is because after all commands in the damage formula, the damage applied is always the last number processed.So after setting the HP to 100, the skill damage result will be substracted - which is 100 as that is the last number processed.

Use the following formula instead:

Code:
b.hp = 100 ; 0
In that case the last number processed is zero, resulting in zero additional damage.
You have to enter something for damage, as you are using a damage formula. add ; 0 to the end of your formula and it should work as the last number input will be used as the damage formula by default so it's likely that what is happening is the engine is using the 100 as the damage dealt right after changing the hp since you didn't actually provide a damage formula, which insures the enemy dies regardless of hp.
Which I mentioned twice in the same sentence that you quoted and snipped.  Now I know how a politician feels when their (presumably) intelligent 3-minute answer is cut down to six seconds and taken out of context! 😛

EDIT: Oh, I see, maybe you were helping Killer690 in case he entered it incorrectly?
Okay...Now I have this config on the skill...

Is exactly the same as you have posted...And I tried with 100;0 0;100 100;100 0;0 (among others xd) and it seems that the second number is treated like damage(as Andar said)

The ones that have 0 as second doesn't do anything (do the "null" pop) and the ones that have 100 as second kills the enemy(100 damage and kill)

2FD0Cgk.png


I'm really messed with this xd
The ones that have 0 as second doesn't do anything (do the "null" pop)
I think here you are wrong.
The b.hp=100 is a command that has no display, but it should work unless you have another problem.


The "NULL" message is correct because the damage itself has been set to zero, but that does not mean that the enemy has more than 100 HP after that command - simply test it with a different simple attack next round, and the enemy should be killed by a 100 attack.


If the enemy really has more than 100 HP after the NULL message, then you have a bigger problem because one of your scripts changed the damage processing.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-set-enemy-hp.44546/