MV Help with java script and YEP item upgrade slots!

So I'm currently working on a game called Summer Solstice which firstly I would like to mention I need feedback on the demo which you can find here https://wildgypsy.itch.io/summer-solstice

So I need help making very specific upgrade items! So what I need is for a common event to run (which btw is linked to a base troop that does the very specific boost) but only to run not as soon as the upgrade item is added (like it currently is because I'm using this script $gameTemp.reserveCommonEvent(ID) so the event runs on adding the upgrade) but to only run if the player has the armour or weapon with the upgrade equipped!

In short, what I'm asking is if there is a script or code or any way of telling whether a weapon or armour is equipped or unequipped! Thank you!


I have lots of other questions too but I'll see whether anyone knows the answer to this first!
you can make a conditional choice and put in the scriptcall:

Equips Type:
0 = weapon
1 = arrmor
2 = boots
3 = undefined
4 = undefined


$gameActors.actor(1).equips()[0].id === 42

(change 1 in actor to any actor, 3 with the ID of he database, 42 of the ID of the item.

if: script: $gameActors.actor(1).equips()[0].id === 42
do stuff
else
do nothing
end

this checkes if actor 1 have equipred a weapon ID of 42, if it does, do stuff
otherwise, nothing happend
The other way to go about it is to have the item upgrade add a passive state, which would have a Custom Apply Effect to run your code when an actor puts it on.
Moved to: Plugin Support
Thank you so much, everyone! I never used passive states before in this way but you're totally right it will be really useful Also the script is perfect!
But I need another script or something I think because when the upgrade is applied I need to know what item it is being applied to so that I know which armour/weapon ID to use in the script checking if the armour/weapon is applied
Also in this script
$gameActors.actor(1).equips()[0].id === <--here can I do a script like whatever variable 4 is equal to or something?
it should be able, but didn't test it on variable before:

$gameActors.actor(1).equips()[0].id === $gameVariable.value(x, y)

I cannot garanteed this will work, or a scriptcall above it:
x being the variable ID and y the value, you need to test it.

you can leave out "y" first and see what happends, else you need a scriptcall above
the conditional brance to assign it first, than use it.

a better and easier to control this probably is the use of conditionalbrance+
but see if it works first, but if you need multiple checks, you can use || to check
either A or B.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-java-script-and-yep-item-upgrade-slots.135943/