The AI is semi-working, and I suppose I should clarify a bit for those who haven't been following the project.
Here's what I want the AI to do:
1. Find the closest player object that can be reached. I used pathfinding to determine this because the closest player object is not necessarily the closest one that can be reached due to holes in the grid that prevent movement.
2. Move towards the closest player object that can be reached, and then deal damage.
I've been using the pathfinding object for this. Right now I have a pathfinding object move from the computer object to the closest player object that can be moved to, and each grid tile the pathfinding object moves through gets 'tagged'. After the pathfinding object reaches the closest player object that can be pathed to, I highlight the grid of possible tiles the computer object can move, then create a second pathfinding object that starts from the furthest grid tile that is both tagged by the first pathfinding object and highlighted by the movement grid, and this object moves to the computer program and builds a list of squares for the computer object to move.
Kind of complicated, but it's commented in the .capx. The main issue I'm having is skips in movement along with the pathfinding object moving diagonally even though I have diagonals turned off (not sure why this is happening).