MV Can stack the state and turn on the switch?

Hi !
First of all, the title I wrote may be a little confusing, so please read the explanation.
I'm making a special boss monster.
This boss monster is generally not very strong, but it uses one skill.

With this skill, a special buff state is added, and the moment the four states overlap, the player loses.
There's a problem here.
In my game, I use Yanfly's state category plugin.
Therefore, the player's actors have many skills to remove the opponent's buff.
That's why when Boss Monster receives this buff, the player has to fight by removing the special buff state from the enemy with the skill of removing the buff.
Can make this?

Since I am writing using a translator, if there is a sentence or explanation that I don't understand, I will try to explain it again as much as possible.
I think I understand you well enough, so...what exactly is the question? Can you make it? Of course.

Which part of making it do you need help with? What do you have so far?
I think I understand you well enough, so...what exactly is the question? Can you make it? Of course.

Which part of making it do you need help with? What do you have so far?

First of all, I don't know how to stack the buff state.

And when the buff is exactly four stacks, the event should be triggered, but I don't know what to do with this either.
You'll need Yanfly's Buffs & States Core. Make sure the plugin parameter "Reapply Rules" is not 0 (ignore).

In the state's notes, put:
Code:
<Custom Apply Effect>
// Add a counter
target.addStateCounter(X, 1);

if (target.getStateCounter(X)==4)
// Do your thing
    SceneManager.goto(Scene_Gameover);
</Custom Apply Effect>

Each place it says X, you type the ID of your state.

I wasn't sure what you want to happen at the end...one place you say it's game over, another place you mention an event. I have this going to game over, but if you want to do something different, you can explain it.
Moved to: Plugin Requests
You'll need Yanfly's Buffs & States Core. Make sure the plugin parameter "Reapply Rules" is not 0 (ignore).

In the state's notes, put:
Code:
<Custom Apply Effect>
// Add a counter
target.addStateCounter(X, 1);

if (target.getStateCounter(X)==4)
// Do your thing
    SceneManager.goto(Scene_Gameover);
</Custom Apply Effect>

Each place it says X, you type the ID of your state.

I wasn't sure what you want to happen at the end...one place you say it's game over, another place you mention an event. I have this going to game over, but if you want to do something different, you can explain it.


ah sorry my bad

I'll explain it in more detail.

What I want is to launch an event when the boss's state reaches 4 stacks as an event during battle.
After that, I want to make him play the game over.

The reason I'm thinking about it is because...

1. The boss used the skill to get the state.
2. The next turn boss once again used the skill to make the state two stacks.
3. The player removed the state using the buff removal skill. (In this case, all buffs must be removed at once.)
4. The boss has to stack from zero again.

Is it possible to calculate this?
ah sorry my bad

I'll explain it in more detail.

What I want is to launch an event when the boss's state reaches 4 stacks as an event during battle.
After that, I want to make him play the game over.

The reason I'm thinking about it is because...

1. The boss used the skill to get the state.
2. The next turn boss once again used the skill to make the state two stacks.
3. The player removed the state using the buff removal skill. (In this case, all buffs must be removed at once.)
4. The boss has to stack from zero again.

Is it possible to calculate this?
Use the same code ATT_Turan gave you, but in place of the call to SceneManager.goto, turn on a switch instead. Then make a battle event that's activated by that switch, and set its activation to "moment" so that it triggers immediately as soon as the switch is on.
Use the same code ATT_Turan gave you, but in place of the call to SceneManager.goto, turn on a switch instead. Then make a battle event that's activated by that switch, and set its activation to "moment" so that it triggers immediately as soon as the switch is on.

oh so...
use like this?


<Custom Apply Effect>
target.addStateCounter(326, 1);
if (target.getStateCounter(326)==4)
$gameSwitches.setValue(201, true);
</Custom Apply Effect>

oh thx! it working !




Oh, one more thing.
By any chance, can you return (indicate) the stack number of this buff in text?

In my game, there is a way to check the description of the state given to the enemy or allies during the battle.
At this time, the state's explanation window is marked in text according to the text written in the note.
Is there a way to display \v[1] <- text substitution characters in this way or separately?

I basically turn off the option of marking the remaining turns of the state, so I'd like to write it down separately only in the explanation window.

ex) When the player opens the state description window and reads the description.
Boss is preparing for a powerful attack. [X/4]
I want X to indicate the stack of buffs currently assigned.



edit)

Oh, and...
Two switches should be used because the buff of the boss is not only four stacks but also three stacks.

<Custom Apply Effect>
target.addStateCounter(326, 1);
if (target.getStateCounter(326)==3)
$gameSwitches.setValue(201, true);
if (target.getStateCounter(326)==4)
$gameSwitches.setValue(203, true);
</Custom Apply Effect>

Can I use it like this?
Or should I write it differently?

edit+) oh NVM this one work!
By any chance, can you return (indicate) the stack number of this buff in text?
It should display on the state icon by default. If you mean you want to do a Show Text command that references it, you can set a variable to the value of the counters by using the commands in the documentation for the plugin, then show that variable.
It should display on the state icon by default. If you mean you want to do a Show Text command that references it, you can set a variable to the value of the counters by using the commands in the documentation for the plugin, then show that variable.


Oh, that's...
The image size of most bosses in my game is supposed to fill the screen.
So I was using a separate state because I couldn't see the STATE above the boss.
Reducing the size of the boss will solve it, but the top of the picture will be cut off because the boss is set to fit the screen size.


1636749579456.png



In this way, players can run the command at the bottom during the battle and see the state description separately.
So what I need is to replace the number of stacks in the state and display them in text.
For example, as you write down a variable mark \v[n] in this way.
It should display on the state icon by default. If you mean you want to do a Show Text command that references it, you can set a variable to the value of the counters by using the commands in the documentation for the plugin, then show that variable.

Ah but that's ok NVM

It would be nice if could see the figures here, but they're not necessarily.

Rather, it will be a more tense production because the player does not know the exact stack.

THX to help !

Original thread: https://forums.rpgmakerweb.com/threads/can-stack-the-state-and-turn-on-the-switch.142045/