Undo mechanic

I'm trying to make an undo mechanic in my game for a boss but I don't know how to make it.

Basically I want to make a mechanic where the boss can undo any states(malus, boosts) and the current HP and Stamina(the MP of my game) to the previous turns, on both party characters and himself, just like bravely second's exorcist.

Does anyone know how I can make this mechanic?
Have the skill remove every possible state for the party and have the troop event check the HP of everything in combat at the end of the turn, then have another page that triggers with the skill that sets the hp values to whatever the variables are.

I don't have vxace currently installed, but should work along these lines I believe.
Dang, there's a script for this and I know it.
Not sure if this will help?
Tutorial
I have moved this thread from RPG Maker VXAce Resources to RPG Maker VXAce Support.
Have the skill remove every possible state for the party
But that's more like a dispel, the thing I'm looking for is more like something that can work both offensive and supportive, for example undoing a cured paralized status by resetting the character to the turn before, or undoing the damage received by an attack getting the HP to the same number it was before.


have the troop event check the HP of everything in combat at the end of the turn, then have another page that triggers with the skill that sets the hp values to whatever the variables are.
How do I make the game check each turn though?
Does vxace not have troop events? As for actually setting the states back to the turn before... My method works, but that will be a lot of work. Better look if you can find a script or maybe commission one.
that's kinda similar to what I wanted, but it resets the whole turn, what I wanted was instead a script that resets what happens to the characters not the turn, for example if I cure a character, the boss could reset the HP to the number it had in a previous turn.
Does vxace not have troop events? As for actually setting the states back to the turn before... My method works, but that will be a lot of work. Better look if you can find a script or maybe commission one.
There are troop events, but I'm not sure how to use it, I'm not really that good with events, But I don't mind it taking long to make, but I need to learn how to make it, and I'm not really understanding what you mean.
Dang, there's a script for this and I know it.
Not sure if this will help?
Tutorial
That's kinda what I need, but not entirely, but the boss uses em mostly separately like undo HP, undo STA, and I want it to have a limit from 1 to 8 previous turns, depending on how early he is fought, and this one doesn't really tell how to limit it, and it seems to only resets everything back to turn 0 as a support skill, while what I need is a skill that resets with whatever turn the boss wants, so it can cure itself, while t the same time reset whatever cure you use back to the HP your character had before, or even go back to death if resurrected.
Well essentially you'd need to make a very long troop event that has a conditional branch for every possible state, buff, hp, mp and whatever else you got like "If actor x = state x control variable x +1". Save each and every thing in a separate variable like that and when the skill triggers you need a separate page that has conditional branches checking all the variables like "If variable x = 1, do x" where x is whatever needs to happen. Remove a state, add a state, hp and whatnot. It's an insane amount of variables and set up work.
Well essentially you'd need to make a very long troop event that has a conditional branch for every possible state, buff, hp, mp and whatever else you got like "If actor x = state x control variable x +1". Save each and every thing in a separate variable like that and when the skill triggers you need a separate page that has conditional branches checking all the variables like "If variable x = 1, do x" where x is whatever needs to happen. Remove a state, add a state, hp and whatnot. It's an insane amount of variables and set up work.
So basically I need to make an array?
I ain't no programmer, no idea.
So if I'm understanding this correctly, you need to track the HP, MP and states for up to 4 party members and a boss, for 8 turns, and have the ability to revert any of them to the value they had on that turn?
There are troop events, but I'm not sure how to use it, I'm not really that good with events
So basically I need to make an array?
I would suggest you take some time to do some more tutorials and practice things with events. What you're describing here is a bit tedious, but it shouldn't be hard.

You absolutely don't need to use any kind of scripting concepts like an array.

All you're talking about is, as @SGHarlekin already said, a troop event that runs at the end of every turn and uses the regular old Control Variable event command to store each actor's parameters that could get reset.

The only thing I can think you'd need any script calls for at all are to store TP and states, since those aren't available in the Control Variable drop-down.
So if I'm understanding this correctly, you need to track the HP, MP and states for up to 4 party members and a boss, for 8 turns, and have the ability to revert any of them to the value they had on that turn?
Exactly
I would suggest you take some time to do some more tutorials and practice things with events. What you're describing here is a bit tedious, but it shouldn't be hard.

You absolutely don't need to use any kind of scripting concepts like an array.

All you're talking about is, as @SGHarlekin already said, a troop event that runs at the end of every turn and uses the regular old Control Variable event command to store each actor's parameters that could get reset.

The only thing I can think you'd need any script calls for at all are to store TP and states, since those aren't available in the Control Variable drop-down.
I did find this http://www.yanfly.moe/wiki/Undo_(MV_Plugin_Tips_&_Tricks)

Which is exactly what I need, but I use VX ace this one is MV and from what I learned, MV uses Javascript while vx ace uses ruby, and I don't know anything about ruby, and not enough about javascript to understand this code.

And I'm not sure it's exactly the one harlekin is talking about, cause from what I saw so far, it resets all to turn 0 and doesn't seem like it will give a choice of which turn.
Exactly

