MV Can equipment apply stat changes based on a conditional branch? (YEP Equip Core)

As the title says,
I would like to apply a stat change that is based on variable. This is what I wrote just to test if conditional branches would work in the note tag, but after testing I couldn't seem to get it to work (but also no errors were shown, so I think I wrote the code right? :LZSskeptic:)
JavaScript:
<Custom Parameters>
if ($gameVariables.value(6) < 16) {
   atk = atk * 2;
}
</Custom Parameters>

I tried googling to see if it were even possible to use conditional branches in note tags with Equip Core but couldn't find any definite answers.



What this is technically checking is the player's current MP value (not maximum MP to be clear). The goal is to apply a different stat boost depending on the player's current MP. I would prefer to use the variable conditional branch to check the player's MP, but if that isn't possible then if it's just possible to check player's MP without the variable that would be fine too.

Thank you for your help :LZSsmile:
I tried googling to see if it were even possible to use conditional branches in note tags with Equip Core but couldn't find any definite answers.
The documentation says this is "Lunatic Mode" (i.e. JavaScript), so you can use conditionals.

after testing I couldn't seem to get it to work (but also no errors were shown, so I think I wrote the code right?
You did write the code correctly. However, how are you trying to use this? My understanding is that the custom parameters are going to be determined at the moment of equipping the item.

So if that variable changes later, the item isn't going to dynamically update its ATK, it's going to be whatever it was when you put it on.

If that's correctly how you're testing it, then my only other thoughts are:
1 - double check the value of variable 6
2 - make sure the item already has some value for ATK in the database so the multiplication will work

What this is technically checking is the player's current MP value...I would prefer to use the variable conditional branch to check the player's MP
Why? You should be able to make it work either way, but I don't understand a situation where you'd want to reference a variable that could have mistakes in how frequently it updates versus simply looking at the stat.
custom parameters are going to be determined at the moment of equipping the item.
That would make more sense...
For some reason I was hoping it would update dynamically, but I realize that might be a bit ambitious 😅


It's not necessarily about checking the MP through variables. It's more about learning how to utilize the variables correctly (if my notetag was written incorrectly). The script I wrote above was just to test to see if it functioned correctly. There is another variable that needs to be checked that is related to something else in the game that isn't necessarily important for this thread...well, at least not right now.

Would there be a way to dynamically increase stats if a specific piece of equipment is equipped?
Would there be a way to dynamically increase stats if a specific piece of equipment is equipped?
I Googled "RPG Maker dynamic parameters" and found this plugin by Eli 😉

I Googled "RPG Maker dynamic parameters" and found this plugin by Eli 😉

Thanks, I definitely appreciate your help.
Unfortunately, I've had trouble with Eli's plugins in the past. I'm not sure what it is about my set up, but his plugins do nothing - even on brand new projects. It's like RPG Maker doesn't even know they have been installed (and yes, I'm aware he requires his "core" plugin)

Anyways, I managed to make it work without plugins. I would never want to do this if I had a lot of different pieces of equipment and/or multiple party members, but thankfully the small scope of my game saved the day.

Remember I mentioned that other variable I talked about above? (the one I said isn't necessarily important to the thread)
A common event is run which checks the player's current MP and depending on: 1) the setting the player has set in the options menu, and 2) how much MP they have, different states are applied to the player.
The purpose of this equipment was to "boost" the effect of that common event. Since it's only a single piece of equipment, I just penciled in a conditional branch into the common event that checks whether the player has the item equipped or not. If so, as far as the player is concerned, they are getting the same buff state but with it's effects amplified, but technically what is happening is a second more powerful version of the state is being applied. It's a bit clunky, but gets the job done:
Tiara-ConBal.png
An alternative approach is to make a different default attack for that weapon which does the same damage as a normal attack. In the damage formula you can make a condition saying: If MP is below 16, do extra damage.

When I get home I can make an example of how to set it up. You might need 1 more free plugin, found in your DLC folder by default.
Okay... Lets try this:

From your DLC folder, add WeaponSkill.js

I made a weapon, which is the "Low-Mana Power Sword"
As you can see in the screenshot below, it is just a regular sword with +10 ATK.
But in the notes you see the following tag: "<skill_id:7>"
This means that the basic attack for this weapon is not skill with ID 1, but skill with ID 7.
1665686946447.png


Skill ID 7, is just a basic attack. Because I changed the formula, it will now do normal damage when MP is 17 or higher, but the characters ATK will be 1.5 times as powerful if their MP is 16 or below.
1665687074088.png


The formula you need to use is:

Code:
a.mp <= X ? Y : Z

Replace X with the amount of mp your player needs to have (or less) to do extra damage.
Replace Y with the extra strong attack formula
Replace Z with your normal attack formula.

In my example that would look like this:

Code:
a.mp <= 16 ? a.atk * 6 - b.def * 2 : a.atk * 4 - b.def * 2

Edit: Sorry for the double post. I meant to edit.
Hey! Thanks for the tutorial! I actually am already using Weapon Skill, so I appreciate the extra insight on the plugin.
However, this was actually about having a piece of armor dynamically boost stats. It also would need to use variables to detect which mode my player is playing the game in.
Different modes = different buffs
So it's kind of like "if mode 1, if mp is low, buff attack. If mp is high, buff mat." "if mode 2, if mp is low, buff Def. If mp is high, buf mdef." etc (there are 4 different modes)

Anyways, I always appreciate the insight you guys have, thank you. I think I was able to solve it through the common event. I'll mark this as solved.
The damage formula does make ATK stronger, but only for that skill.

I know that is not exactly what you try to do, but it is an alternative if the actual stat boost turns out to be difficult.

It also only works for ATK and MAT. Not for DEF and MDF.

I hope you can make the skill as intended though.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/can-equipment-apply-stat-changes-based-on-a-conditional-branch-yep-equip-core.151944/