Let me ask a question about when a player loses a battle and wants to start the same battle again from the beginning.
It is a turn-based battle, and the battle is being started with StartTypes: Enable of the Battle component.

After the battle is lost, when the Battle component's Enable process is performed again to start the battle a second time, the player is placed in the position it was in at the end of the battle. This is not a major problem, but the problem is that, the BattleEndDefeatSchematic is processed immediately after the battle starts.

The settings are
At the start of the battle, the player is placed in the BattleSpot.
Destroying a combatant other than the player when the battle is lost.
When defeated, no save data loading process is done, AutoGameOver is Off.

I need to know how to start from the initial state every time I start a Battle component(via schematic or script). It doesn't matter if the player's LV, status, equipment, etc. are reset.

Thank you.
  • edited December 2022
    Can you show/tell me how and when you handle disabling and enabling the battle?
    Is this part of the battle end schematic?

    Generally, the battle is over after the battle end schematic finished executing. E.g. if you disable the battle's game object in the schematic, enabling it in the battle end schematic will not cause another battle, since the current battle isn't over yet.
    You can work around that e.g. using an Auto Machine that starts on Disable, enabling the game object after a short time.

    Also, make sure not to enable Use Scene ID in your battle component, or the battle is marked as finished.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited December 2022
    BattleEndSchematic shows some HUD(Button), and the OnClick event of the button launches another Schematic, in which the CallFunction node is used to disable Battle component.
    So, I think The Battle component is disabled not in the BattleEndSchematic.

    Use Scene ID is disabled. (I tried enabling it just to be sure, but the result was the same.)

    As a solution, would it be possible to do something like, for example, reset the flag for the end of the battle? Or a process to return the player to Spawned status(or some flag) without Destroying the player?
    Post edited by modot on
  • Should be working like that, as long as the previous battle was finished.
    However, since this is in case of a defeat, your whole battle group is probably dead - make sure to revive and heal them before starting a new battle (e.g. in the defeat battle end schematic), or the new battle can't start or is over immediately due to the player/group being dead.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited December 2022
    Revive node, that's it!
    Sorry, I had a simple misunderstanding that if I heal the player's HP with ChangeStatusValue node, the death mark would disappear.

    Thank you GIL!
    Post edited by modot on
Sign In or Register to comment.