I did find this http://www.yanfly.moe/wiki/Undo_(MV_Plugin_Tips_&_Tricks)

Which is exactly what I need, but I use VX ace this one is MV and from what I learned, MV uses Javascript while vx ace uses ruby, and I don't know anything about ruby, and not enough about javascript to understand this code.

And I'm not sure it's exactly the one harlekin is talking about, cause from what I saw so far, it resets all to turn 0 and doesn't seem like it will give a choice of which turn.
Right, give me a bit.

Okay, so I haven't tested this exhaustively, but it should give you a starting point and I can't think of any reason it wouldn't work. First of all, do this at the beginning of battle:

1696266940098.png


Then make a second page that runs each turn:

1696266960989.png

1696266968865.png

Then have your Undo skill for each number of turns call a common event that turns on an associated switch. Create a third battle event page that's activated by its respective switch:

1696267976876.png


Basically, what will happen is that each turn, a chain of arrays will be shifted down the variable stack, containing all of the relevant information pertaining to the party members. Then when an Undo skill is triggered, it reverts the HP, MP, TP and states to what they were at the beginning of that turn.

If you want to do this for the boss, just use index 4 of the relevant variable. If you want HP, MP, TP or states to be reverted independently, just create additional pages for those skills.
I did find this...Which is exactly what I need, but I use VX ace this one is MV and from what I learned, MV uses Javascript while vx ace uses ruby, and I don't know anything about ruby, and not enough about javascript to understand this code.
Again - you should not need code for this. It looks like Trihan is planning to write you something helpful, which is awesome, but you should be able to at least get started with most of this just by using events as I described in my previous post.
Again - you should not need code for this. It looks like Trihan is planning to write you something helpful, which is awesome, but you should be able to at least get started with most of this just by using events as I described in my previous post.
That is true, but I think in this case because it needs to store 8 turns' worth of data for up to 4 party members plus a boss, code is the way to go here. The variable operation commands required to do it natively would be pretty mental.
That is true, but I think in this case because it needs to store 8 turns' worth of data for up to 4 party members plus a boss, code is the way to go here.
I don't disagree that it's more efficient (although you have, what, 4 variables per actor? HP/MP/TP/states. That per actor for 8 turns takes up a chunk of your variables, but doesn't seem mental to me 😉).

I was just offering the opinion that at least getting started on a version of this shouldn't be difficult, in terms of basic proficiency with event commands and logic. If it seems overwhelmingly unapproachable, there may be other basic game creation things that will give similar problems.

Anyway, opinion has been proffered, help is being given, I'll leave y'all to it!
I don't disagree that it's more efficient (although you have, what, 4 variables per actor? HP/MP/TP/states. That per actor for 8 turns takes up a chunk of your variables, but doesn't seem mental to me 😉).

I was just offering the opinion that at least getting started on a version of this shouldn't be difficult, in terms of basic proficiency with event commands and logic. If it seems overwhelmingly unapproachable, there may be other basic game creation things that will give similar problems.

Anyway, opinion has been proffered, help is being given, I'll leave y'all to it!
I agree with you that getting started with it using event commands isn't difficult. 🙂
I don't disagree that it's more efficient (although you have, what, 4 variables per actor? HP/MP/TP/states. That per actor for 8 turns takes up a chunk of your variables, but doesn't seem mental to me 😉).

I was just offering the opinion that at least getting started on a version of this shouldn't be difficult, in terms of basic proficiency with event commands and logic. If it seems overwhelmingly unapproachable, there may be other basic game creation things that will give similar problems.

Anyway, opinion has been proffered, help is being given, I'll leave y'all to it!
It's not that I didn't want or like this type of help, but what I meant was that the advices I got before seemed like something different from what I wanted, or at least I didn't understand it well if it's actually what I want, but I did make my researches before this thread, and most advices are stuff I already saw and didn't want while researching, not having anything now doesn't mean I didn't do anything at all.
Right, give me a bit.

Okay, so I haven't tested this exhaustively, but it should give you a starting point and I can't think of any reason it wouldn't work. First of all, do this at the beginning of battle:

View attachment 278731

Then make a second page that runs each turn:

View attachment 278732
View attachment 278733
Then have your Undo skill for each number of turns call a common event that turns on an associated switch. Create a third battle event page that's activated by its respective switch:

View attachment 278734

Basically, what will happen is that each turn, a chain of arrays will be shifted down the variable stack, containing all of the relevant information pertaining to the party members. Then when an Undo skill is triggered, it reverts the HP, MP, TP and states to what they were at the beginning of that turn.

If you want to do this for the boss, just use index 4 of the relevant variable. If you want HP, MP, TP or states to be reverted independently, just create additional pages for those skills.
Thank you very much!
I'm not understanding exactly how or what you made with that event, but I hope you don't mind explaining it in a private conversation.
If not, thanks a lot anyways, I would try to manage and try to understand alone.

Original thread: https://forums.rpgmakerweb.com/threads/undo-mechanic.161653/