RMMV Passive Base Param Bonus Based Off % of Another Base Param?

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,196
First Language
English
Primarily Uses
RMMV
So I'm trying to create the following passive skill:
Feral Instinct: (Passive) Increases Strength (ATK) & Dexterity (AGI) by 10% of the user's Speed (LUK).

I have all of Yanfly's plugins at my disposal. With that in mind, how would I go about creating such an effect? Most of the notetags provided don't allow for using an eval in place of "x". Remember, the result should be a flat integer which would be calculated by: a.luk * 0.1 or a.luk / 10

One thing I've yet to try, but wanted to get the correct syntax 1st, was the plugin commands (e.g. battler.addAtk(x)). Can I use a formula in place of "x"?

Also, I've never put plugin commands in a state notebox before w/o using a notetag in conjunction. Not really sure the appropriate notetag here though...

Edit: Something like this perhaps?...
user.addAtk(user.luk * 0.1)
user.addAgi(user.luk * 0.1)

Just not sure it'll work just putting that by itself...I doubt it tho. I thought about using <Custom Apply Effect> but then the bonus would only be calculated once and if the player's Speed/LUK stat increased, I'm not sure if the other stats will increase alongside it...

I mean there's <Custom Parameters> but that's for equips...I need something like that but for states.
 
Last edited:

Zerothedarklord

Veteran
Veteran
Joined
Jun 25, 2013
Messages
269
Reaction score
73
First Language
English
Primarily Uses
RMMV
Set the Luk stat's value to a variable. Multiply that variable by 0.1. Increase the other two stats by that amount.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,196
First Language
English
Primarily Uses
RMMV
Set the Luk stat's value to a variable. Multiply that variable by 0.1. Increase the other two stats by that amount.
How would I account for other actors or monsters using this passive though? Still not sure what notetag to use either...or am I allowed to just put in plugin commands in the state notebox w/o a notetag around it?
 

Zerothedarklord

Veteran
Veteran
Joined
Jun 25, 2013
Messages
269
Reaction score
73
First Language
English
Primarily Uses
RMMV
I use a couple variables as stats in my game, and this is how I handle it:
Within the starting event of your game (the one that starts everything, turns on necessary switches, sets initial variables, etc.) you will need to set a variable equal to the character in question's Luk, then have it update via a common event that runs as a parallel process (the common event page should contain a wait for 5-10 frames, and a variable that is set equal to the character in question's Luk stat)
If this ability will be useable by multiple characters, or enemies, well, have fun setting it up for every possible enemy. But for characters, you can do the same thing, except use a unique variable for each character, and have each one's value set to update (this can all still be done within the same common event, they just need to be set as the value for different variable's, that way each character has their own Luk stat to go off of). Then, you can access these variables within the noteboxes of the states.


Here is my code, I will explain each part of it.

<Custom Apply Effect>
if (target._stateTurns[29] >= 24) {
target._stateTurns[29] = 24;
}
this._Bleed2Counter = 0;
crit = origin.luk / 5
</Custom Apply Effect>
<Custom Regenerate Effect>
this._Bleed2Counter += 1;
if (this._Bleed2Counter > 2){
var regen = Math.ceil(origin.atk * 1.75 * target.elementRate(13));
var variableValue = $gameVariables.value(63);
var regen = regen * (($gameVariables.value(63) / 100) + 1.00);
v = Math.floor(Math.random()*100)+1
if (v >= crit)
{
target.gainHp(-regen);
}
else
{
target.gainHp(-regen * 2);
}
this._Bleed2Counter = 0;
}
</Custom Regenerate Effect>

Here is what each part do: the first part, the if statement, determines the maximum possible duration of this effect, making it cap at a maximum of 24 turns. (the 29 refers to the state's ID in my database).
the counter has to do with timing, the crit = part causes the damage dealt by this effect to be capable of dealing critical damage.
The next part increments the Counter, if the counter is not at or above a certain threshold, the effect does nothing. If it reaches that threshold, the rest happens: damage is dealt to the target this effect is on equal to the origin's (the character who applied it) Attack * 1.75. Then it checks against their element rating (This is a Bleed effect, so it uses the Bleeding element, which in my game is element 13).

The next part is the part you need, the variable of my game's unique stat is then obtained. It is called Special, each of the 4 playable character's have their own unique Special stat, which does different things. For this character, his special further increases any bleed damage he deals. So the next part reads his Special stat, which is stored as a variable (variable 63, in this case). Then, it multiplies the previous damage result by 1.00 + the variable / 100 (so if the variable's value is 30, the damage result would be multiplied by 1.30).

Next, a random number is rolled out of 100, this part is what determines if the damage will be critical or not. If it is not, it deals the calculated damage. If it is, it multiplies the final damage dealt by 2.
The final line resets the Counter to 0, causing it to begin counting again until the threshold is met at which damage will occur again.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,118
Reaction score
1,526
First Language
EN
Primarily Uses
RMMZ
I thought about using <Custom Apply Effect> but then the bonus would only be calculated once and if the player's Speed/LUK stat increased, I'm not sure if the other stats will increase alongside it...
Yea, the addAtk stuff evaluates when you invoke the method: it doesn't change the ATK formula or anything, it simply adds a fixed value at that point. Also, the notebox field does not do anything by itself: plugins can check the field for relevant data, and such data is typically formatted using some kind of "notetag" notation.

As far as I know, Yanfly's Base Parameter Control plugin only expects integers in its notetags, but I think you can do this via the plugin's parameters (Plugin Manager) instead. For example, try using something like this for the plugin's ATK Formula:
JavaScript:
(base + plus) * paramRate * buffRate + flat + Math.floor(user.isStateAffected(123) ? user.luk / 10 : 0)
I.e. "default formula + 10% LUK if you have state #123". Replace 123 with the appropriate state ID. If you'd rather check for a specific skill, replace isStateAffected with hasSkill and use a skill ID in place of the state ID. Assuming it works, you can apply something similar to the AGI Formula. :kaophew:

Remember to save your project to apply all Plugin Manager changes before testing~
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,626
Reaction score
1,196
First Language
English
Primarily Uses
RMMV
As far as I know, Yanfly's Base Parameter Control plugin only expects integers in its notetags, but I think you can do this via the plugin's parameters (Plugin Manager) instead. For example, try using something like this for the plugin's ATK Formula:
JavaScript:
(base + plus) * paramRate * buffRate + flat + Math.floor(user.isStateAffected(123) ? user.luk / 10 : 0)
I.e. "default formula + 10% LUK if you have state #123". Replace 123 with the appropriate state ID. If you'd rather check for a specific skill, replace isStateAffected with hasSkill and use a skill ID in place of the state ID. Assuming it works, you can apply something similar to the AGI Formula. :kaophew:

Remember to save your project to apply all Plugin Manager changes before testing~
Ah, that's simply brilliant! Thank you :D
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,048
Messages
1,018,545
Members
137,834
Latest member
EverNoir
Top