Damage %

So I am curious if there is a way to make it so my spike trap does damage by a percentage instead of a constant number.\
1710520688770.png

Is that even possible? If so, how? Thanks for any and all help.
not with a single command

you use control variable to get the HP or MHP of the actor, then multiply it with the percentage you want and then apply the resault as change HP by variable.
repeat for every actor, because the actors have different HP and the percentage calculated will also be different
not with a single command

you use control variable to get the HP or MHP of the actor, then multiply it with the percentage you want and then apply the resault as change HP by variable.
repeat for every actor, because the actors have different HP and the percentage calculated will also be different
So if I wanted a common event to run and read the MHP of the actor, it would look like this, right? Or would the variables all have to be different ones? How would I even multiply it by a percentage?
1710522304076.png
Let's assume you want to deal 10% Max HP as damage to every party member, you would put the following code in a script command:

JavaScript:
$gameParty.members().forEach(member => {
    const value = member.mhp * 0.10; // 0.10 is 10%
    member.gainHp(-value);
});
another way is give each actor a passive state for the traps and different kind.
once it get damaged, it get the amount of dmg.
but if it's different per trap of spikes, (fire, ice, metal etc) I would go with
TobyYasha solution.
How about this?

You talk about a single actor you want to damage, right?

1710523760833.png



Edit: Never mind. I see you try to do the whole party.
, it would look like this, right? Or would the variables all have to be different ones?
yes and no

each sequence of commands need to be completed before you can use the variable for something else, or you need to use different variables.

Code:
control variable: TEMP = MaxHP of actor (get max HP)
control variable: TEMP *= 10 (multiply with the percent you want first half, example 10%)
control variable: TEMP /= 100 (divide by 100 to complete the percent mathematics)
change HP Actor, - TEMP
repeat for next actor

Original thread: https://forums.rpgmakerweb.com/threads/damage.166831/