How do I make turn based tactics AI?

Get help using Construct 2

Post » Thu Aug 10, 2017 5:06 pm

Zamargo wrote:Glad you got it to work! Okay, I understand now what is going on. When you are acting on behalf of a AI unit you need to remember to use System - Wait constantly because you are putting on an automated show just do it in between decisions, attacks, movement all of them so you get an effect like your watching something happen. Also put the "Scroll-to" behavior on all your AI and when it is that unit's turn flip behavior enabled on so your camera will leap around to the current computer unit acting. Tell me if you have any more questions.


Thank you for replying! You are correct I have to use the "System Wait" but using it in a loop results in unwanted behavior and recursive looping was not any better. There must be something I'm missing. Your suggestion with the camera is very good I need to implement it later.. right now the map is just one screen. I have not had the time to continue my game project in a while. The "Every X seconds" approach did not work fully but I have to work on it.
B
2
Posts: 8
Reputation: 166

Post » Thu Aug 10, 2017 5:53 pm

Sweet, I think I finally got it working. doAI function is called every X seconds and within the doAI function all the checking for attacking and moving is done for the currently picked AI unit. A variable value gets incremented by 1 after every doAI function completed. This allows the picking of the next AI unit, after the "Every X seconds" fires again, with the help of the array of unit UIDs. p2_units.At(increment)
B
2
Posts: 8
Reputation: 166

Previous

Return to How do I....?

Who is online

Users browsing this forum: 25games, brunopalermo and 9 guests