Hi,
I'm working on turn base battle that has multiple waves of enemies.
The screenshot shows the schematic set in enemies' Death Animation.
The situation is:
1. If I kill the first wave enemies one by one, the battle end will be canceled and the next wave will be spawned in the battle spots, everything works well.

2. If the first wave enemies were killed at the same time, the next wave will be spawned in the battle spots, but the battle end was not canceled. The battle outcome will be executed.

3. If the first wave enemies were killed at the same time, and the Wait node(the green circle) before the Join Battle node was disabled, all the second wave enemies will be spawned in one position(not in one of the battle spots I guess) and the battle end will be canceled. The battle can be continued but the only problem is the position of the enemies.

Any help would be appreciated.

Cancel-Battle-End
  • If you're not using Death Immediately in your turn based battle system's setup, the death animations are performed one by one, so while there are still enemies in battle, they're already all dead. Not sure what your custom function checks for, but from ORK's perspective I'd recommend to check for there not being any alive enemies and only 1 dead enemy being there - that'd make this only run for the last dead combatant's death animation.

    Regarding #3, that's most likely because there are no free battle spots for those new combatants available. That'd use the Additional Spot setup to create new spots.
    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!
  • from ORK's perspective I'd recommend to check for there not being any alive enemies and only 1 dead enemy being there - that'd make this only run for the last dead combatant's death animation.
    Thanks. This solves the Cancel Battle End problem. Now the battle end can be canceled, and the next wave is spawned in the scene, but it seems that the combatant won't remove from scene until the death animation end. so the Join Battle node is executed before the last combatant removement, and there will be always one battle spot is unavailable when the combatants Join Battle. It seems OK to use one Additional Spot to solve this though.
  • You can use the Leave Battle node to have the combatant be removed from battle earlier.
    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!
Sign In or Register to comment.