Variable Add/Subtract with x or y armor / weapon

I want to request for a script that suits my needs. Here is my problem, I tried to do a common event that checks if I have equipped an x armor or y weapon and add or decrease a variable depending if they're equipped or not. Since it is ran by a parallel process, I've noticed that my variable became negative! It is evident on the fact that since I have branches of elses there...it makes the point clear.

My request is this:

Just like a regular armor or weapon, I want a script that:

when x armor is equipped or when y weapon is equipped, it adds a value to a variable. If it is unequipped, the variable should return to its original value. I would want a list of armor and weapon to do it from, since I want to specify which among my weapons and armor carry such functionality.

An example would be:

  • Wooden Armor - adds +2 to the variable
  • Iron Shield - adds +3 to the variable
Note that I use items that adds something to the variable (through a common event) but permanently...I don't know if it has any help about my request but I hope I laid all the request foundations clear.

Thank you so much.
There might be a different solution already available: Tsukihime has a script that calls a common event the moment something is equipped or unequipped.


That way, your common event won't be a complex parallel process but only called when the variables really can be changed.
By the looks of it, this one might be pretty darn close to what you're looking for - while it changes (new) stats instead of regular variables, it shouldn't take much mucking about to make it work.
http://forums.rpgmakerweb.com/index.php?/topic/998-nasty-extra-stats/

No need for a common event to be called, just a direct stat adjustment on equip/unequip.
I will try both solutions, thank you 🙂
Yeah, I suggest Hime's Equip common events or my Equip Extension (in case you want to use full RGSS3 without the need to do common events)

Original thread: https://forums.rpgmakerweb.com/threads/variable-add-subtract-with-x-or-y-armor-weapon.36910/