[quote:172ooo27]Are you choosing a random point (out of a few points) for the AI to go to? If so, look into using 'random()' which generates a random number for a variable. Then compare for each variable and if the variable equals this or that then tell the AI to go to a certain point. Something about it should be on the Construct wiki.
I'm choosing most importent point.
[quote:172ooo27]It also sounds like you're doing top-down view so you might try RTS Behavior to make the AI walk to where you want it to go. It is very useful.
This is very helpful, did not know that you can use RTS behavior for this, have to experiment with this still.
[quote:172ooo27]You can go with the random() option, but the most common ( at least that I've seen in games ), is doing like most humans do, target the closest one.
To do this you could use pythagoras ( a^2 * b^2 = c^2 ), where a = object.X - target.X and b = object.Y - target.Y, do this to find the distance between all the targets ( on screen or whatever ) and check for which distance is the shortest. If some distances are equal, just take the first one or run the test again, considering the chances that something has moved.
You can do that a bit easier with the Distance(x1,y1,x2,y2) expression.
Don't know if that works in my case because its in a dungeon, I need to calculate the shortest route it really has to travel.