Can a piece of equipment remove a state upon equipping?

Hey hey!

A little note:
My laptop is currently not working right, so while I save up money for a new one and/or try to get this one working, I have no way of testing things out right now. But this is for VX Ace, so anything you guys got can help me out. 🙂

The question I have is if there’s a simple way to have a piece of equipment remove states when your character equips it? Preferably without scripting or common eventing, because of the sheer number of possible weapons in this game.

The idea I want to pull off:
Firearms can be given things like Bigger magazines (additional uses before a “Reload” action must be taken), or Scopes (to boost accuracy). These “Weapon Mods” are consumable items (but not depleted unless they break) that give the player a state to indicate it being active. For example, a 9mm SMG might be given a larger magazine. So you pull the 9mm SMG Large Mag from your Inventory and use it. Assuming it didn’t break, you receive the state “9mm SMG +Mag”. You go through a few fights, and after you are out of bullets, you need to pull out a different firearm. So you pull out a trusty Double Barreled Shotgun. Because a 9mm SMG Large Mag has no place on a Double Barreled Shotgun, the weapon mod is unattached and the state goes away.

So, how can I get rid of the 9mm SMG +Mag state by equipping the Double Barrelled Shotgun? Can I give the Shotgun a trait that grants immunity to the 9mm SMG +Mag state, and once the shotgun is equipped the state will go away? Or do I have to go another route altogether.

And if this can’t work for some reason, could I instead make the Weapon Mod into a piece of equipment that unequips from the player when the appropriate weapon is unequipped? Something like not being able to use a Longbow with a Shield, so the Shield automatically unequips after the Longbow is equipped.

My preference is do the former version, since it’d make sense if you could kit your gun out with several mods at once. The latter can work since I have an equipment slot that’s going unused, but I’d rather it be for something cooler.

Thanks again! Sorry for the long winded text. 🙂
I am not sure about invulnerability to that state. I mean, it works to prevent a state from being applied, but I am not sure it works once the state has already been applied. However, if we assume that you cannot change weapons in battle, you should be able to do it using a parallel process. have a parallel process check if the weapon changed (let's say every 30 frames) and if it did, remove any state that is unrelated to the new one. It is done in a different way, but the result is the same.
Afaik if you have something with the Trait "State Resist", it not only prevents the addition of that state to the user but also clears the state if the user already has it.

Seeing you actually already seemed to think about the idea before posting, did you manage to try it out by now?
Sadly not yet, haven’t been able to tinker with my laptop to try it out. Been busy with RL to even get things started up.

Fortunately, I’ve already got solid ideas on how to implement the systems I’m wanting to use. Just a matter of having a bunch if time to do it all. And right now I’m mostly trying to research whatever I’m not positive on. 😀

Original thread: https://forums.rpgmakerweb.com/threads/can-a-piece-of-equipment-remove-a-state-upon-equipping.109956/