Can a piece of equipment remove a state upon equipping?

empresskiova

Untitled Project1
Veteran
Joined
Sep 3, 2018
Messages
92
Reaction score
67
First Language
English
Primarily Uses
RMVXA
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. :)
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
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.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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?
 

empresskiova

Untitled Project1
Veteran
Joined
Sep 3, 2018
Messages
92
Reaction score
67
First Language
English
Primarily Uses
RMVXA
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. :D
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,470
Members
137,821
Latest member
Capterson
Top