Jump to content

Modding Quick Question Thread


Abominus

Recommended Posts

Posted

Greetings,

 

I have this problem:

 


# Latexants Start Anomaly
ship_event = {
    id = latex_ants.2
    title = latex_ants.2.name
    desc = latex_ants.2.desc
    show_sound = event_alien_nature
#    diplomatic = yes
    location = from

    is_triggered_only = yes


#    picture_event_data = {
#        room = fisting_room
#    }

    immediate = {
        FROM = {
            limit = {
                ROOT = {
                    owner_species = {
                        has_trait = trait_pc_nuked_preference
                    }
                }
            }
        change_pc = pc_nuked
        }
        FROM = {
            limit = {
                ROOT = {
                    owner_species = {
                        OR = {
                            has_trait = trait_pc_gaia_preference
                            has_trait = trait_pc_ringworld_habitable_preference
                            has_trait = trait_pc_habitat_preference
                        }
                    }
                }
            }
        change_pc = pc_gaia
        }
        FROM = {
            limit = {
                ROOT = {
                    owner_species = {
                        OR = {
                            has_trait = trait_pc_desert_preference
                            has_trait = trait_pc_arid_preference
                            has_trait = trait_pc_savannah_preference
                        }
                    }
                }
            }
        change_pc = pc_arid
        }
        FROM = {
            limit = {
                ROOT = {
                    owner_species = {
                        OR = {
                            has_trait = trait_pc_tropical_preference
                            has_trait = trait_pc_continental_preference
                            has_trait = trait_pc_ocean_preference
                        }
                    }
                }
            }
        change_pc = pc_tropical
        }
        FROM = {
            limit = {
                ROOT = {
                    owner_species = {
                        OR = {
                            has_trait = trait_pc_tundra_preference
                            has_trait = trait_pc_arctic_preference
                            has_trait = trait_pc_alpine_preference
                        }
                    }
                }
            }
        change_pc = pc_alpine
        }
    }

    option = {
        name = EXCELLENT
        FROM = {
            random_tile = {
                limit = { has_blocker = no }
                set_blocker = tb_cave_system
            }
        }
        leader = {
            add_experience = 200
        }
        owner = {
            add_monthly_resource_mult = {
                resource = society_research
                value = @tier4researchreward
                min = @tier4researchmin
                max = @tier4researchmax
            }
        }
    }
}

 

The event fires, but it does not change the planet, regardless of the trait of my people. Where am I wrong?

 

In the immediate block, I have eg:

 

        FROM = {
            limit = {
                ROOT = {
                    owner_species = {
                        has_trait = trait_pc_nuked_preference
                    }
                }
            }
        change_pc = pc_nuked
        }

 

FROM is the planet, ROOT is the ship, right? How do I scope to the traits of my population?

 

Ah, and the "option" is also blank... gnah.

Posted

Try this:

 

immediate = {
        FROM = {
            limit = {
                owner = {
                    owner_species = {
                        has_trait = trait_pc_nuked_preference
                    }
                }
            }
        change_pc = pc_nuked
        }
        FROM = {
            limit = {
                owner = {
                    owner_species = {
                        OR = {
                            has_trait = trait_pc_gaia_preference
                            has_trait = trait_pc_ringworld_habitable_preference
                            has_trait = trait_pc_habitat_preference
                        }
                    }
                }
            }
        change_pc = pc_gaia
        }
        FROM = {
            limit = {
                owner = {
                    owner_species = {
                        OR = {
                            has_trait = trait_pc_desert_preference
                            has_trait = trait_pc_arid_preference
                            has_trait = trait_pc_savannah_preference
                        }
                    }
                }
            }
        change_pc = pc_arid
        }
        FROM = {
            limit = {
                owner = {
                    owner_species = {
                        OR = {
                            has_trait = trait_pc_tropical_preference
                            has_trait = trait_pc_continental_preference
                            has_trait = trait_pc_ocean_preference
                        }
                    }
                }
            }
        change_pc = pc_tropical
        }
        FROM = {
            limit = {
                owner = {
                    owner_species = {
                        OR = {
                            has_trait = trait_pc_tundra_preference
                            has_trait = trait_pc_arctic_preference
                            has_trait = trait_pc_alpine_preference
                        }
                    }
                }
            }
        change_pc = pc_alpine
        }
    }

ROOT in this context is your ship (I think), so using owner_species under it is doing funky things with the scope.

Posted
1 hour ago, darkspleen said:

Not really sure what else to try.

Na, some day, I will find out, where my error is.


Btw:

 


