How do I exit a RealTimeBattle in a scene from a script?
I am using a RealTimeBattle area (scene) component.
I want to end the battle and save the position in the scene, since the movement of the combatants during the battle is not saved.
Therefore, we want to exit RealTimeBattle from the script just before saving.
ORK.Game.ActiveGroup.Leader.Battle..EndBattle();
OR,
ORK.Battle.EndBattle(BattleOutcome.Victory);
but the battle does not end.
In the Battle Component description it says
'It ends when the player leaves the scene'.
So,
ORK.Access.Group.DestroyInstances(ORK.Game.ActiveGroup,true):
but the battle does not end.
How can I end it?
ORK.Battle.RealTimeAreaCount--;
Similarly, you can add a real time battle area by code:
ORK.Battle.RealTimeAreaCount++;
Generally, you can save during real time battles - just keep in mind that the state of the battle isn't saved, e.g. current turn, queued actions or even in-action state are not tracked in save games. The player position, status values, etc. are all saved, though. Same for enemy combatants if their spawners are set up to remember them.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I tried it and was able to save normally even in the middle of a battle!
Thank you.
■iOS
https://itunes.apple.com/us/app/id679133055
■Android
https://play.google.com/store/apps/details?id=com.WabiPlant.SAMURAI100SlashLite
New ORK Battle Game
■iOS
https://itunes.apple.com/jp/app/id1403510381
■Android
https://play.google.com/store/apps/details?id=com.Company.AgentFight
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!