edited July 2023 in ORK Support
Hi GiL,

Two issues with Combatant spawner:

1) Respawn not working with Auto Start for some reason
2) Is there a way to get spawner to use Grid Deployment cells for respawn (by faction or at least Enemy)?

Setup and what's going on:

Combatant Spawner as component in an empty game object in scene.
Respawn box is checked and time set for 5 (fast for testing)
Auto Start
Combatants spawn properly
Combatants join the battle upon battle start (auto join in the battle component)
Combatants are placed at proper Grid Deployment cells
Upon death, player gains exp, combatant shows isDead == True in inspector

Combatant never respawns...
I know the spawner is starting because otherwise there wouldn't be any combatants to begin with.

If I change the Combatant Spawner to Trigger Start:

Combatants join the battle
Combatants are all placed at the edge of the battle grid instead of deployments :(
Respawn Works fine! Great except now deployment is broken.

So then I went back to Auto Start and in the death schematic put in a Respawn Combatant node.
Upon death they respawn, but now the Combatant Spawner seems to start working correctly because they spawn Twice (once for node, once for Combatant Spawner).

Also when they respawn, they don't use deployment cells.
Trigger respawns them where they died. (They end up on grid cell where they died)
Auto Start with Respawn schematic node spawns 1 at the deployment cell and 1 at the edge of the grid lol.


Thanks!

Post edited by GeneralK on
  • Respawn happens after a battle when a Battle component is involved - i.e. everything except a Real Time Area Battle.
    The trigger is probably just causing another spawn, not particularly a respawn. Deployment is probably off due to layer settings, make sure the trigger's game object is on a layer that's not hit by raycasts.
    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 July 2023
    Hmm ok that makes sense now, it's not meant for it at all lol.

    Any recommendation on the cleanest solution for respawning during battle?

    Trying to do like an MMORPG where they respawn after X minutes at their original spawn point (grid deployment cell)

    Something like in death schematic start a machine that grabs the time amount from Object variable and starts a timer from it, stores the combatant type, then Join Battle when timer up?

    Edit:

    I've had some luck putting a Combatant Spawner on the Combatant prefab itself and configuring it for that 1 combatant. Then in death schematic starting a machine that has a timer (pass it machine object), Start Combatant Spawner node, then destroys object.

    Seems like it might work out.

    Of course there is still the issue of Auto Join not placing them at deployment cells when they are spawned. They join the battle and are placed on grid, but are placed at the cell where the combatant died instead of a deployment placement cell. Hmm.

    Are there Auto Join settings for Grids I'm missing? Battle spots handle other battle types auto join right.

    Thanks for the help
    Post edited by GeneralK on
  • Auto join is animated by the Join Battle Animation schematic. It's set up like other special actions like defend in the general settings for all combatants + override for individual combatants.

    Whatever you want to do when a combatant joins a running battle, that's where you can do it. E.g. place it on the nearest deployment cell.
    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!
  • Oh I see it, great thanks again GiL you're the best
  • edited July 2023
    I got it working pretty smoothly but now I want to make the respawn Battle Turn based instead of time.

    I've been wracking my brain trying to find where I can grab/store the current Battle turn but must be overlooking it?

    In the mean time setup a variable on battle start to be my own turn counter, increment it in battle turn end schematic, snap shot that in the respawn schematic then do comparison to counter until reaches what I want.


    For anyone else trying to do something like this with respawning during a grid battle..

    I ended up using a Global Machine, Multi mode.
    Start the machine in death schematic (pass dead combatant as machine object)

    In the machine schematic have a Wait node for respawn time.
    Then Check status --> combatant (or combatant type or class or however you want, or use status fork if doing a ton).

    Spawn Combatant node that corresponds, store to selected data.

    Place On Grid - selected data - use deployment

    Join battle selected data

    In Battle End schematic Stop Global Machine so they don't respawn in the next scene.

    Setting it up that way everything seems to work out so far.

    Thanks!
    Post edited by GeneralK on
  • You can register to ORK.Battle.TurnChanged to get notified of battle turns changing. ORK.Battle also has other information and event handlers to hook into :)
    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.