Okay this is a little list im working on where im trying to come up with all the different situations based on the variables at the top of the descr_campaign_ai_db.xml file. This is a work in progress, and once i've worked out them all, or a good amount, ill try to work out how the ai should behave in each situation, and code it all into the file.

Here are the variables(its a long list):
Code:
				<min_entry											:: The minimum threshold for decision comparison
							frontline_balance="0.0"					:: ratio of factions frontline military strength vs the target
							military_balance="0.0"					:: ratio of factions overall military strength vs the target
							production_balance="0.0"				:: ratio of factions overall production strength vs the target
							target_num_enemies="0"					:: the number of enemies the target has
							num_enemies="0"							:: the number of enemies the faction has
							has_alliance_against="false"			:: is the faction part of an alliance against target
							military_balance_plus_enemies="0.0"		:: ratio of factions overall military strength vs the target (plus all of its enemies)
							alliance_military_balance="0.0"			:: ratio of factions (plus its allies) overall military strength vs the target
							strongest_neighbour="false"				:: is the target the factions strongest neighbour
							most_desirable="false"					:: is the traget the factions most desirable target
							faction_standing="-1.0"					:: how much does the faction like the target
							target_global_standing="-1.0"			:: how trustworthy is the target to the rest of the world
							target_faction_standing="-1.0"			:: how much does the target faction like this faction
							global_standing="-1.0"					:: how trustworthy is this faction to the rest of the world
							target_religion="catholic"				:: the religion of the target (see descr_religions.txt)
							enemy_excommunicated="false"			:: is the target excommunicated
							num_turns_allied="0"					:: the number of turns since the faction agreed to an alliance with the target
							num_turns_ceasfire="0"					:: the number of turns since the faction has agreed to a ceasefire with the target (-1 for no agreement)
							stance="Allied"							:: diplomatic stance with the target (Allied, Neutral, AtWar)
							target_faction="england"				:: target faction label (see descr_sm_factions.txt)
							target_human="false"					:: is the target a human player
							target_is_shadow="false"/>				:: is the target this factions shadow faction
							turn_number="0"							:: the game turn number (starting at 0)
							is_protectorate="false"					:: is the target our protectorate
							is_protectorate_of_catholic="false"		:: is the target a protectorate of a non-excommunicated catholic faction
							free_strength_balance="0.0"				:: ratio of factions free military strength vs the target
							borders_all_our_regions="false"			:: does the target border on all the factions region groups
							target_weakest_neighbour="false"		:: is the faction the targets weakest neighbour
							has_ceasehostilities="false"			:: does the faction have a cease hostilities mission against the target from the papal faction
							is_neighbour="false"					:: does the target neighbour on any of the factions regions
							trusted_ally="false"					:: is the target a trusted ally (they like us more than fs_thresh, and their global standing > gs_thresh, and they are allied)
							trusted_ally_enemy="false"				:: is the target an enemy of a trusted ally
							trusted_ally_protectorate="false"		:: is the target a protectorate of a trusted ally
							num_settlements="0"						:: how many settlements does the faction own
							
				<max_entry											:: The maximum threshold for decision comparison
							frontline_balance="999.0"
							military_balance="999.0"
							production_balance="999.0"
							target_num_enemies="999"
							num_enemies="999"
							has_alliance_against="true"
							military_balance_plus_enemies="999.0"
							alliance_military_balance="999.0"
							strongest_neighbour="true"
							most_desirable="true"
							faction_standing="1.0"
							target_global_standing="1.0"
							target_faction_standing="1.0"
							global_standing="1.0"
							target_religion="heretic"
							enemy_excommunicated="true"
							num_turns_allied="999"
							num_turns_ceasfire="999"
							stance="AtWar"
							target_faction="slave"
							target_human="true"
							target_is_shadow="true"/>
							is_protectorate="true"
							is_protectorate_of_catholic="true"
							free_strength_balance="999.0"
							borders_all_our_regions="true"
							target_weakest_neighbour="true"
							has_ceasehostilities="true"
							is_neighbour="true"
							trusted_ally="true"
							trusted_ally_enemy="true"
							trusted_ally_protectorate="true"
							num_settlements="999"
							
				<faction_attitude									:: A list of modifiers to apply if min and max entries above are successful
									defense="defend_normal"			:: The long term defense type (defend_minimal, defend_normal, defend_raid, defend_frontline, defend_fortified, defend_deep)
									defend_priority="0"				:: The defensive priority of achieving stance against this faction (NOT USED AT PRESENT)
									invade="invade_none"			:: The long term invade type (invade_buildup, invade_immediate, invade_raids, invade_opportunistic, invade_start, invade_none)
									invade_priority="0"				:: priority of achieving invasion against this faction
									at_war="false"					:: are we at war with this enemy
									want_peace="false"				:: do we want to be at peace with this faction
									want_ally="false"				:: do we want to ally with this faction
									want_be_protect="false"			:: do we want to be a protectorate of this faction
									want_offer_protect="false"		:: do we want to offer protectorate status to this nation
									force_invade="false"			:: must we invade now
									alliance_against="0"			:: how much do we want to have an alliance against this nation
									pts_desire="0"					:: points total for measuring our desire for this faction's territory
									pts_alliance="0"				:: points total for measuring how much we want to be allies with these people
									can_force_invade="true"			:: can naval or forced invasion settings overwrite invade parameters
			</decision_entry>
So as you can see im going to have my work cut out working out all the different possible variations for situations, and then to code it all in. Any help would be most appreicated.