Combing two states to make a new state

KazukiT

Veteran
Veteran
Joined
Dec 7, 2014
Messages
229
Reaction score
214
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,190
Reaction score
1,167
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
229
Reaction score
214
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

How do you cure sleep problem? It has been 7 months and it's 3 AM now..
Darn you, Seals! Why do you gotta be so cute when on land?:kaoluv:
So dragonbones getting laggy xD
I even removed the fingers armatures.

Have to remake this guy after crashing ( corrupted file).
:rtear:

Although limited to only this shop for room decorations, I like this aspect for previewing items.
So yesterday I got a follower (follow my NSFW art account) who dmed me and said to me :
if you continue to be friends with [name of the artists] which make me uncomfortable I will have to unfollow and I am like :
... do it?

Forum statistics

Threads
100,837
Messages
980,122
Members
132,487
Latest member
AnthonyDewitt
Top