Edit: Most important thing about EE Scenario building is that you CAN'T play a map in Multiplayer if you created it from scratch in the Editor. I never managed a way to work it out. So I am happy if someone can help me. If you want a scenario playable in Multiplayer together with friends you >>> NEEEEEED <<< to modify a save game. That means you start a match with someone, save it, go into the save game folder, "show file extensions", rename it from .ees into .scn and copy paste the file into the scenario folder. You can change everything inside the editor now. Map, # of bots, names and so on. But the amount of real player AND the names of real player ALWAYS STAY! Once you are done you save it, rename it back to .ees and put it into the save game folder. Important thing here is that the player in the lobby are FORCED to have the same name as they had when the map the first time started. Also the same amount. Otherwise you can't start. So before you do anything you have to be sure about the player number and the player names. Those are not changeable (tell me if you know how once you learned it) This is the reason why basically all known scenarios are made with names like: Player1 Player2 Player3 or GREEN, BLOO, PURPLE, YELLOW and so on. If you want, I can give you a 2 player scenario. Player Names are: GREEN and BLOO
Back to your Tutorial:
Just create the base with all the objectives you want the AI to have. (The AI should own it at the beginning)
First we go with the ally system because this one is way easier.
Important: If THIS base switches the allies to players then everything that belongs to that player is switching. So you might want to create some new AI players if you like to have more than just one fort. And just repeat all steps for the others.
I go with the very short one now without explanations this time since you got the last one. (PlayerX = AI Base) The mechanic with the variables can get confusing. Just set up as I say and I explain the meaning later if you don't get it yourself. It's a bit tricky. I hope I get it right.
Effect1: Type: player - Diplomacy - PlayerX - Player 1 - allied
Effect2: Type: player - Diplomacy - PlayerX - Player 2 - allied
Effect3: Type: player - set attribute Level - PlayerX - Variable 0 - exact 20
Effect4: Type: player - Diplomacy - PlayerX - Player 1 - Enemies
Effect5: Type: player - Diplomacy - PlayerX - Player 2 - Enemies
Condition1: Type: Player-Attribute - Player1 - units killed >= Use Player Attribute PlayerX Variable0
Condition2: Type: Player-Attribute - Player2 - units killed >= Use Player Attribute PlayerX Variable0
Trigger1: Trigger ON, Loop, no timer
Condition1
Effect 1 AND Effect 3 AND Effect 5
Trigger2: Trigger ON, Loop, no timer
Condition2
Effect 2 AND Effect 3 AND Effect 4
That should work.
We basically have a Condition1 now that says "If player1 has killed >= (Variable1) of enemies from playerX THAN Player X switches the Team to Player 1 AND and hostile to Player 2. Reverse on condition 2.
The Variable is set to inc. by 20. That means once the "unit kill counter" in Condition1 reaches 20 the effect starts. After that Effect3 says "Inc. the kill counter by 20. So the current counter is 20 and the next goal is 40 kills. +20 next goal 60 kills. But just in steps of 20. This variable thing took me some time to figure out myself.
Without testing I am not 100% sure if it works that way. Last time I used a function like that is quite a while ago. I mostly use simple killcounter and add Stone / Gold / Iron per kill to "buy" units. (love that function) Most of my scenarios are made with it.
Edit: I am not really sure if this works with the variables this way since both player using the same variable. But since you have a kill step of 20 each time it goes off it should be save. And since one of the player is always ally the kill number can't overwrite each other. Having more Actual player or bots then it will be difficult. You need one variable for each player / AI.
EDIT: I forgot to mention that you have to make this ally system for each way. Means PX becomes Ally with P1 AND P1 becomes Ally with PX. After P2 captures that fortress you have to do the same with P2 BUT breaking ally between P1 - Px AND PX - P1 Bit confusing