You are on page 1of 8

namespace = lost_empire_events

#This civic is designed to hook into the Origins "Lost Colony" events, without the
need to make each of the same-species countries use a civic, and also allowing
"lost" primitive colonies

# Initial detection/set up of Enclave Colony world


country_event = {
id = lost_empire_events.11
hide_window = yes
is_triggered_only = yes

trigger = { has_valid_civic = civic_fallen_survivors }

immediate = {

set_country_flag = lost_empire_home

#Flags secondary planet


if = {
limit = {
has_country_flag = there_is_only_war
}
capital_scope.solar_system = {
random_system_planet = {
limit = {
has_planet_flag = planet_mars
}
set_planet_flag = secondary_planet
}
}
}
else = {
capital_scope.solar_system = {
random_system_planet = {
limit = {
is_capital = no
}
set_planet_flag = secondary_planet
}
}
}

#Turns one homeworld moon into a "Dead World" habitat colony


capital_scope = {
random_moon = {
change_pc = pc_arctic
create_colony = {
owner = ROOT
species = root.owner
}
generate_start_buildings_and_blockers = yes
every_tile = {
limit = { has_building = building_colony_shelter }
remove_building = yes
}
if = {
limit = {
has_planet_flag = planet_luna
}
set_name = Luna
set_planet_entity = { entity =
"realsol_new_moon_entity" }
}
else = {
random_list = {
10 = { set_planet_entity = { entity =
"barren_planet_01_entity" } }
10 = { set_planet_entity = { entity =
"barren_planet_02_entity" } }
10 = { set_planet_entity = { entity =
"barren_planet_03_entity" } }
10 = { set_planet_entity = { entity =
"cold_barren_planet_01_entity" } }
10 = { set_planet_entity = { entity =
"cold_barren_planet_02_entity" } }
10 = { set_planet_entity = { entity =
"cold_barren_planet_03_entity" } }
}
}
}
}
}
}

# Creates Enclave Colony and sets it as the Capital

country_event = {
id = lost_empire_events.12
hide_window = yes
is_triggered_only = yes

trigger = {
has_valid_civic = civic_fallen_survivors
}

immediate = {
if = {
limit = {
has_country_flag = there_is_only_war
}
random_country = {
limit = {
is_country_type = enclave
has_valid_civic = civic_ancient_preservers
}
save_event_target_as = lost_empire_enclave
owner_species = { save_event_target_as = enclave_species }
}
}
else = {
random_country = {
limit = {
is_country_type = enclave
NOR = {
has_valid_civic = civic_ancient_preservers
has_country_flag = already_used_LE
}
}
save_event_target_as = lost_empire_enclave
owner_species = { save_event_target_as = enclave_species }
set_country_flag = already_used_LE
}
}
capital_scope.solar_system = {
random_system_planet = {
limit = {
has_planet_flag = secondary_planet
}
change_pc = pc_nuked
create_colony = {
owner = event_target:lost_empire_enclave
species = event_target:enclave_species
}
reset_start_buildings_and_blockers_post_apoc = yes
if = {
limit = {
has_planet_flag = planet_mars
}
set_name = Mars
set_planet_entity = { entity =
"barren_planet_new_mars_entity" }
}

}
}
event_target:lost_empire_enclave = {
establish_communications_no_message = root
establish_contact = { who = root }
}
}
}

# Makes all species of HUM class into subspecies of the owners of earth

