I am setting up battles in a slightly narrow dungeon surrounded by walls.
The battles are turn-based, and the scene does not switch; the battle takes place at the location where the encounter happens.
However, due to the limited space, there are issues where allies spawn on top of walls or on the other side of the walls when the battle begins.
I want to find a way to avoid this.
1)Is there a good method to allow battles to either change to a battle arena scene or occur without changing the scene depending on the situation?
The goal is to have battles take place in the battle arena only for locations that are enclosed by narrow walls.
2)Is it possible to restrict spawn positions during battle so that allies do not climb walls or spawn on the other side of them? Although I am using NavMesh baking, there are still cases where allies end up on top of the walls during battles.
Is it possible to restrict the height of the spawn location?
3)I have another issue that I’d like to ask about along with the above questions.
Allies are hidden on the field screen and only spawn during battles.
When a battle begins, the player character remains at the encounter location, but the other ally characters spawn in a different location.
It seems that their spawn location is the same as when the Place At Spots node in the BattleStart schematics is enabled.
How can I ensure that all members of the player group spawn near the player character, similar to when the Place At Spots node is disabled?
Thank you for your support.
In the Battle Start schematic, Place At Spots should then move everyone to the appropriate area. Depending on your camera controller, you may need to manually adjust it, but if its stuck to the player it should go with it.
Or, a similar but different approach is that you could make multiple Battle objects/components that have predefined spots in your hallways if you want them to take place in the same area as well.
For Combatant Spawners you can manually define the battle you want to use, or check use nearest battle and that should also work.
Thank you very much.
Since reloading the scene takes time, I am trying to make the player character appear in a distant battle arena after Store scene node.
The tutorial uses the Load Scene node, but I am still unsure which node would be appropriate in this case.
I tried using Set Scene Position, but the battle took place at the location where the enemy was encountered, rather than in the battle arena.
I also tried configuring the Battle Spot in the battle component.
I thought coordinates would be entered here, but it seems that a prefab is supposed to be set instead.
As a result, I’ve become unsure how to use it.
Is there a way to move without reloading using the Load Scene node?
Additionally, I created a small, lightweight battle scene that loads quickly and tried moving to that scene when entering a battle, referring to the tutorial.
However, when the battle is about to begin, I cannot transition to the battle scene.
I followed the tutorial and configured it as shown in the picture.
In the initial setup node, the actor is set to load the battle arena.
Is there a solution for this issue?
I use it for portals using an Actor (Battle) to move the player battle group, and a Find Actor to find the name of the attached portal I'm moving to.
Thank you for the new suggestion.
Using Change Position seems to be a method where the movement is skipped, and the character instantly warps.
Do I need to move both allies and enemies?
Also, what happens to the enemy's position?
There are many things I don't understand, but I'll give it a try.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
However, the player character did not move, and while the monsters seemed to have disappeared at first glance, they had only moved to a slightly distant location and quickly returned to their original positions.
I tried various methods, but nothing worked.
This hasn’t gone well at all.
It seems I’ve encountered a significant challenge...
Otherwise sometimes Unity will kick in and keep it stuck to the navmesh (or add a new destination that overrides your own change).
You’re free to turn it back on after the move, but in my experience that’s generally the root cause of this issue.
Indeed, the Navmesh component was not attached to the player character.
I will try again.
Thank you very much.
To be honest, I don't understand why this is now working.
However, the distance between the player and the monsters is too far.
Even after adjusting the spawn point location, the monsters remain distant.
How can I adjust this?
Furthermore, as shown in the uploaded video, after all the enemies are defeated, nothing is displayed, and the battle does not end.
Although a LoadScene node is attached to the VictoryEnd Schematics, the 'Victory' text and music do not appear beforehand.
If there is a solution to this issue, could you please let me know?
Although the order of testing got all mixed up, I just enabled Navmesh and tried starting the battle using the Change Position node.
The Move setting is disabled, so the character should move instantly to the desired coordinates.
It certainly moves quickly, but the player-controlled character gets stuck on the wall and cannot reach the battle arena.
Is there no node that allows instantaneous teleportation?
Otherwise disabling (turn off) the navmesh and then using Change Position without "move" checked, should teleport the character (try changing the move component from Auto to Transform as well)
I tried several movement nodes such as Navmesh Warp and Spawn Player.
It does seem like the movement happens instantly, but although the spawn point is in the same area, the character spawns at a significantly offset position.
Additionally, only the player character moves, while the enemies do not.
I’ve been following the tutorial, but even if I assemble the Schematics in the same way, it doesn’t behave as intended at all.
I’ve also used Place at Spot and Spawn Battle Combatants, but nothing moves from its original position.
I suspect that a Schematic for moving enemies is also necessary, but even if so, it doesn’t seem like they can be spawned at appropriate positions for combat.
I have continued trying methods to spawn into the battle arena scene, but the spawn point seems to be far away, and the enemies are also positioned far from the intended location.
I’m quite troubled by this.
Currently:
・Problems when placing a battle arena at a distant location within the same scene:
Players and their party group appear in the battle arena, but the enemies remain in their original positions.
I tried various methods like using the Change Position node and Spawn Combatant node, but the results were the same.
→ Question 1: How can I make the enemies spawn in a distant combat arena?
・Problems when conducting battles in a separate scene for the battle arena:
Both players, their party group, and enemies appear in the battle arena.
However, the enemies spawn in a distant location.
Additionally, it takes some time to call the battle arena scene.
Even after eliminating all the enemies, rewards are not obtained, and the battle does not end. Of course, I have set the Schematics for victory in battle.
→ Question 2: I want the enemies to spawn close to the player characters.
Unfortunately, I can no longer make enemies appear at the coordinates set for their battle spots. How can I make the coordinates set for battle spots reflect during combat?
→ Question 3: I want to preload the battle arena scene asynchronously so that it can be quickly called using the Load Scene node. The Load Scene node has a Load Async setting, but how can I asynchronously preload it?
→ Question 4:What kind of patterns could cause the battle not to end?
The battles are initiated by the battle components of enemy characters roaming the field.
The combat system is turn-based, and the camera is Top down border.
I will continue to seek solutions and suggestions.
Thank you for your support.
Additionally, NavMesh will prevent movement as well - e.g. is NavMesh baked for the far away battle arena? If not, you can't warp there. You can try to completely disable/remove the NavMesh agents from the enemies to check if it's working that way. If the battle spots are set up correctly, check the scale of the game object with the Battle component as well as any game object it's a child of. The scale will influence placement since it's done in local space of the battle.
Also, if your combatant prefab setup has a root object that's not moved (e.g. a child object being the actually moving combatant object), make sure to use the Child As Root settings of the combatant's prefab settings. I'm not sure if Unity can preload scenes like that.
What you could do is use the Additive load type to load the scene in addition to the current scene. That'd be similar to having the far away battle arena, though. Usually an error - check your Unity console if something happened (e.g. loot collection dialogue setup missing a UI box).
Since battle end is handled by your battle end schematic, this can also cause the battle to not end, e.g. when the schematic is waiting for someting (e.g. loot collection being confirmed) or is in some loop that's never broken. You can use live debugging to see what's going on in your battle end schematic.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!