I am using combatants that are spawned by combatant spawners. They roam around using Ork's moveai and A* pathfinding. When they get close enough a turn based battle starts. I'm using using a gameobject with a battle component and battle spot settings for each combatant.

I'm using a Place At Spots node in the battle start event. The Place At Spots doesn't affect if there is a single combatant already spawned by the combatant spawner. His position stays where it was when the battle was initiated.

If I have a group of combatants but only spawn one from combatant spawner and the rest spawn at the battle start event then the ones spawned by the battle start event will be placed at the battle spots, but the original combatant spawned by the combatant spawner is not affected by the Place At Spots node.

If I have a group of combatants all spawned together by the combatant spawner and battle is initiated then none are affected by the Place At Spots node.

1. Is it possible to have the combatants spawned from the combatant spawners be placed at the battle spots?

2. What is the best way to reference a combatant spawned from a combatant spawner in the battle start event?

I've tried the select combatant, but I'm not sure if I'm using it correctly.
3. Could you show an example of the correct settings for finding the current enemy combatants in the battle?

Thank you!
Jason
  • edited October 2020
    Hm, it should work like you've set it up. I did a quick test with combatants from combatant spawners (moving via NavMesh) and that worked fine, simply using a Place At Spots node (Place All enabled).

    The battle start event has the combatants that are participating in the battle available via the actors (i.e. enemies via the Enemy Group actor). It doesn't matter if they're coming from combatant spawners, the battle component or other sources.

    Something that might be influencing this is the movement component, depending on how it's working. So make sure that the move AI isn't active at that time (e.g. blocking it in battle) and maybe add a small wait time before placing at the battle spots, so that any ongoing movement from the move AI (via your A* pathfinding component) has time to stop so that this doesn't interfere.
    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!
  • Thank you for your response.

    Would having a collider box as a trigger on the combatant spawner affect the battle spots? After I removed it, the behavior was correct.

    Making the battle object a child of my player works like I wanted.

    Is there an upper limit on the number of battle spots in a battle? When I have 9 enemy combatants or less it works as expected. If I have 10 enemy combatants it doesn't seem to place them anymore.

    Thank you!
    Jason
  • Hm, maybe if the box collider is interfering with finding the ground for the battle spots (in case you use that). Check Battle System > Battle Spots if you're using Place On Ground and a layer mask that's not including the layer of the collider (e.g. change the collider's layer).
    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.