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,261
Reaction score
1,029
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,261
Reaction score
1,029
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,261
Reaction score
1,029
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 Posts

Latest Profile Posts

Phew. Finally fixed all of the tileset and event issues in this demo. And now, it's time to release another, finished game. Stay tuned!
you know, since learning C [;)] I've grown to love VC and OpenGL :D
Welp. Just updated the biplane sprite-sheet with the missing "North" and "South" positions. Really digging the old 1920's aircraft designs as of late. Shame they're not in "vogue" anymore. They had style. I wasn't planning on making an Air Mail-centric game but now it is getting awful tempting.
animation-example.gif
ScreenShot_5_15_2022_4_23_30.png

found out the names of all the window's used in Yanfly's Victory Aftermath plugin and came up with some designs for them.
Work on yo games humans! No excuses!

Forum statistics

Threads
121,877
Messages
1,144,851
Members
160,134
Latest member
MikeyMikeF78
Top