Hi,
After last session, enemy units were spending their action points.
After this session, they are not.
Since we are using the same fonction (TakeAction()) as before, I dont understand where the problem is.
As anyone had this problem?
Hi,
After last session, enemy units were spending their action points.
After this session, they are not.
Since we are using the same fonction (TakeAction()) as before, I dont understand where the problem is.
As anyone had this problem?
Hi @francois_roy. Welcome to the community
In the lecture Hugo changes the code to find the best enemy action and then adds new code to spend the action points. He then deletes the ‘old legacy’ code just below it that used to spend the points. Make sure you
the last bit of the TryTakeEnemyAIAction
function should look something like this
if (bestEnemyAIAction != null && enemyUnit.TrySpendActionPointsToTakeAction(bestBaseAction))
{
bestBaseAction.TakeAction(bestEnemyAIAction.gridPosition, onEnemyAIActionComplete);
return true;
}
else
{
return false;
}
Hi!
Thank you very much for your fast reply, it solved my problem right away!
I was using the CanSpendActionPointsToTakeAction() method instead of TrySpend.
[They both are identical, minus spending the action points.]
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.