I'm having a problem with AI attacking. First a little info about my map / players / map layout. So It's three players: 1 User Player Zerg, 2 Computer Player Terran and 3 Computer Player Zerg. Players 1 and 3 are allied. Map layout little simplified; players 1 is top middle on the map, 2 is left bottom corner and 3 is right bottom corner.
Currently I'm using AI editor to make several different attack waves for player 2. Default Gather Point for players 2 is a point inside Terran base (works just fine) and a waypoint roughly in the middle of the map. All the attack waves have these same points (gather point and a waypoint). In "General" options in AI editor for player 2 target player is set to be only player 3 and not player 1 at all. (2 is still enemy of 1 and 3, set in triggers)
What I'm aiming for is that players 2 would target it's attackwaves to ONLY player 3 until player 3 would be destroyed and then begin attacking players 1 (User Player) Currently what happens is that first attack wave goes to players 3 and all the rest to player 1.
To make it work I created a trigger,
"AI - Set the target for player 2 attack waves to (Copy of ZergPlayerGroup2)" (Players 3 is the only player in this playergroup)
So I hoped this would make 2 attack 3 but it did not work.
I also created a second trigger that would order player 2 to attack player 1 once 3 was destroyed but didn't get that far since the first part don't work.
What I would do is to put a point called "Player 2 attacks here" in player 3's base. Set this point as the target for player 2's waves. Then, add a trigger that moves your "P2 attacks here" point to player 1's base once player 3's base is destroyed.
There may be more elegant solutions, but that should work.
I personally don't use "Copy of Group". Create an integer variable for each player, with the numbers 1-3, one for each player. That should work.
You could use a boolean variable that states something like "Player 3 Destroyed = False" and set the enemy to attack player 1 only when that variable is true, which obviously would be when player 3 is destroyed.
I got this to work by adding a "custom trigger" option on every attack wave in the AI editor / AI attack waves. Each time an attack wave is sent, this trigger makes AI to check if "AI Base Is Destroyed" condition in true or false.