MV Yanfly Attachable Augments Question

Hey, I looked around here and RPG Maker Reddit, couldn't find an answer so I thought I'd ask here.

Does anyone know if YEP Augments can increase variable? I have tried a few ways and couldnt get it working.

I would like, if possible that when an augment is equipped it increase a variable by x amount.

Here is the current code I have attached to the:


<Augment Attach: Pistol Magazine>

$gameVariables.setValue (221, $gameVariables.value (221)+10)

</Augment Attach: Pistol Magazine>

Did I do something wrong here or can this plugin not do what I am looking for?
Did I do something wrong here
Yes, in the notetag you use you can only specify the predefined effects of the plugin. To evaluate javascript like you are trying to do you need to use the following notetag instead:
Code:
<Augment Attach Eval: type>
   //your code here
</Augment Attach Eval: type>
Yes, in the notetag you use you can only specify the predefined effects of the plugin. To evaluate javascript like you are trying to do you need to use the following notetag instead:
Code:
<Augment Attach Eval: type>
   //your code here
</Augment Attach Eval: type>

Thanks for the reply. This did work, However, I did realize that using this method it doesn't allow anything that was changed to change back when the weapon is unequipped. Only by unequipping the augment will it stop the effects added via the attach eval:

However, the effects added by

<Augment Attach: Pistol Magazine>

go away when the weapon is changed.

to be specific, if I add ATK or DEF, it goes away when the weapon is removed, but if I add variables, they do not go away when weapon is unequipped.

Any clue why that is?
That is beacuse the predefined effects like an increase to ATK or DEF are added as traits to the equipment and therefore stop applying when the equipment gets unequipped.
However with the "Augment Attach Eval" you are executing javascript whenever the augment gets attached. In your case the javascript increases a variable. But since you did not specify any javascript that decreases this variable again, this does not happen.

Yanfly's attachable augments only let you specify javascript when an augment gets attached or detached. If you also want to change the variable whenever the equipment is unequipped or equipped, you will need another plugin like WAY_CustomOnEquipEval
That is beacuse the predefined effects like an increase to ATK or DEF are added as traits to the equipment and therefore stop applying when the equipment gets unequipped.
However with the "Augment Attach Eval" you are executing javascript whenever the augment gets attached. In your case the javascript increases a variable. But since you did not specify any javascript that decreases this variable again, this does not happen.

Yanfly's attachable augments only let you specify javascript when an augment gets attached or detached. If you also want to change the variable whenever the equipment is unequipped or equipped, you will need another plugin like WAY_CustomOnEquipEval


This was exactly what I needed. I had been using LB equip variables prior to this. Which only adds to the variables and have no way to remove them. I had been using a complicated string of common events to remove the variable values that werent being used.

Had no clue Wayne wrote a better version.

Thanks for your help and quick replies

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-attachable-augments-question.150824/