[RPGMMV]How to replace State via Skill?

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
105
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
1,226
Reaction score
603
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,606
Reaction score
1,512
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
105
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
1,226
Reaction score
603
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,606
Reaction score
1,512
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
1,226
Reaction score
603
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
105
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:

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,226
Reaction score
603
First Language
English
Primarily Uses
RMMV
Glad you got it figured out :LZSgrin:
 

Morizel

Veteran
Veteran
Joined
Sep 28, 2018
Messages
105
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

This profile banner thing is great! Not sure on the size needed, but it's still a nice feature.

Made mine nice and edgy because I'm still 15 at heart.
Anyone ever played Chrono Cross? I have been dying to create another micro-biome tileset that is heavily inspired by the Isle of the Damned in that game. So, a Micro Biome Bones edition. Anyone interested in this?
Wait, we have profile banners now?!
We have profile banners now! :D
D-does anyone know the size for them? 'Cause no matter what size image I upload, it doesn't look good haha; obviously my image sizes are too big.
Currently trying to figure out how to add custom objects to the character generator.

Forum statistics

Threads
107,611
Messages
1,030,903
Members
139,718
Latest member
maxwellbor
Top