tr_est_archivist_adopt = {
	modifier = {
		ship_anomaly_generation_chance_mult = 0.20
	}
}

tr_est_archivist_finish = {
	custom_tooltip = tr_est_archivist_finish_desc

	modifier = {
		ascension_perks_add = 1
	}
}


tr_est_archivist_1 = {
	custom_tooltip = tr_est_archivist_1_desc
	
	on_enabled = {
		every_owned_planet = {
			planet_event = {
				id = est_archivist.1
			}
		}
	}

	modifier = {
		station_observers_unity_produces_add = 5
		station_observer_missions_society_research_produces_mult = 0.50
	}
	
	tradition_swap = {
		name = tr_est_archivist_1_purifier
		inherit_effects = no
		inherit_icon = no
		inherit_name = no
		trigger = {
			OR = {
				has_civic = civic_fanatic_purifiers
				has_civic = civic_machine_terminator
				has_civic = civic_hive_devouring_swarm
			}
		}	
		modifier = {		
			army_damage_mult = 0.15
			ship_weapon_damage = 0.05
		}
		weight = { factor = 1 }
	}

	ai_weight = { factor = 5000 }
}

tr_est_archivist_2 = {
	custom_tooltip = tr_est_archivist_2_desc
	
	on_enabled = {
		every_owned_leader = {
			limit = {
				leader_class = scientist
			}
			random_list = {
				3 = {}
				1 = {
					random_list = {
						1 = { 
							add_trait = leader_trait_scientist_est_librarian_astronomy 
							root = {
								if = {
									limit = {
										Not = {
											has_modifier = mod_est_archivist_2_astronomy
										}
									}
									add_modifier = {
										modifier = mod_est_archivist_2_astronomy
										days = -1
									}
								}
							}
						}
						1 = { 
							add_trait = leader_trait_scientist_est_librarian_mathematics 
							root = {
								if = {
									limit = {
										Not = {
											has_modifier = mod_est_archivist_2_mathematics
										}
									}
									add_modifier = {
										modifier = mod_est_archivist_2_mathematics
										days = -1
									}
								}
							}
						}
						1 = { 
							add_trait = leader_trait_scientist_est_librarian_electronics
							root = {
								if = {
									limit = {
										Not = {
											has_modifier = mod_est_archivist_2_electronics
										}
									}
									add_modifier = {
										modifier = mod_est_archivist_2_electronics
										days = -1
									}
								}
							} 
						}
						1 = { 
							add_trait = leader_trait_scientist_est_librarian_software 
							root = {
								if = {
									limit = {
										Not = {
											has_modifier = mod_est_archivist_2_software 
										}
									}
									add_modifier = {
										modifier = mod_est_archivist_2_software 
										days = -1
									}
								}
							}
						}
						1 = { 
							add_trait = leader_trait_scientist_est_librarian_history 
							root = {
								if = {
									limit = {
										Not = {
											has_modifier = mod_est_archivist_2_history 
										}
									}
									add_modifier = {
										modifier = mod_est_archivist_2_history 
										days = -1
									}
								}
							}
						}
						1 = { 
							add_trait = leader_trait_scientist_est_librarian_taxonomy 
							root = {
								if = {
									limit = {
										Not = {
											has_modifier = mod_est_archivist_2_taxonomy
										}
									}
									add_modifier = {
										modifier = mod_est_archivist_2_taxonomy
										days = -1
									}
								}
							}
						}
						1 = { 
							modifier = {
								factor = 0
								root = {
									has_civic = civic_fanatic_purifiers
								}
							}
							add_trait = leader_trait_scientist_est_librarian_culture 
							root = {
								if = {
									limit = {
										Not = {
											has_modifier = mod_est_archivist_2_culture 
										}
									}
									add_modifier = {
										modifier = mod_est_archivist_2_culture 
										days = -1
									}
								}
							}
						}
						1 = { 
							modifier = {
								factor = 0
								root = {
									OR = {
										has_civic = civic_fanatic_purifiers
										has_civic = civic_inwards_perfection
									}
								}
							}
							add_trait = leader_trait_scientist_est_librarian_communication
							root = {
								if = {
									limit = {
										Not = {
											has_modifier = mod_est_archivist_2_communication
										}
									}
									add_modifier = {
										modifier = mod_est_archivist_2_communication
										days = -1
									}
								}
							}
						}
						1 = { 
							modifier = {
								factor = 0
								root = {
									Not = {
										has_civic = civic_fanatic_purifiers
									}
								}
							}
							add_trait = leader_trait_scientist_est_librarian_war
							root = {
								if = {
									limit = {
										Not = {
											has_modifier = mod_est_archivist_2_war
										}
									}
									add_modifier = {
										modifier = mod_est_archivist_2_war
										days = -1
									}
								}
							}
						}
						1 = { 
							add_trait = leader_trait_scientist_est_librarian_chemistry 
							root = {
								if = {
									limit = {
										Not = {
											has_modifier = mod_est_archivist_2_chemistry 
										}
									}
									add_modifier = {
										modifier = mod_est_archivist_2_chemistry 
										days = -1
									}
								}
							}
						}
						1 = { 
							add_trait = leader_trait_scientist_est_librarian_geology 
							root = {
								if = {
									limit = {
										Not = {
											has_modifier = mod_est_archivist_2_geology 
										}
									}
									add_modifier = {
										modifier = mod_est_archivist_2_geology 
										days = -1
									}
								}
							}
						}
						1 = { 
							add_trait = leader_trait_scientist_est_librarian_architecture
							root = {
								if = {
									limit = {
										Not = {
											has_modifier = mod_est_archivist_2_architecture
										}
									}
									add_modifier = {
										modifier = mod_est_archivist_2_architecture
										days = -1
									}
								}
							} 
						}
						1 = { 
							add_trait = leader_trait_scientist_est_librarian_mechanics 
							root = {
								if = {
									limit = {
										Not = {
											has_modifier = mod_est_archivist_2_mechanics 
										}
									}
									add_modifier = {
										modifier = mod_est_archivist_2_mechanics 
										days = -1
									}
								}
							}
						}
					}
				}
			}
		}
		every_pool_leader = {
			limit = {
				leader_class = scientist
			}
			random_list = {
				3 = {}
				1 = {
					random_list = {
						1 = { add_trait = leader_trait_scientist_est_librarian_astronomy }
						1 = { add_trait = leader_trait_scientist_est_librarian_mathematics }
						1 = { add_trait = leader_trait_scientist_est_librarian_electronics }
						1 = { add_trait = leader_trait_scientist_est_librarian_software }
						1 = { add_trait = leader_trait_scientist_est_librarian_history }
						1 = { add_trait = leader_trait_scientist_est_librarian_taxonomy }
						1 = { 
							modifier = {
								factor = 0
								root = {
									has_civic = civic_fanatic_purifiers
								}
							}
							add_trait = leader_trait_scientist_est_librarian_culture 
						}
						1 = { 
							modifier = {
								factor = 0
								root = {
									OR = {
										has_civic = civic_fanatic_purifiers
										has_civic = civic_inwards_perfection
									}
								}
							}
							add_trait = leader_trait_scientist_est_librarian_communication
						}
						1 = { 
							modifier = {
								factor = 0
								Not = {									
									root = {
										has_civic = civic_fanatic_purifiers
									}
								}
							}
							add_trait = leader_trait_scientist_est_librarian_war
						}
						1 = { add_trait = leader_trait_scientist_est_librarian_chemistry }
						1 = { add_trait = leader_trait_scientist_est_librarian_geology }
						1 = { add_trait = leader_trait_scientist_est_librarian_architecture }
						1 = { add_trait = leader_trait_scientist_est_librarian_mechanics }
					}
				}
			}
		}
	}
	
	tradition_swap = {
		custom_tooltip = tr_est_archivist_2_GC_desc
		
		name = tr_est_archivist_2_GC
		inherit_effects = no
		inherit_icon = yes
		inherit_name = no
		trigger = {
			has_ethic =	ethic_gestalt_consciousness
			is_ai = no
		}	
		on_enabled = {
			every_owned_leader = {
				limit = {
					leader_class = scientist
				}
				random_list = {
					3 = {}
					1 = {
						random_list = {
							1 = { 
								add_trait = leader_trait_scientist_est_keeper_astronomy 
								root = {
									if = {
										limit = {
											Not = {
												has_modifier = mod_est_archivist_2_GC_astronomy
											}
										}
										add_modifier = {
											modifier = mod_est_archivist_2_GC_astronomy
											days = -1
										}
									}
								}
							}
							1 = { 
								add_trait = leader_trait_scientist_est_keeper_mathematics 
								root = {
									if = {
										limit = {
											Not = {
												has_modifier = mod_est_archivist_2_GC_mathematics
											}
										}
										add_modifier = {
											modifier = mod_est_archivist_2_GC_mathematics
											days = -1
										}
									}
								}
							}
							1 = { 
								add_trait = leader_trait_scientist_est_keeper_electronics
								root = {
									if = {
										limit = {
											Not = {
												has_modifier = mod_est_archivist_2_GC_electronics
											}
										}
										add_modifier = {
											modifier = mod_est_archivist_2_GC_electronics
											days = -1
										}
									}
								} 
							}
							1 = { 
								add_trait = leader_trait_scientist_est_keeper_software 
								root = {
									if = {
										limit = {
											Not = {
												has_modifier = mod_est_archivist_2_GC_software 
											}
										}
										add_modifier = {
											modifier = mod_est_archivist_2_GC_software 
											days = -1
										}
									}
								}
							}
							1 = { 
								add_trait = leader_trait_scientist_est_keeper_history 
								root = {
									if = {
										limit = {
											Not = {
												has_modifier = mod_est_archivist_2_GC_history 
											}
										}
										add_modifier = {
											modifier = mod_est_archivist_2_GC_history 
											days = -1
										}
									}
								}
							}
							1 = { 
								add_trait = leader_trait_scientist_est_keeper_taxonomy 
								root = {
									if = {
										limit = {
											Not = {
												has_modifier = mod_est_archivist_2_GC_taxonomy
											}
										}
										add_modifier = {
											modifier = mod_est_archivist_2_GC_taxonomy
											days = -1
										}
									}
								}
							}
							1 = { 
								modifier = {
									factor = 0
									root = {
										Or = {
											has_civic = civic_hive_devouring_swarm
											has_civic = civic_machine_terminator
										}
									}
								}
								add_trait = leader_trait_scientist_est_keeper_culture 
								root = {
									if = {
										limit = {
											Not = {
												has_modifier = mod_est_archivist_2_GC_culture 
											}
										}
										add_modifier = {
											modifier = mod_est_archivist_2_GC_culture 
											days = -1
										}
									}
								}
							}
							1 = { 
								modifier = {
									factor = 0
									root = {
										OR = {
											has_civic = civic_hive_devouring_swarm
											has_civic = civic_machine_terminator
										}
									}
								}
								add_trait = leader_trait_scientist_est_keeper_communication
								root = {
									if = {
										limit = {
											Not = {
												has_modifier = mod_est_archivist_2_GC_communication
											}
										}
										add_modifier = {
											modifier = mod_est_archivist_2_GC_communication
											days = -1
										}
									}
								}
							}
							1 = { 
								modifier = {
									factor = 0
									root = {
										Not = {
											has_civic = civic_hive_devouring_swarm
											has_civic = civic_machine_terminator
										}
									}
								}
								add_trait = leader_trait_scientist_est_keeper_war
								root = {
									if = {
										limit = {
											Not = {
												has_modifier = mod_est_archivist_2_GC_war
											}
										}
										add_modifier = {
											modifier = mod_est_archivist_2_GC_war
											days = -1
										}
									}
								}
							}
							1 = { 
								add_trait = leader_trait_scientist_est_keeper_chemistry 
								root = {
									if = {
										limit = {
											Not = {
												has_modifier = mod_est_archivist_2_GC_chemistry 
											}
										}
										add_modifier = {
											modifier = mod_est_archivist_2_GC_chemistry 
											days = -1
										}
									}
								}
							}
							1 = { 
								add_trait = leader_trait_scientist_est_keeper_geology 
								root = {
									if = {
										limit = {
											Not = {
												has_modifier = mod_est_archivist_2_GC_geology 
											}
										}
										add_modifier = {
											modifier = mod_est_archivist_2_GC_geology 
											days = -1
										}
									}
								}
							}
							1 = { 
								add_trait = leader_trait_scientist_est_keeper_architecture
								root = {
									if = {
										limit = {
											Not = {
												has_modifier = mod_est_archivist_2_GC_architecture
											}
										}
										add_modifier = {
											modifier = mod_est_archivist_2_GC_architecture
											days = -1
										}
									}
								} 
							}
							1 = { 
								add_trait = leader_trait_scientist_est_keeper_mechanics 
								root = {
									if = {
										limit = {
											Not = {
												has_modifier = mod_est_archivist_2_GC_mechanics 
											}
										}
										add_modifier = {
											modifier = mod_est_archivist_2_GC_mechanics 
											days = -1
										}
									}
								}
							}
						}
					}
				}
			}
			every_pool_leader = {
				limit = {
					leader_class = scientist
				}
				random_list = {
					3 = {}
					1 = {
						random_list = {
							1 = { add_trait = leader_trait_scientist_est_keeper_astronomy }
							1 = { add_trait = leader_trait_scientist_est_keeper_mathematics }
							1 = { add_trait = leader_trait_scientist_est_keeper_electronics }
							1 = { add_trait = leader_trait_scientist_est_keeper_software }
							1 = { add_trait = leader_trait_scientist_est_keeper_history }
							1 = { add_trait = leader_trait_scientist_est_keeper_taxonomy }
							1 = { 
								modifier = {
									factor = 0
									root = {
										has_civic = civic_fanatic_purifiers
									}
								}
								add_trait = leader_trait_scientist_est_keeper_culture 
							}
							1 = { 
								modifier = {
									factor = 0
									root = {
										OR = {
											has_civic = civic_fanatic_purifiers
											has_civic = civic_inwards_perfection
										}
									}
								}
								add_trait = leader_trait_scientist_est_keeper_communication
							}
							1 = { 
								modifier = {
									factor = 0
									Not = {									
										root = {
											has_civic = civic_fanatic_purifiers
										}
									}
								}
								add_trait = leader_trait_scientist_est_keeper_war
							}
							1 = { add_trait = leader_trait_scientist_est_keeper_chemistry }
							1 = { add_trait = leader_trait_scientist_est_keeper_geology }
							1 = { add_trait = leader_trait_scientist_est_keeper_architecture }
							1 = { add_trait = leader_trait_scientist_est_keeper_mechanics }
						}
					}
				}
			}
		}
		weight = { factor = 1 }
	}

	tradition_swap = {
		name = tr_est_archivist_2_AI
		inherit_icon = yes
		inherit_name = yes
		trigger = { is_ai = yes }	
		modifier = {		
			all_technology_research_speed = 0.10
		}
		weight = { factor = 1 }
	}

	ai_weight = { factor = 5000 }
}

