tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
819
Reaction score
1,433
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)
Lwl9Vtm.png


Battle with one Minotaur and two bats.
fsY5c8Q.png


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

[Harold escaped!]

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

[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: 13

dragonx777

Veteran
Veteran
Joined
Jan 25, 2015
Messages
154
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
154
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
819
Reaction score
1,433
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
154
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
819
Reaction score
1,433
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

User of Mv3d/ Mz3d and Rosse engine. New Resource Pack on development "Halloween Stones" . Leave ideas about what you want to see on this package. :)
SetPreview.jpg
Looking at Code abd knowing that it made sense at one time. Ugh..why did I ever stop? Well I guess it will come back to me.
Well, Blizzard... thanks for making it easy to decide what to delete to free up some hard drive space... I guess. Ugh.
So far, I've rated 5 of the games out of the 120 submitted. Competition is fierce! There are a few which I played and thought "Well, at least my submission is better than this one." but there's at least one which is far better than mine (at least by my judgement.) Trying very hard to rate games fairly and only comment when I have something constructive to say. Good luck everyone!

Forum statistics

Threads
113,544
Messages
1,075,733
Members
147,542
Latest member
elsher
Top