Trb - RestoreBattle (Battle Save)

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
631
Reaction score
1,065
First Language
English
Primarily Uses
N/A
RestoreBattle - Version 1.00 (2017/1/14)

Creator name: Trb

Overview
Allows you to save in battle and resume the battle from the battle save.

Features
- Save and restore is done through plugin commands.
- To reset the battle save, run the script
Code:
$gameSystem._battleSaveData = []
<Plugin Command>
Code:
SaveBattle
Saves the previous battle state.
If you want to save multiple times, add a number like "SaveBattle 1" or "SaveBattle 2"

Code:
RestoreBattle
Before the battle event, you can restore from battle save.
If multiple files are saved, restored the data with “RestoreBattle 1” or “RestoreBattle 2”

Note: plugin commands for this plugin are not case sensitive. SAVEBATTLE and savebattle can be used.

Event Sample)


Battle with one Minotaur and two bats.


After defeating two bats and then escape-
(SaveBattle was used)

[Harold escaped!]

Retry the battle: only Minotaur remains
(RestoreBattle 1 restore the state from SaveBattle 1)

[Minotaur appears!]

Credit and Thanks: Trb

Terms of Use- Free for commercial and non-commercial use.

License - MIT License: http://opensource.org/licenses/mit-license.php

You can download js file from the thread attachment or Dropbox link: https://www.dropbox.com/s/68qehkaoew47j5u/Trb_RestoreBattle.js?dl=1
 

Attachments

dragonx777

Veteran
Veteran
Joined
Jan 25, 2015
Messages
133
Reaction score
42
First Language
English
Primarily Uses
RMMV
This could be used for a Reset skill. I’ll have to try this out.
 

dragonx777

Veteran
Veteran
Joined
Jan 25, 2015
Messages
133
Reaction score
42
First Language
English
Primarily Uses
RMMV
@tale is there a way to reset mid-battle? i was unable to accomplish this using a skill common event.
 

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
631
Reaction score
1,065
First Language
English
Primarily Uses
N/A
@dragonx777 Reset battle save does not mean it resets the battle process you're in.
If you reset battle save in battle, technically you're erasing battle save.
Plugin meant to handle saves while entering (restore) or escaping (save) battle.
 

dragonx777

Veteran
Veteran
Joined
Jan 25, 2015
Messages
133
Reaction score
42
First Language
English
Primarily Uses
RMMV
Darn. Well that makes sense. Would there be a way to edit the plugin to have that optional functionality?
 

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
631
Reaction score
1,065
First Language
English
Primarily Uses
N/A
Restart Battle would probably be separate plugin/ add-on.

I found a script call that does the trick. If you're using it for skill, set Scope to None.
Code:
BattleManager.setup($gameTroop._troopId, true, false);
SceneManager.push(Scene_Battle);
If you want fully recovered party.
Code:
BattleManager.setup($gameTroop._troopId, true, false);
SceneManager.push(Scene_Battle);

$gameParty.members().forEach(function(m){
 m.recoverAll();
});
However it looks a bit clutter due to extra message windows from escape, victory, etc..

Maybe someone who's more familiar with javascript could make this a lot neater to handle.

During my test with Battle processing script call-
After Minotaur is gone and two bats remains, I escaped.
I tried battle again with two bats, then I used script call to restart.
It brings back the Minotaur. It works, except not used with functionality of RestoreBattle.

Note: script call actually starts another battle processing of the same encounter. If you escape a battle after script call, ends up repeating encounter.
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

The most rewarding part of making custom body character parts is absolutely not making the masks work. Somebody please put me out of my misery.
Any commercial devs here ever mess with Gamejolt? Been contemplating making my games available there but don't know if it's worth the effort or not.
Social distancing taught me of how much of not a loner I am. Dammit, I miss seeing my friends...
Happy 4th of July all. Anybody have plans? Mine here is staying home away from the virus. Still a nice 3 day weekend.
The project I am working on is going great at the moment. I'm hoping everyone is having as successful a time as I am. :)

Forum statistics

Threads
99,258
Messages
963,580
Members
130,850
Latest member
MarcusCryo
Top