• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Sriseru

Second Lieutenant
82 Badges
Jan 20, 2014
155
136
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Reapers Due
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Mare Nostrum
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Third Rome
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sword of the Stars
  • Stellaris: Synthetic Dawn
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Age of Wonders III
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Victoria 2
  • Hearts of Iron IV: No Step Back
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:
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: