Eindride

Endless hope and courage to our hearts
Member
Joined
Sep 13, 2020
Messages
16
Reaction score
14
First Language
Portuguese
Primarily Uses
RMMV
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
 

Zerothedarklord

Veteran
Veteran
Joined
Jun 25, 2013
Messages
354
Reaction score
115
First Language
English
Primarily Uses
RMMV
using 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.
 

redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
90
Reaction score
37
First Language
Belarusian
Primarily Uses
RMMV
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
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>
 
Last edited:

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,291
Reaction score
1,789
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi there!
Yes you can do it with my plugin Dynamic Parameters

1 - Create a dynamic parameters template on the plugin parameter
parameter1.PNG


2 - In the normal parameters, look for the defense, then add:
"Math.floor( this.paramBase(5) * (25/100) )"
parameter2.PNG

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.
parameter3.PNG

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...)
 
Last edited:

Eindride

Endless hope and courage to our hearts
Member
Joined
Sep 13, 2020
Messages
16
Reaction score
14
First Language
Portuguese
Primarily Uses
RMMV
@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
 

redmedved2

Veteran
Veteran
Joined
Nov 2, 2020
Messages
90
Reaction score
37
First Language
Belarusian
Primarily Uses
RMMV
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
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.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,790
Reaction score
1,633
First Language
English
Primarily Uses
RMMV
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...
 

Latest Threads

Latest Profile Posts

Reading about metaverses recently. I can totally imagine myself in the future, logging in with VR glasses to a virtual beach villa sitting in a virtual chair, with a virtual laptop facing the sea...coding 16-bit RM.
Mod name: "[Game name] Gameplay Overhaul"
What they actually mean: "Here is a mod that makes the game harder."
I decided to reinstall one of my most favourite game of all times, Gothic 2. Time to get back to Khorinis!
So much game make... I needs to rest. The foods call.
-Casino with bunnysuit green check.png
1638563168795.png

Forum statistics

Threads
117,166
Messages
1,105,098
Members
153,259
Latest member
litespace
Top