I'm trying to understand queued actions in Battle AI. I set up the AI below as a test, in my turn-based grid battle game. The goal is to move to the nearest target and then attack. The Action Use Mode of both the Grid Move and the Attack nodes is set to Queue. Then I attempt to loop through all Queued actions to execute them.
However, it doesn't work at all like I was expecting. The first turn, I can see the AI select a target node, but it doesn't move, and the Queued Action loop is never reached. The next turn the Queued Action Loop executes and the Move happens, to the cell selected the previous turn. This then continues - on alternate turns, a target Cell is selected, and then the following turn the Grid Move takes the combatant to the cell selected the previous turn.
How should I set things up to get the Queue execution I was looking for (Queue a Grid Move and Attack, then loop through them to execute them in the same Battle AI). Is that even possible?
(Note that normally I wouldn't do this - usually I have the move and attack in separate AI. Just doing this as a test to understand how the Battle AI queue works...).
Thx Stevan :)
Edit : So I can get it to work how I would expect if I connect both the Gridmove node's Next and Reachable connections to the Attack node. But I still don't understand why it's behaving the way it is without the Reachable connected. In that case, regardless of whether the target is reachable or not, it still has the same behaviour - selecting a node one turn, and then moving to it the next.