country_event = {
id = lost_empire_events.13
hide_window = yes
is_triggered_only = yes

trigger = {
any_owned_pop = {
OR = {
species_portrait = human_mechanicum
species_portrait = human_ogryn_01
species_portrait = humanoid_hp_02
species_portrait = humanoid_hp_11
species_portrait = humanoid_hp_01
species_portrait = humanhive
species_portrait = human_olamic
}
}
}
immediate = {

#Find Earth
random_system = {
limit = { has_star_flag = sol }
random_system_planet = {
limit = { has_planet_flag = planet_earth }
save_event_target_as = origins_earth_home
owner = {
set_country_flag = origins_earth_owner
set_country_flag = colony_home_empire
owner_species = { save_event_target_as =
origins_earth_owner }
}
}
}

#Make Primary Species into Human Subspecies

random_owned_pop = {
limit = {
is_same_species = owner_species
OR = {
species_portrait = human_mechanicum
species_portrait = human_ogryn_01
species_portrait = humanoid_hp_02
species_portrait = humanoid_hp_11
species_portrait = humanoid_hp_01
species_portrait = humanhive
species_portrait = human_olamic
}
}
species = {
set_species_identity = event_target:origins_earth_owner
save_event_target_as = earth_colony_species
}
}

every_owned_pop = {
limit = { is_same_species = owner_species }
change_species = event_target:earth_colony_species
}

every_owned_leader = {
limit = { is_same_species = owner_species }
change_species = event_target:earth_colony_species
}

every_pool_leader = {
limit = { is_same_species = owner_species }
change_species = event_target:earth_colony_species
}

set_country_flag = country_homeworld_created

change_dominant_species = { species = event_target:earth_colony_species


}

#Make Syncretic Secondary Species into Human Subspecies

random_owned_pop = {
limit = {
has_trait = trait_syncretic_proles
NOT = { is_same_species = owner_species }
OR = {
species_portrait = human_mechanicum
species_portrait = human_ogryn_01
species_portrait = humanoid_hp_02
species_portrait = humanoid_hp_11
species_portrait = humanoid_hp_01
species_portrait = humanhive
species_portrait = human_olamic
}
}
species = {
set_species_identity = event_target:origins_earth_owner
save_event_target_as = earth_colony_proles_species
}
}

every_owned_pop = {
limit = {
has_trait = trait_syncretic_proles
NOT = { is_same_species = owner_species }
OR = {
species_portrait = human_mechanicum
species_portrait = human_ogryn_01
species_portrait = humanoid_hp_02
species_portrait = humanoid_hp_11
species_portrait = humanoid_hp_01
species_portrait = humanhive
species_portrait = human_olamic
}
}
change_species = event_target:earth_colony_proles_species
}

#Make Codominant Secondary Species into Human Subspecies - done


separately so that if you're using a mod that allows for both they remnain
separated

random_owned_pop = {
limit = {
NOR = {
has_trait = trait_syncretic_proles
is_same_species = owner_species
}
OR = {
species_portrait = human_mechanicum
species_portrait = human_ogryn_01
species_portrait = humanoid_hp_02
species_portrait = humanoid_hp_11
species_portrait = humanoid_hp_01
species_portrait = humanhive
species_portrait = human_olamic
}
}
species = {
set_species_identity = event_target:origins_earth_owner
save_event_target_as = earth_colony_proles_species
}
}

every_owned_pop = {
limit = {
NOR = {
has_trait = trait_syncretic_proles
is_same_species = owner_species
}
OR = {
species_portrait = human_mechanicum
species_portrait = human_ogryn_01
species_portrait = humanoid_hp_02
species_portrait = humanoid_hp_11
species_portrait = humanoid_hp_01
species_portrait = humanhive
species_portrait = human_olamic
}
}
change_species = event_target:earth_colony_proles_species
}
}
}

# Creates primitives of the LE species, flags any default empires using the LE
species for Origins Lost Colony events
country_event = {
id = lost_empire_events.14
hide_window = yes
is_triggered_only = yes

trigger = {
has_valid_civic = civic_fallen_survivors
}

immediate = {

owner_species = { save_event_target_as = LE_species }

#Changes many primitives to the lost empire species, to represent the


left-behind colonists
every_country = {
limit = {
is_country_type = primitive
}
if = {
limit = {
event_target:LE_species = { is_exact_same_species =
event_target:baseline_human_species }
}
random_list = {
70 = { }
30 = {
modifier = {
factor = 0
OR = {
owner_species =
{ is_exact_same_species = event_target:aeldari_species }
owner_species =
{ is_exact_same_species = event_target:ork_species }
}
}
change_dominant_species = {
species =
event_target:baseline_human_species
change_all = yes
}
set_country_flag = lost_colony_events_country
randomize_flag_symbol = human_survivors
}
}
}
else = {
random_list = {
80 = { }
20 = {
modifier = {
factor = 0
OR = {
owner_species =
{ is_exact_same_species = event_target:baseline_human_species }
owner_species =
{ is_exact_same_species = event_target:aeldari_species }
owner_species =
{ is_exact_same_species = event_target:ork_species }
}
}
change_dominant_species = {
species = event_target:LE_species
change_all = yes
}
set_country_flag = lost_colony_events_country
}
}
}
}

#finds other civilizations in the galaxy with the same owning species
and flags them as "Lost Colonies" for the purposes of Origins events

every_country = {
limit = {
owner_species = { is_same_species = event_target:LE_species
}
NOT = { has_country_flag = lost_empire_home }
NOT = { is_country_type = primitive }
}
if = {
limit = {
owner_species = { is_same_species =
event_target:baseline_human_species}
}
set_country_flag = human_colony_start_country
}
else = {
set_country_flag = xenos_colony_start_country
}
}

#re-run the Lost Colony start up events, to pick up on the new flags
etc
country_event = { id = cbshing_origins_colony_start.1 days = -1 }
country_event = { id = cbshing_origins_colony_of_earth_start.1 days =
-1 }
}
}

You might also like