Hi Gil,

The Subject is Summoning Combatant in Battle Grid.

I would like my buildings to function as a barracks where I can recruit fighters for a gold cost during grid battle.

My battles take place on a hexagonal grid.

I feel like I'm missing something simple, but I spent Sunday afternoon trying to create this skill.

What I got was to make the Combatant spawn in the Player position, but it doesn't join the battle when I add this node.

By adding this node (Join the Battle), another combatant is added, in a random position next to the "Combatant" that summoned him, without respecting the battle grid. Also, this second combatant is left as if his starting position in the battle grid was in the first grid cell. So, on your turn, what we see is this combatant running to that starting position and only then following the selected path.

As I said, I must be missing something simple here. Can you help me please? Ideally, the Combatant would be spawned within the skill range template.
  • I think it's important to say that I'm using the same Combatant on both nodes. Both in the node that is generating the Combatant in the player's position, and in the Join Battle node, which is generating the Combatant in a random position next to the player, but with an initial position marked in the first cell. Thanks in advance.
  • Can you give me more details on your battle event that handles it?

    I'd try the following:
    - Join Battle node to have a new combatant join the battle (in the User's group)
    - Select Combatant node, selecting all Battle combatants from the user
    - Select Selected Data node to get the Last combatant from the selected data
    That should now have the newly joined combatant stored as your selected data and you can use it to place 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!
  • Excellent Gil! I'm looking forward to testing this. As soon as I get it I'll get back to everyone. Thank you very much!
  • Hello Gil!

    I feel that we are almost reaching this stage. With your help we are now able to spawn only one Combatant.

    The problem of the position / location where it is generated still remains.

    The Combatant continues to spawn in a random position around the player. And for movement, keep going to the first cell.

    Thinking about it, is there a way to create an ability that modifies the cell type (to a summon type), so that the Combatant is Spawned exactly on that cell?

    Thanks in advance GiL!
  • Can you show me what you've done so far? E.g. a screenshot of your event.

    Cell types can't be changed in-game - at least not out of the box.
    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!
  • Hello Gil!

    Here it is. I just wanted the Combatant to stay on the grid location that was summoned with the skill (on some cell around the Summoner). But it still continues to appear next to the summoner, but without respecting the position on the grid. And when he selects his movimaneot he walks to the first cell and then starts the selected path, as he had said. I really need help.

    Here is the link with the print of the event.

    https://drive.google.com/file/d/15JgfJi9mbnXfF2sR1UyllvTu5STnKtOa/view?usp=sharing

    Thanks!
  • Requested access for it - google doesn't allow alternate emails to access that, for whatever reason :)
    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 February 2022
    Releasing access. Thanks!
    Post edited by Vykthorius on
  • gamingislove said: - Join Battle node to have a new combatant join the battle (in the User's group)
    - Select Combatant node, selecting all Battle combatants from the user
    - Select Selected Data node to get the Last combatant from the selected data
    You don't use Select Combatant node to first get whole battle group. Also, the Set Grid Cell Combatant node should be after joining and getting the combatant from selected data and use that combatant (selected data) to set the cell's combatant.

    Currently, you first set the cell to be occupied by some combatant, afterward join a new combatant.
    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!
  • Hello Gil!

    Very grateful for all the help. I followed your guidance and to our delight we are evolving.

    By that I mean that we solved the problem when we selected the movement of the Combatant generated and he walked to the first cell of the grid.

    It is now starting the movement of the selected location to be spawned.

    The Problem that remains is that of where the Combatant is spawned. I noticed that it still doesn't respect the grid, and I also noticed something that might be relevant... The generated Combatant is always being generated on the summoner's back... always the opposite direction of the summoner's orientation.

    I spent the morning trying to advance this and without much success so far...

    I confess that I'm struggling a little to understand the logic behind the Selected Data... Maybe this information will help.

    My English isn't that good... but I'm still determined.

    I need help please.

    I shared a screenshot of the Event with you.
  • I think I see where the issue is, use the following settings:

    Select Combatant node
    - selected key: don't forget to define a key here, your Select Selected Data node uses a key, but the combatant's aren't stored in the same key
    - use all combatants: enable
    - combatant scope: Battle
    - combatant origin: Combatant
    - object: Actor
    - actor: User

    Set Grid Cell Combatant node
    You need to use the combatant stored in selected data from the Select Selected Data node:
    - object: Selected Data
    - selected key: the same key you stored the last combatant in
    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 March 2022
    Hello Gil!

    Always grateful for your patience and dedication.

    I followed your guidance as far as I could understand. I can't understand what's wrong.

    Select Combatant node
    - selected key: don't forget to set a key here, your Select Selected Data node uses a key but combatants are not stored in the same key (Summoned)
    - use all combatants: enable (OK)
    - combatant scope: Battle (OK)
    - origin of combatant: Combatant (OK)
    - object: Actor (OK)
    - actor: User (OK)

    Set Grid Cell Node Combatant
    You need to use the combatant stored in selected data from the Select Selected Data node
    : - object: Selected data (OK)
    - selected key: the same key you stored the last combatant in (OK? Summoned)


    Is it like the "Place at Cell" Field of the "Set Grid Cell Combatant Node" is not working properly?

    Or must I have filled in some field wrong in some node that contains "Selected Data"?

    I shared the prints with the 04 of the Event's nodes.

    Grato desde já,
    Post edited by Vykthorius on
  • Sorry, checked the code and noticed that the Join Battle node already sets the combatant's cell to use a potentially selected cell from grid targeting if it's available.

    So, the combatant is already set for that cell, all that needs to be taken care of is placing it there.
    So, after the Select Selected Data node simply use a Change Position node instead of Set Grid Cell Combatant node:
    - object: use the Selected Data with the key you used (Summoned)
    - target position: enable To Object and select the Target actor (which is the selected cell from the cell target selection)

    In case it's not working like that, add a Wait node before the Change Position node with a 0 second wait to give Unity time to spawn (but should work without, at least in my test).
    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!
  • Actually - are you using the Join Battle Animation to animate a combatant joining the battle?
    If it's not used, the combatant should be placed on it's cell, otherwise it'll spawn around it's leader and use the battle event from Join Battle Animation (e.g. to move to the position).

    The default settings for this are in Battle System > Battle Settings > Combatant Settings > Battle Animations.
    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 March 2022
    Hello Gil!

    I Will check my Battle Animations.

    Grateful,
    Post edited by Vykthorius on
Sign In or Register to comment.