Hello!
I'm trying to implement a new mechanic via hidden events, which are linked to a species trait called 'Brood Parasite' (referred to as trait_attractive in the code below).
What I'm trying to do is having a hidden event fire if a a pop with the Brood Parasite trait is on the same planet as a pop of another species that does not have this trait. This event would give the Brood Parasites a bonus to growth, while the other pops would gain a penalty.
A second hidden event would remove this penalty from all pops on the planet once a Brood Parasite is no longer present, while a third hidden event would remove the Parasite's bonus if there are no hosts on its planet.
Anyhoo, this is what the events look like:
The events do not appear to work, and I'm unsure of what I've done wrong. If anyone could help me, I'd be really grateful.
EDIT: Never mind, I solved it!
I'm trying to implement a new mechanic via hidden events, which are linked to a species trait called 'Brood Parasite' (referred to as trait_attractive in the code below).
What I'm trying to do is having a hidden event fire if a a pop with the Brood Parasite trait is on the same planet as a pop of another species that does not have this trait. This event would give the Brood Parasites a bonus to growth, while the other pops would gain a penalty.
A second hidden event would remove this penalty from all pops on the planet once a Brood Parasite is no longer present, while a third hidden event would remove the Parasite's bonus if there are no hosts on its planet.
Anyhoo, this is what the events look like:
Code:
namespace = loneclaw
pop_event = {
id = loneclaw.1
hide_window = yes
trigger = {
planet = {
any_pop = {
pop_has_trait = trait_attractive
NOT = { is_pop = ROOT }
is_enslaved = no
is_being_purged = no
}
NOT = { has_modifier = loneclaw_reduced_reproduction }
NOT = { pop_has_trait = trait_attractive }
is_being_purged = no
is_robot_pop = no
}
mean_time_to_happen = {
months = 1
}
immediate = {
if = {
limit = {
planet = {
any_pop = {
pop_has_trait = trait_attractive
NOT = { is_same_species = root }
is_enslaved = no
is_being_purged = no
}
}
NOT = { has_modifier = loneclaw_reduced_reproduction }
}
planet = {
every_pop = {
limit = {
NOT = { pop_has_trait = trait_attractive }
NOT = { has_modifier = loneclaw_reduced_reproduction }
is_being_purged = no
is_robot_pop = no
}
add_modifier = {
modifier = loneclaw_reduced_reproduction
days = -1
}
}
every_pop = {
limit = {
pop_has_trait = trait_attractive
NOT = { has_modifier = loneclaw_increased_reproduction }
is_enslaved = no
is_being_purged = no
}
add_modifier = {
modifier = loneclaw_increased_reproduction
days = -1
}
}
}
}
}
}
pop_event = {
id = loneclaw.2
hide_window = yes
trigger = {
planet = {
NOT = {
any_pop = {
pop_has_trait = trait_attractive
is_enslaved = no
is_being_purged = no
}
}
}
has_modifier = loneclaw_reduced_reproduction
NOT = { pop_has_trait = trait_attractive }
}
mean_time_to_happen = {
months = 1
}
immediate = {
planet = {
every_pop = {
limit = {
has_modifier = loneclaw_reduced_reproduction
}
remove_modifier = loneclaw_reduced_reproduction
}
}
}
}
pop_event = {
id = loneclaw.3
hide_window = yes
trigger = {
planet = {
any_pop = {
NOT = { pop_has_trait = trait_attractive }
is_being_purged = no
is_robot_pop = no
}
}
has_modifier = loneclaw_increased_reproduction
pop_has_trait = trait_attractive
}
mean_time_to_happen = {
months = 1
}
immediate = {
planet = {
every_pop = {
limit = {
has_modifier = loneclaw_increased_reproduction
}
remove_modifier = loneclaw_increased_reproduction
}
}
}
}
The events do not appear to work, and I'm unsure of what I've done wrong. If anyone could help me, I'd be really grateful.
EDIT: Never mind, I solved it!
Last edited: