Help me with a script please

I have an idea for a certain mechanic, but i don't know how to do scripts and default tools of RMMZ doesn't allow me to do such a mechanic. A brief description of the mechanics: If a party member with a certain index is under the two certain states, then these two states are removed and the party member receives a new state. For example if Party member#2 has Burn state and Cold state, he gains Frosty fire state. Please help me, i'll be very happy if you help me with script.
You should be able to do this without a script or plugin using a conditional branch
Pretty much the way you wrote it up above.

I'm no expert here so take this with a shovel of salt.

You add a conditional branch:
If: Actor X is affected by XState
If: Actor X is affected by YState
Change State: Actor X, +ZState
You can use my Eval Tags plugin in my signature.

You'd give each state a similar notetag:
Code:
<State Apply Eval>
if (user.isStateAffected(9))
{
    user.removeState(8);
    user.removeState(9);
    user.addState(10);
}
</State Apply Eval>

That's presuming state IDs 8 and 9 combine to give 10. You would edit the first line to check for the opposite state (so 8 checks for 9 and 9 checks for 8).

You add a conditional branch:
If: Actor X is affected by XState
If: Actor X is affected by YState
Change State: Actor X, +ZState
Where are you putting this conditional branch? There's no default way to execute a common event when a state is applied.

I suppose you could put it on every skill in the game that could add either state.
Where are you putting this conditional branch? There's no default way to execute a common event when a state is applied.

I suppose you could put it on every skill in the game that could add either state.
Oh, yeah, I forgot about that, my bad... either add to all skills that can apply or get something like yep troop events plugin. That's what I use
I have most combat oriented events in my first troop (dummy troop), and it triggers on each encounter. I use it, for example, for my rouges' invisibility buff.
@D-D-D-Dan There's no troop event trigger for a battler having a state 😉

So it's put a common event on every skill/item that can result in the state getting added, or just paste the notetag on.

Good luck with everybody's project!
You can use my Eval Tags plugin in my signature.

You'd give each state a similar notetag:
Code:
<State Apply Eval>
if (user.isStateAffected(9))
{
    user.removeState(8);
    user.removeState(9);
    user.addState(10);
}
</State Apply Eval>

That's presuming state IDs 8 and 9 combine to give 10. You would edit the first line to check for the opposite state (so 8 checks for 9 and 9 checks for 8).


Where are you putting this conditional branch? There's no default way to execute a common event when a state is applied.

I suppose you could put it on every skill in the game that could add either state.
Will it work if I use it in enemy attack common event?
Will it work if I use it in enemy attack common event?
I'm not sure what you're asking.

Did you read my post and the instructions in the plugin? The code will be executed any time the state is applied.

Original thread: https://forums.rpgmakerweb.com/threads/help-me-with-a-script-please.165948/