edited April 2023 in ORK Support
I'm trying to create an ability for a grid battle in ORK 2 that summons a minion, but it's not quite working. It creates the minion prefab at the coordinates of the correct hex, but doesn't add them to the combat or place them in the hex as a combatant or anything.

Currently the animating event uses a Store Grid Cell node to find the targeted hex and save it to found objects. Then it uses a "Spawn Combatant" node to spawn the combatant with settings:
battle type: turn based
use selected data: disabled
faction: player
use group: enabled
combatant group: group that includes only the desired minion (I eventually want it to summon 3 of the minion, hence the group instead of just a single combatant. But I'm working on getting it to summon one right now.)
spawn group: disabled (for now)
despawn: disabled
store selected data: enabled
value key: (a value for this let's call it y)
Data origin: local
change type: set.

And then uses a "Set Grid Cell Combatant" node to set that combatant to the occupying combatant of the grid cell.
place at cell: enabled
object: selected data
value: (value y, as per the spawn combatant selected data key)
Data origin: local
set as: combatant
use nearest cell: disabled
object: found objects
value: (same as the store grid cell node)

What am I missing for getting them to actually occupy the cell and join the fight properly?
Post edited by Whatexists on
  • Spawn Combatant just spawns a combatant, but it's not automatically part of a battle.
    You can use the Join Battle node to add a combatant to the battle - either creating a new one directly in the node or using an already existing one (e.g. the one you spawned) via selected data.
    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! That solved that problem. Any idea why it might not be spawning the whole group when I set the store grid cell node to a template that includes 3 hexes, the spawn combatant node to "use group true" with a group that includes 3 of the combatant, and affect range of the ability to use the same template?
  • Probably uses the same (first selected) cell for all of them. Try looping the cells, spawning a combatant for each cell (e.g. via Loop node).
    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!
  • 1. I'm not finding any 'Loop' nodes. is that an ORK 3 thing? I can create a loop, of course.
    2. Also, I tried setting the rotation so that it would share the user's rotation by initializing a local vector 3 variable, using a transform to variable node with actor: user and value origin 'rotation', and then use that variable for the "set rotation" setting in the spawn combatant node. But it did seem to work. Any ideas why?
  • 1) Ah, sorry, missed the ORK 2 in the title - yeah, Loop node is an ORK 3 (or rather Makinom 2) thing, but you can do it in other ways as well.

    E.g. if you store the combatants into selected data, you can go through them one by one using the Select Selected Data node. The node lets you get one of the combatants from selected data, remove it there and put it into a separate selected data. If no more content is in the data the ndoe fails and you can continue with other stuff.

    2) Hard to say without seeing it in context.
    E.g. if spawn and rotation change happens in the same frame it could be too soon to set the rotation. Or just something else overruling it.
    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.