Just be careful not to set up a loop, e.g. if DEF depends on ATK, but ATK depends on DEF.
State Formula
RPG Maker MZ SupportIt works!! thank you!
I'm trying <JS CRI Plus: Math.round(this.atk * 0.5)> to set 50% of your attack to add to your critical %, but I get some crazy values.
how crazy? do you have a console log?
No, how do I do it? I show you images of the formula and what I get in play when I put it in. (By default the character has 4% critical chance)
ok so this is the Xparam formula for reference
<JS xparam Rate: code>
- Used for: Actor, Class, Weapon, Armor, Enemy, State Notetags
- Runs 'code' to change the 'xparam' rate value.
- Replace 'xparam' with 'HIT', 'EVA', 'CRI', 'CEV', 'MEV', 'MRF', 'CNT',
'HRG', 'MRG', 'TRG' to determine which X parameter to modify.
- Replace 'code' with JavaScript code to determine how much to change the
param rate amount for the X parameter's total calculation.
- This is used to calculate the 'paramRate' portion in Parameter Settings =>
X Parameter => Formula.
where did you put the formula and why did you use "this"
<JS xparam Rate: code>
- Used for: Actor, Class, Weapon, Armor, Enemy, State Notetags
- Runs 'code' to change the 'xparam' rate value.
- Replace 'xparam' with 'HIT', 'EVA', 'CRI', 'CEV', 'MEV', 'MRF', 'CNT',
'HRG', 'MRG', 'TRG' to determine which X parameter to modify.
- Replace 'code' with JavaScript code to determine how much to change the
param rate amount for the X parameter's total calculation.
- This is used to calculate the 'paramRate' portion in Parameter Settings =>
X Parameter => Formula.
where did you put the formula and why did you use "this"
the crit parameter is a percentage. regular ones are integers. 1 = 100%
you need to divide by 100 because every 1 point of atk will become +50% crit
you need to divide by 100 because every 1 point of atk will become +50% crit
I used it in a state with a visustella plugin, it is a passive ability.
Ok so taking into what account @Robro33 said re percentages, whose stats do you want to use for that?
The stats of the character who learns the passive skill. Right now I'm putting <JS CRI Rate: Math.round(this.atk * 0.15)>. The character has 30 attack, but the formula increases my critical chance by 16%. I'm doing something wrong.
Because that's the reference to the actor, according to the VisuStella Core Engine plugin parameters. (and because I told him to in post #20 😛)
Code:
<JS CRI Plus: this.atk * .005>
You were already told that critical is a decimal rate. If you're changing a rate by a rate, 30 * .15 = multiplying your existing cri by 5 (since you're rounding it).
Ok, I wasn't understanding it, sorry I'm an idiot. Thank you very much for your patience, you've been very nice to me.
No one's asking you to call yourself an idiot, but you want to make sure you take the time to read the explanations and understand/translate the words as necessary (such as understanding what a rate is).
I forgot that "this" is in fact RPG maker default syntax and not a VS exclusive, my bad, got confused by not seeing it in the Js instructions!
@Dark_Ansem Yup - it doesn't even have anything to do with RPG Maker, it's standard JavaScript syntax.
Original thread: https://forums.rpgmakerweb.com/threads/state-formula.172893/