Is it possible to make it so that a state, when inflicted, automatically cancels other states?

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,265
Reaction score
1,034
First Language
French
I would like to do it through the State directly, not a skill doing for instance:
Add State X
Remove State Y

More like, when (or if) the State X is inflicted, State Y is automatically cancelled.
I recall it was possible to do this on XP but not sure about MZ.
 

LunarWingCloud

Villager
Member
Joined
Aug 23, 2013
Messages
23
Reaction score
10
First Language
English
Primarily Uses
I might be wrong but I think you can just add a State Resist on that state for the one you want to have be cancelled?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,812
Reaction score
9,117
First Language
Indonesian
Primarily Uses
RMVXA
LunarWingCloud is right, state resistance can actually cancel the resisted states. But the drawback is it is also resisting the state. So you can't have X cancels Y AND Y cancels X OR reapply Y.

I believe VS has a function to execute custom code when a state is applied. You can try to play around with that.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,265
Reaction score
1,034
First Language
French
So you can't have X cancels Y AND Y cancels X OR reapply Y.

Yep, I'd like this exactly.
Eg:
Inflicting Wet cancels Burning.
But inflicting Burning cancels Wet.
And so on.
 

Frostorm

[]D[][]V[][]D
Veteran
Joined
Feb 22, 2016
Messages
2,660
Reaction score
2,252
First Language
English
Primarily Uses
RMMV
Yep, I'd like this exactly.
Eg:
Inflicting Wet cancels Burning.
But inflicting Burning cancels Wet.
And so on.
Sounds pretty doable to me, tbh. Apologies since I don't use MZ, but in MV you can just use a <Custom Apply Effect> note-tag and then add conditionals to check if x state is applied; if so, do x, else do y. Then it's just a matter of using target.addState(n); or w/e you want to happen. At least that's how I imagine it in my head lol. Unfortunately, I'm away from my PC atm so I'm not able to confirm this rn.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,265
Reaction score
1,034
First Language
French
Thanks. I looked into it and this should be this:

<JS On Add State>
code
</JS On Add State>

Which code should I use to remove state X to the target?
 

Frostorm

[]D[][]V[][]D
Veteran
Joined
Feb 22, 2016
Messages
2,660
Reaction score
2,252
First Language
English
Primarily Uses
RMMV
Thanks. I looked into it and this should be this:

<JS On Add State>
code
</JS On Add State>

Which code should I use to remove state X to the target?
target.removeState(n);
edit: Again, apologies if MZ is different.
 

Latest Threads

Latest Profile Posts

Kickstarter successful!! I'm gonna have a Hot GameDev Summer in the trenches!
Me and my friend got into one of our usual discussions after I reccomended him a game, and I remember the last time we had a discussion like that, he disabled his FA account. This time, I found myself constantly checking my friends account hoping it wouldn't happen again. ...But it didn't.

The thing is... I just can't lie about my feelings, sometimes. :(
COMBAT:

Finally showing combat in my game. The lighting system I'm currently using doesn't transfer over into combat, but I am hoping to find a new one soon... or an update for the one I'm using. The plan is to make combat less bright, though. You'll want to click the video link below and visit YT for audio.
Huge thanks to D757 Gaming for his stream, impressions and review of my game, please check him out!
Thank you to everyone who participated in the 3rd quarter annual Drifty jam! I'm always so impressed with the games people make! This time our winner dominated both categories!
jamWinners2.png

Forum statistics

Threads
122,042
Messages
1,146,096
Members
160,310
Latest member
imthemudman
Top