You need to have an array that keeps track of all the units on a team 1 for players and 1 for monsters. for instance x 16 and y 8 z 1 16 slots 8 player vs 8 monster with each 8 variables UID,DoneTurn/TimeUnits,Health,HealthMax,Mana ect ect You should be looping through all of the active teams men to look for DoneTurn variable to see who has a turn still and giving them control at that point. It shouldn't be team changed be until your loop of Player.At(loopindex,2) (2 was DoneTurn in my example of the Y dimension) was COMPLETELY ran out without a single person showing a DoneTurn switch not thrown yet Then you throw all the Doneturn's back to 0 and switch teams.
Thank you for the reply! What you are suggesting is basically what I'm doing. Looping through an array and checking if unit is active. Problem is that the loop goes through so fast... All of the AI unit movement and attacks become a simultaneous mess.
I have been planning the following: Let the loop go through fast, without moving or attacking, but recording all of the AI's decisions into an array, and then "playing" the array like a record with a 1 sec delay between every array entry. I tested a simple version of this and it worked but I noticed there is a major hurdle with this approach... Each AI unit would have to base their decisions on the new "record" instead of the current state visible to the player. I believe I may have to go this route anyway because it would be a nice feature to record all turns for later playback.