[RPGMMV]How to replace State via Skill?

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
82
Reaction score
6
First Language
Russian
Primarily Uses
RMMV
Okay, i got next problem:
1)I have Yanfly's Buffs & States Core and Battle Core;
2)I have States 14 and 15.

How to make a skill that checks if there is a state 14 on the target? And if the target has this state, add state 15?
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
705
Reaction score
260
First Language
English
Primarily Uses
RMMV
you could do that in the formula box in the skill

you would use an if else statement

if b.isStateAffected(14) ? b.addState(15) : 0

I'm not sure how to do it with yanfly plugin off the top of my head
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,134
Reaction score
1,045
First Language
English
Primarily Uses
RMMV
If your skill also does damage, you don't even need a plugin for that. In the skill note box:

Code:
if (b.isStateAffected(14)) b.addState(15); YOU_DAMAGE_FORMULA_HERE
Edit: Doh, I was a few seconds too slow ;)

Edit2: Not sure if Buffs/States Core can do much for this, but you could use action sequences if you have the action sequence packs to do it more cleanly than the formula box (no "0" damage popup if the skill isn't supposed to deal damage)

<Whole Action>
perform action
action animation: targets
action effect: targets
perform finish
</Whole Action>
<Target Action>
if (target.isStateAffected(14))
add state 15: target
end
</Target Action>
 

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
82
Reaction score
6
First Language
Russian
Primarily Uses
RMMV
When I wrote formulas, then nothing happens. States didn't replace, it shows only "0".
I do not have action sequences pack.
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
705
Reaction score
260
First Language
English
Primarily Uses
RMMV
Well if the formula is entered incorrectly, it will result in 0. The formulae given were basic, you needed to add something else to make it deal damage if that's what you're looking for

if b.isStateAffected(14) ? (b.addState(15) a.atk*2) : a.atk*2;

This one would check if target has state 14, if yes then it adds state 15 and deals dmg = user's atk*2 else it just deals dmg = user's atk*2

Also, capitalization matters
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,134
Reaction score
1,045
First Language
English
Primarily Uses
RMMV
Wait, so you want it to *replace* state 14 with state 15 instead of just adding 15?

Anyway yeah, if using the formula box, it's always going to show 0 which is why I tend to avoid doing it that way unless the skill also is meant to deal damage. To replace 14 with 15:

Code:
if (b.isStateAffected(14)){ b.removeState(14); b.addState(15); } YOUR_DAMAGE_FORMULA_HERE
Unless you decide to go with action sequences, I'd strongly recommend giving the skill some damage, even if small, to avoid the tacky 0 damage popup. You can't get rid of that without plugins.

Edit: Replace YOUR_DAMAGE_FORMULA_HERE with your damage formula. a.atk * 4 - b.def * 2 or something.
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
705
Reaction score
260
First Language
English
Primarily Uses
RMMV
As @Aesica mentioned, if you want it to be a skill that does no dmg, you'll need to go ahead and get those action sequence plugins. They are not too difficult to figure out how to use them. yanfly has excellent tutorial videos on his website, and there's even a thread on this forum devoted to action sequences.
 

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
82
Reaction score
6
First Language
Russian
Primarily Uses
RMMV
It might be weird, but when I just copypasted next formulas:
JavaScript:
if b.isStateAffected(14) ? (b.addState(15));
and
JavaScript:
if (b.isStateAffected(14)) b.addState(15);
Then skill doesn't even worked. But when I use
JavaScript:
if (b.isStateAffected(14)){ b.removeState(14); b.addState(15); }
Or
JavaScript:
if (b.isStateAffected(14)){ b.addState(15); }
then skill works okay.
Also, State 14 will automatically removed if State 15 grants immunity from State 14.
 
Last edited:

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
82
Reaction score
6
First Language
Russian
Primarily Uses
RMMV
Glad you got it figured out :LZSgrin:
Thank you too for advices.
I just didn't wanted to play with HIME's plugins. They're quite different from VX Ace scripts. Thus, Progressive States plugin is not perfect.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Playtesting for Battle Castle is done, demo time for me was roughly 6 hours and 20 minutes. I'm going to pass it on to a few friends first, and after getting some feedback will be posting an official topic.
There's another Humble Bundle available now for RPG developer assets, this time focused somewhat more towards pixel art style games.
Ive got a long lost half uncle. Thats real cool.
I forget what is bumping rule in this forum. Is anyone know? Thank you.
BCj
Ew, why does my blogpost on the rpgmaker.net site look like a garbled mess? Are html codes disabled or something?

Forum statistics

Threads
97,909
Messages
947,782
Members
129,148
Latest member
lemminace
Top