Combing two states to make a new state

KazukiT

Veteran
Veteran
Joined
Dec 7, 2014
Messages
225
Reaction score
210
First Language
English
Primarily Uses
RMMV
There was a post here before that asked the same question, (https://forums.rpgmakerweb.com/index.php?threads/how-to-combine-states-or-ailments.100640/) however, it was unresolved.

Anyway, I was wondering how wondering how take two states and combine them. For example, your character has "Poison"(lose HP over time) and when they are inflicted with "Paralyzed"(can't act on your turn) they get the "Living in Pain" state(lose HP and can't move).

How would I achieve this?
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,186
Reaction score
1,162
First Language
Spanish
Primarily Uses
RMVXA
add a common event to the skill inflicting the paralyze to check for poison, and add living pain.
and then, *in* living pain, negate poison and paralyze.

whenever paralyze is added, paralyze will add *paralyze*.
when adding *paralyze* without adding *living pain*, which is conditioned to the state of *poison*, then *paralyze* will take effect on it's own.
 

KazukiT

Veteran
Veteran
Joined
Dec 7, 2014
Messages
225
Reaction score
210
First Language
English
Primarily Uses
RMMV
add a common event to the skill inflicting the paralyze to check for poison, and add living pain.
and then, *in* living pain, negate poison and paralyze.

whenever paralyze is added, paralyze will add *paralyze*.
when adding *paralyze* without adding *living pain*, which is conditioned to the state of *poison*, then *paralyze* will take effect on it's own.

It worked, I just have to make it each skill or item that inflicts this calls the common event.
 

Alistair

Treasure Hunter
Veteran
Joined
Jun 15, 2014
Messages
273
Reaction score
177
First Language
English
Primarily Uses
RMMV
Alternatively, if you have Yanfly's YEP_BuffsStatesCore plugin, you can paste this into your state's notebox:

JavaScript:
<Custom Apply Effect>
// Check if the target is already affected with State 5
if (user.isStateAffected(5)) {
// If so, remove state 4 and state 5 and add the new state 7
user.removeState(4);
user.removeState(5);
user.addState(7);
};
</Custom Apply Effect>
You'd copy this notetag into state 4, since in the if statement we are checking if state 5 is already applied and then remove both of the states. If you wanted to paste this into state 5's notebox instead, you'd just swap out the user.isStateAffected(5) with user.isStateAffected(4) - Effectively just changing the number.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

ESAMarathon on Twitch, now streaming "Eat Girl". Yep, that's the title of a game... Apparently it's a Pacman knockoff.... Which is of course the only logical conclusion one would get from a name like "Eat Girl". :kaopride: I can't believe anybody would think anything else! :kaoback:
Super stoked i just finished my first town in my project, by finished i mean i can always add more decorative aesthetics and the NPCs don't talk yet but the mapping is complete and all the important chess pieces are present!
My brain: Hey, I have an idea how to make the transition to the main story quest in The Wastes more natural!
Me: Good!
My brain: You need to remake the hotel you start out in, it's not realistic enough.
Me: Ok... This was unexpected, but I can do it.
My brain: Now make each hotel floor 5 times as large to match the main part. Oh, you also need to make a bunch of new npcs to fill in the space on these maps.
Me: Crap.
Should be able to release Haxe MV/MZ next weekend.
It look that somehow MZ tracks are messed up (for example battle4 is obviously a theme, castle2 is a ship, ship1 is a scene and so on..). Maybe they just named them after with some ambiguity.

Forum statistics

Threads
100,618
Messages
977,838
Members
132,228
Latest member
zhengdddddd
Top