Combing two states to make a new state

KazukiT

Veteran
Veteran
Joined
Dec 7, 2014
Messages
225
Reaction score
213
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,187
Reaction score
1,164
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
213
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 Profile Posts

grief... if MV didn't have certain plugins already, I think I'd upgrade to MZ. seeing like 10 MV plugins in 1 MZ one is hilariously convenient lol.
Have you already checkes out my mapping tutorial on the blog? I would love to hear your feedback and things you'd like to see in the future!

one of character for my upcoming game idk how to design o_O

Designing patches that can 'augmented' to clothing based armor. Such good fun. A bit time consuming due to the need to create image displays, but the patches are limited so it's not too tiring.
Note: lol, posting this made me find a couple mistakes.
Why VX/VX Ace is a little Neglected?

Forum statistics

Threads
100,736
Messages
978,929
Members
132,357
Latest member
Versitax
Top