tr_est_archivist_3 = {
	possible = { has_tradition = tr_est_archivist_2 }
	
	modifier = {
		country_unity_produces_mult = 0.05
		pop_government_ethic_attraction = 0.10
	}
	
	tradition_swap = {
		name = tr_est_archivist_3_GC
		trigger = { is_gestalt = yes }	
		modifier = {		
			country_unity_produces_mult = 0.10
		}
		weight = { factor = 1 }
	}

	ai_weight = { factor = 5000 }
}

tr_est_archivist_4 = {
	custom_tooltip = tr_est_archivist_4_desc
	
	possible = {
		has_tradition = tr_est_archivist_1
		has_tradition = tr_est_archivist_2
	}

	ai_weight = { factor = 5000 }
}

tr_est_archivist_5 = {
	custom_tooltip = tr_est_archivist_5_desc
	
	possible = {
		has_tradition = tr_est_archivist_3
		has_tradition = tr_est_archivist_4
	}
	
	on_enabled = {
		set_timed_country_flag = {
			flag = flag_est_archivist_5_just_adopted
			days = 1
		}
		set_country_flag = est_no_archivist_5_bonus
		set_variable = { 
			which = var_est_archivist_5_count_techs
			value = 0
		}		
		if = {
			limit = { has_technology = tech_colossus }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_pk_cracker }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_pk_shielder }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_pk_neutron }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_pk_godray }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_pk_nanobots }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_gargantuan_evolution }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_lgate_activation }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_lcluster_clue }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_experimental_subspace_navigation }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_neuroregeneration }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_destroyers }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_cruisers }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_battleships }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_titans }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_juggernaut }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_corvette_build_speed }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_corvette_hull_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_corvette_hull_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_destroyer_build_speed }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_destroyer_hull_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_destroyer_hull_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_cruiser_build_speed }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_cruiser_hull_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_cruiser_hull_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_battleship_build_speed }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_battleship_hull_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_battleship_hull_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_titan_hull_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_titan_hull_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_starbase_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_starbase_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_starbase_5 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_habitat_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_habitat_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_habitat_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_modular_engineering }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_space_defense_station_improvement }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_strike_craft_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_strike_craft_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_strike_craft_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_ship_armor_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_ship_armor_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_ship_armor_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_ship_armor_5 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_crystal_armor_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_crystal_armor_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_thrusters_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_thrusters_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_thrusters_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_defense_platform_hull_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_powered_exoskeletons }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_space_mining_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_space_mining_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_space_mining_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_space_mining_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_space_mining_5 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mining_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mining_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mining_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mineral_purification_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mineral_purification_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_alloys_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_alloys_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_advanced_metallurgy_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_advanced_metallurgy_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_luxuries_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_luxuries_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_engineering_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_engineering_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_engineering_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_robotic_workers }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_droid_workers }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_synthetic_workers }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_synthetic_leaders }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_afterburners_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_afterburners_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_assembly_pattern }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_construction_templates }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_housing_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_improved_tile_mineral_output }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_improved_military_station_damage }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_improved_military_station_health }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_improved_armor_output }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_weapon_type_explosive_damage }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_weapon_type_explosive_fire_rate }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_weapon_type_kinetic_damage }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_weapon_type_kinetic_fire_rate }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_weapon_type_strike_craft_fire_damage }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_weapon_type_strike_craft_fire_rate }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mass_drivers_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mass_drivers_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mass_drivers_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mass_drivers_5 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_kinetic_artillery_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_kinetic_artillery_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mass_accelerator_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mass_accelerator_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_autocannons_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_autocannons_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_autocannons_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_flak_batteries_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_flak_batteries_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_missiles_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_missiles_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_missiles_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_missiles_5 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_swarmer_missiles_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_swarmer_missiles_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_torpedoes_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_torpedoes_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_dark_matter_deflector }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_dark_matter_power_core }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_akx_worm_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_akx_worm_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_dragon_armor }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_enigmatic_encoder }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_orbital_trash_dispersal }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_xeno_tourism_agency }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mega_engineering }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_science_nexus }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_sentry_array }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_strategic_coordination }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_interstellar_assembly }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mega_art }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_gateway_activation }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_gateway_construction }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_dyson_sphere }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_matter_decompressor }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_ring_world }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_basic_science_lab_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_basic_science_lab_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_global_research_initiative }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_curator_lab }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_archeology_lab_ancrel }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_archeology_lab }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_space_science_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_space_science_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_space_science_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_space_science_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_space_science_5 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_physics_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_physics_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_physics_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_administrative_ai }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_cryostasis_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_cryostasis_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_self_aware_logic }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_automated_exploration }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_sapient_ai }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_positronic_implants }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_combat_computers_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_combat_computers_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_combat_computers_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_combat_computers_autonomous }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_auxiliary_fire_control }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_synchronized_defences }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_consumer_good_refinement_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_consumer_good_refinement_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_encryption_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_encryption_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_encryption_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_decryption_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_decryption_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_decryption_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_fusion_power }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_cold_fusion_power }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_antimatter_power }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_zero_point_power }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_reactor_boosters_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_reactor_boosters_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_shields_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_shields_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_shields_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_shields_5 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_shield_rechargers_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_planetary_shield_generator }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_sensors_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_sensors_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_sensors_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_power_plant_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_power_plant_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_power_plant_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_power_hub_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_power_hub_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_hyper_drive_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_hyper_drive_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_wormhole_stabilization }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_jump_drive_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_ftl_inhibitor }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_improved_tile_energy_output }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_improved_shield_output }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_weapon_type_energy_damage }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_weapon_type_energy_fire_rate }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_lasers_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_lasers_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_lasers_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_lasers_5 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_energy_lance_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_energy_lance_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_plasma_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_plasma_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_plasma_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_arc_emitter_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_arc_emitter_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_disruptors_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_disruptors_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_disruptors_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_energy_torpedoes_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_energy_torpedoes_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_pd_tracking_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_pd_tracking_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_extradimensional_weapon_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mining_drone_weapon_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_space_trading }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_interstellar_economics }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_galactic_markets }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_prescient_data_modeling }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_eco_simulation }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_gene_crops }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_nano_vitality_crops }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_nutrient_replication }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_hydroponics }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_food_processing_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_food_processing_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_society_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_society_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_society_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_alien_life_studies }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_arcane_deciphering }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_colonization_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_colonization_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_colonization_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_colonization_5 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_tomb_world_adaption }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_frontier_health }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_frontier_hospital }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mountain_range }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_volcano }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_dangerous_wildlife }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_dense_jungle }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_quicksand_basin }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_noxious_swamp }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_massive_glacier }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_toxic_kelp }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_deep_sinkhole }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_terrestrial_sculpting }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_ecological_adaptation }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_climate_restoration }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_genome_mapping }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_vitality_boosters }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_epigenetic_triggers }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_cloning }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_gene_banks }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_gene_seed_purification }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_morphogenetic_field_mastery }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_gene_tailoring }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_glandular_acclimation }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_gene_expressions }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_selected_lineages }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_capacity_boosters }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_regenerative_hull_tissue }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_doctrine_fleet_size_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_doctrine_fleet_size_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_doctrine_fleet_size_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_doctrine_fleet_size_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_doctrine_fleet_size_5 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_interstellar_fleet_traditions }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_refit_standards }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_command_matrix }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_doctrine_navy_size_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_doctrine_navy_size_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_doctrine_navy_size_3 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_doctrine_navy_size_4 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_centralized_command }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_combat_training }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_ground_defense_planning }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_global_defense_grid }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_psionic_theory }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_telepathy }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_precognition_interface }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_thought_enforcement }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_psi_jump_drive_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_galactic_ambitions }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_manifest_destiny }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_interstellar_campaigns }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_galactic_campaigns }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_planetary_unification }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_colonial_centralization }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_galactic_administration }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_planetary_infrastructure_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_planetary_infrastructure_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_subdermal_stimulation }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_tracking_implants }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_global_production_strategy }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_adaptive_bureaucracy }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_effective_bureaucracy }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_colonial_bureaucracy }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_galactic_bureaucracy }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_living_state }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_collective_self }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_autonomous_agents }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_embodied_dynamism }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_neural_implants }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_artificial_moral_codes }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_synthetic_thought_patterns }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_unity_of_purpose }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_collective_production_methods }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_resource_processing_algorithms }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_hyper_entertainment_forum }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_paradise_dome }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_heritage_site }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_hypercomms_forum }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_autocurating_vault }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_holographic_rituals }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_consecration_fields }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_transcendent_faith }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_hive_cluster }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_hive_confluence }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_ascension_theory }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_psionic_barrier }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_psionic_shield }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_penal_colonies }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_resort_colonies }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_slave_colonies }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_housing_agrarian_idyll }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_xeno_diplomacy }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_xeno_relations }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_capital_productivity_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_capital_productivity_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_improved_tile_food_output }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_improved_core_system_cap }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_improved_army_damage }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_improved_army_health }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_improved_leader_life_span }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_naval_cap }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_repeatable_command_limit }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_amoeba_strike_craft_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_swarm_strike_craft_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_scourge_missile_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mine_living_metal }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mine_betharian }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mine_volatile_motes }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_volatile_motes }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mine_exotic_gases }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_exotic_gases }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mine_rare_crystals }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_rare_crystals }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mine_zro }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mine_dark_matter }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_robomodding_m }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_robomodding }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_robomodding_points_1 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_robomodding_points_2 }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_binary_motivators }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_nanite_assemblers }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_mega_assembly }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_adaptive_combat_algorithms }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_biomechanics }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		if = {
			limit = { has_technology = tech_micro_replicators }
			change_variable = { which = var_est_archivist_5_count_techs value = 1 }
		}
		while = {
			limit = {
				check_variable = {
					which = var_est_archivist_5_count_techs 
					value > 3 
				}
			}
			subtract_variable = { 
				which = var_est_archivist_5_count_techs 
				value = 4
			}
			country_event = {
				id = est_archivist.8
			}
		}
	}

	ai_weight = { factor = 5000 }
}