Resetting a turn during battle

Unfurl

Villager
Member
Joined
Jan 4, 2016
Messages
18
Reaction score
1
First Language
English
SHORT VERSION:

Is it possible to "reset the turn" (I assume using the script command) during the player's turn, as if the player hit the back button to undo all their actions until they are back to their first actor again.


LONG VERSION:

I'm currently working on making a Odometer/Rolling HP meter using events and the help of this amazing script.
This mechanic was used in Earthbound/Mother series (seen below) and has been highly requested by people online for an MV version plugin however after hours of looking around, I found a sneaky way to do it.



Now it is pretty gross as you need to have a common event, switch and number variable for each actor you will have in your party at any time. But that's not the point, it works.

Here is the problem though. RPG maker isn't really built to handle KOs during your turn. If someones health drops to 0 while you are having your turn, sometimes the command window (displaying attack, magic etc etc) will disappear which softlocks the game.

I am thinking of a way to fix this and currently I can only think of resetting the players turn entirely if someone dies during your turn. Is it possible to "reset the turn" (I assume using the script command) as if the player hit the back button to undo all their actions until they are back to their first actor again.

Or if someone has a better idea of how to handle this softlock that would be good too.
Here a picture showing how the Common Event works (requires the plugin I linked at the top to make parallel events to run during battle).


Then all I do is change the formula for the enemies attacks to:
Code:
if (b.constructor == Game_Actor)
{
    targ = b;
    $gameVariables.setValue (targ.actorId(), $gameVariables.value(1) - 50);
    $gameSwitches.setValue(targ.actorId(), true)
}
else
{
    a.atk * 4 - b.def * 2
}
I found this code on this post here:
Which basically changes the target actor's "Change HP" variable to be in the negative and turns on the switch to start reducing health. Healing works the same way but in the opposite. Healing also resets the damaging ticking on the actor to 0 and begins healing them again.

Sorry for the wall of text. I''ll consider posting a tutorial on this as a dirty work around for Earthbound/Mother3's Odometer system while we wait for someone more knowledgeable than I in JS to create it as a plugin.
 

Unfurl

Villager
Member
Joined
Jan 4, 2016
Messages
18
Reaction score
1
First Language
English
Does anyone have any idea on how to to this? I'm kind of stumped
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I haven't been able to solidify a cohesive plot so dropped out of a game jam but, on a fun note, I pre-ordered MZ today! :LZSwink:
So I just spent the weekend...playing my own game. The one I released last year. Yep you heard that right.
Goal for MZ? None... I'm still curious how to finish my VXA project and how it looks like when it actually finished. Which will take at least another two years. Coming late again to the party.
Finding it amusing that people are posting support questions in new threads for an engine that isn't even released yet. Touch and Archeia are the only ones authorised to say anything, and there's only one active thread where they'll be answering questions.
I think my goal for MZ ... is to actually release a game and not have twenty technical demos and debugging projects. Let's see if I can manage that. ;o

Forum statistics

Threads
100,654
Messages
978,115
Members
132,266
Latest member
belladaris12
Top