Would it be possible to make a state that adds a % of one of the actor's stat to another? For example adding 25% of the magic defense to the defense. Thank you
MV Adding one stat to another
JS Plugin Requestsusing lunatic mode, you should be able to perform a calculation to determine the amount of X actor's Y stat, then give it to your other actor.
Yes, it can be done through the lunatic mode of the YEP Buffs&States core plugin
Code that you need to insert into a state notebox:
<Custom Apply Effect>
$gameActors.actor(1).addParam(3, +$gameActors.actor(1).param[5] /4);
</Custom Apply Effect>
So, actor(1) - your character ID
3 - id of the parameter that you want to buff (in this case it's DEF)
"Params: 0-MaxHP, 1-MaxMP, 2-ATK, 3-DEF, 4-MAT, 5-MDEF, 6-AGI, 7-LUK"
5 - id of MDF parameter that you want to add to your DEF
and then just divide by 4 to have your 25%
And also in most cases you would like to remove the effect when the state is removed from the character. Basically just the same line, but with "-" sign instead of "+".
<Custom Remove Effect>
$gameActors.actor(1).addParam(3, -$gameActors.actor(1).param[5] /4);
</Custom Remove Effect>
Hi there!
Yes you can do it with my plugin Dynamic Parameters
1 - Create a dynamic parameters template on the plugin parameter
2 - In the normal parameters, look for the defense, then add:
"Math.floor( this.paramBase(5) * (25/100) )"
3 - Go to the state you want in the Rpg Maker Database, and attach this dynamic parameter template into the note tag of your desired state.
Note:
this.paramBase(paramId) - Will return only the raw value of the parameter.
this.param(paramId) - Will return the total value of the actor parameter(equips, item growth effect etc...)
Yes you can do it with my plugin Dynamic Parameters
1 - Create a dynamic parameters template on the plugin parameter
2 - In the normal parameters, look for the defense, then add:
"Math.floor( this.paramBase(5) * (25/100) )"
3 - Go to the state you want in the Rpg Maker Database, and attach this dynamic parameter template into the note tag of your desired state.
Note:
this.paramBase(paramId) - Will return only the raw value of the parameter.
this.param(paramId) - Will return the total value of the actor parameter(equips, item growth effect etc...)
@redmedved2 I want to make it a passive, I tried that but it didn't seem to work, or at least it doesn't show the added defense in the menu. Would it need a different code for it to work as a passive? Maybe I could just make the state be applied at turn 0 if you have the passive
@Eliaquim Thanks, I'll try it if I can't make the skill work with the yanfly plugins
@Eliaquim Thanks, I'll try it if I can't make the skill work with the yanfly plugins
Passive states are always on an actor and only get turned on and off - so they don't ever trigger apply or remove effects.
Yes, it's tricky because of how Yanfly plugins work. This code won't work with the passive states because Yanfly passive states are actually not applied or removed from characters for whatever reasons. They appear silently and just as silently disappear.
I've tried different custom effect shown in the description of the plugin, like "turn end", "battle" and else. I've been able to apply the buff with the:
<Custom Battle Effect>
(Applies the effect at the beginning of the battle.)
<Custom Turn Start Effect>
(Applies the effect at the beginning of each turn.)
But unfortunately, I have not found an option to remove the buff when the state falls. So now I'm wondering how to do it myself.
This actually comes up fairly frequently, and seems like a very weird design decision to me...I've considered trying to poke at it and write an extension that would make that work. Maybe if I have enough free time...
Original thread: https://forums.rpgmakerweb.com/threads/adding-one-stat-to-another.141271/