latexants_start_category = {
    should_ai_use = no
    desc = "latexants_start_category_desc"
    picture = GFX_evt_ship_in_orbit
    level = 2

    max_once_global = yes

    spawn_chance = {
        modifier = {
            add = 3
            uninhabitable_regular_planet = yes
            NOT = { is_asteroid = yes }
        }
        modifier = {
            add = 300
            any_neighbor_system = {
                    any_planet = {
                        is_homeworld = yes
                }
            }
        }
        modifier = {
            factor = 0
            from.owner = {
                AND = {
                    has_authority = auth_machine_intelligence
                    NOT =  { has_civic = civic_machine_servitor }
                }
            }
        }
    }
    
    on_success = latex_ants.2
}

 

This is the anomaly, maybe I made here the fault.

Posted
On 5/28/2018 at 7:04 AM, darkspleen said:

Not really sure what else to try.

    immediate = {
        if = {
            limit = {
                owner_species = {
                    has_trait = trait_pc_nuked_preference
                }
            }
            from = { change_pc = pc_nuked }
        }
        if = {
            limit = {
                owner_species = {
                    OR = {
                        has_trait = trait_pc_gaia_preference
                        has_trait = trait_pc_ringworld_habitable_preference
                        has_trait = trait_pc_habitat_preference
                    }
                }
            }
            from = { change_pc = pc_gaia }
        }
        if = {
            limit = {
                owner_species = {
                    OR = {    
                        has_trait = trait_pc_desert_preference
                        has_trait = trait_pc_arid_preference
                        has_trait = trait_pc_savannah_preference
                    }
                }
            }
            from = { change_pc = pc_arid }
        }
        if = {
            limit = {
                owner_species = {
                    OR = {    
                        has_trait = trait_pc_tropical_preference
                        has_trait = trait_pc_continental_preference
                        has_trait = trait_pc_ocean_preference
                    }
                }
            }
            from = { change_pc = pc_tropical }
        }
        if = {
            limit = {
                owner_species = {
                    OR = {    
                        has_trait = trait_pc_tundra_preference
                        has_trait = trait_pc_arctic_preference
                        has_trait = trait_pc_alpine_preference
                    }
                }
            }
            from = { change_pc = pc_alpine }
        }
    }


THAT worked... :D.

Posted

Next problem:

 


planet_event = {
    id = latex_ants.3
    title = "latex_ants.3.name"
    desc = "latex_ants.3.desc"
    diplomatic = yes
    show_sound = event_default
    location = root
#    is_triggered_only = yes
    
    picture_event_data = {
        room = fitting_1
    }

    trigger = {
        has_owner = yes
        is_homeworld = no
        owner = { 
            NOT = { species_portrait = latexants }
        }
        owner = {
            is_ai = no
        }
        any_tile = {
            has_grown_pop = yes
            any_neighboring_tile = {
                has_blocker = tb_cave_system
            }
        }
    }

    mean_time_to_happen = {
        months = 4
    }

    immediate = {
        random_pop = {
            limit = {
                NOT = { species_portrait = latexants }
                any_neighboring_tile = {
                    has_blocker = tb_cave_system
                }
            }
            kill_pop = yes
        }
        change_variable = {
            which = "latexants_added"
            value = 1
        }
    }

    option = {
        name = latex_ants.3.a
        trigger = {
            NOT = { has_planet_modifier = cave_system_1 }
        }
        add_modifier = {
            modifier = "cave_system_1"
            days = -1
        }
    }

    option = {
        name = latex_ants.3.b
        trigger = {
            has_planet_modifier = cave_system_1
            NOT = { has_planet_modifier = cave_system_2 }
        }
        add_modifier = {
            modifier = "cave_system_2"
            days = -1
        }
    }

    option = {
        name = latex_ants.3.c
        trigger = {
            has_planet_modifier = cave_system_2
            NOT = { has_planet_modifier = cave_system_3 }
        }
        add_modifier = {
            modifier = "cave_system_3"
            days = -1
        }
    }

    option = {
        name = latex_ants.3.d
        trigger = {
            has_planet_modifier = cave_system_3
        }
    }
}

 

I tried that event on the same planet. First one works fine, the "cave_system_1" modifier applied, but the second time I used the event, with the first modifier in place, the option b seems not to work. I got a second cave_system_1 modifier... gnah.

  • 3 weeks later...
Posted

Does anyone know, how to add ascension perks by event?

 

activate_ascension_perk = eap_mastery_of_nature2
add_ascension_perk = ap_engineered_evolution

 

Both doesnt work...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...