Trb - RestoreBattle (Battle Save)

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
809
Reaction score
1,360
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

  • Trb_RestoreBattle.js
    2.9 KB · Views: 12

dragonx777

Veteran
Veteran
Joined
Jan 25, 2015
Messages
149
Reaction score
46
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
149
Reaction score
46
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
809
Reaction score
1,360
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
149
Reaction score
46
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
809
Reaction score
1,360
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:

Latest Threads

Latest Posts

Latest Profile Posts

Starting work on some stuff for the community. Hopefully it will be fun, and useful to somebody.
Searching what to play in my dead times, the nostalgia hit me hard and ended downloading the Patapon trilogy, hope I can avenge my child self and beating all the games hahaha
Finished the frontier and...I apologize to anyone who saw the trailer I posted and actually tried it. Technical marvel, crazy disjointed fetish story hidden inside a cheap milsim skin that has no idea what it's trying to be except sanctimonious and failing at even that. As much as I hate fallout 4's story, even it was better. I guess there just won't be another non-parody fallout after all.
Anyone else having trouble posting in the forum? I have no reply box in posts or in messages. This is the only place I can type. @Archeia?

Forum statistics

Threads
107,763
Messages
1,031,989
Members
139,911
Latest member
Katara
Top