• 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.

UprootedGrunt

Recruit
8 Badges
Jul 13, 2016
5
0
  • Europa Universalis IV
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Surviving Mars
  • Surviving Mars: Digital Deluxe Edition
  • Prison Architect
I was looking to add some new planet modifiers. I've found the 00_planet_modifiers.txt file, but I'm not sure I'm entirely positive how to make what I want.

The code looks like:
pm_unstable_tectonics = {
spawn_chance = {
modifier = {
add = 10
is_planet_class = "pc_desert"
}
}
modifier = "unstable_tectonics"
}

I did cut out a few more spawn modifiers, but this is enough for my point. It looks like the modifiers are coded somewhere else, and I can't seem to find where (possibly hard-coded?) Trait modifiers are in a list that I can access on the wiki, but I don't see these modifiers there.

Am I missing something, or is this something that just isn't possible?
 
They are in "static_modifiers". Your example is
Code:
unstable_tectonics = {
   pop_environment_tolerance = -0.10
   pop_happiness = -0.05
   tile_resource_engineering_research_mult = 0.20
   
   icon = "gfx/interface/icons/planet_modifiers/pm_unstable_tectonics.dds"
   icon_frame = 3
}
 
Followup, sort of.

I'm trying to add these to a starting system (code below, I hope). I'm also trying to add a vanilla planet trait. For some reason, it seems that I can add the one I'm creating in the mod, but I'm unable to add any vanilla traits to a starting planet. I have tried both with and without the "days = -1" line on the vanilla trait init. I've also tried adding the vanilla without my own (thinking that maybe, with the capital trait, there wasn't enough 'slots' to have both). None of these have had the Mineral Rich trait show up (or a Low G trait on another system).

Can you see anything I'm missing?

Code:
    planet = {
        name = "Altair"
        class = ideal_planet_class
        orbit_distance = {min = 20 max = 50}
        orbit_angle = {min = 90 max = 270}
        size = 16
        starting_planet = yes
        has_ring = no
        tile_blockers = none
        modifiers = none
      
        init_effect = {
            prevent_anomaly = yes
        }
      
        init_effect = {
            random_tile = {
                limit = { has_blocker = no has_building = no num_adjacent_tiles > 3 }
                set_building = "building_capital_1"
                add_resource = {
                    resource = food
                    amount = 1
                    replace = yes
                }  
                add_resource = {
                    resource = minerals
                    amount = 1
                }                  
                random_neighboring_tile = {
                    limit = { has_blocker = no has_building = no }
                    set_building = "building_hydroponics_farm_1"
                    add_resource = {
                        resource = food
                        amount = 1
                        replace = yes
                    }                      
                }
                random_neighboring_tile = {
                    limit = { has_blocker = no has_building = no }
                    set_building = "building_power_plant_1"
                    add_resource = {
                        resource = energy
                        amount = 2
                        replace = yes
                    }                      
                }
                random_neighboring_tile = {
                    limit = { has_blocker = no has_building = no }
                    set_building = "building_power_plant_1"
                    add_resource = {
                        resource = energy
                        amount = 1
                        replace = yes
                    }                      
                }
                random_neighboring_tile = {
                    limit = { has_blocker = no has_building = no }
                    set_building = "building_mining_network_1"
                    add_resource = {
                        resource = minerals
                        amount = 2
                        replace = yes
                    }                      
                }              
            }
            random_tile = {
                limit = { has_blocker = no has_building = no }
                set_blocker = "tb_failing_infrastructure"
                add_resource = {
                    resource = engineering_research
                    amount = 1
                    replace = yes
                }              
            }
            random_tile = {
                limit = { has_blocker = no has_building = no }
                set_blocker = "tb_failing_infrastructure"
                add_resource = {
                    resource = society_research
                    amount = 1
                    replace = yes
                }              
            }
            random_tile = {
                limit = { has_blocker = no has_building = no }
                set_blocker = "tb_failing_infrastructure"
                add_resource = {
                    resource = physics_research
                    amount = 1
                    replace = yes
                }              
            }
            random_tile = {
                limit = { has_blocker = no has_building = no }
                set_blocker = "tb_decrepit_dwellings"
                add_resource = {
                    resource = energy
                    amount = 2
                    replace = yes
                }                  
            }
            random_tile = {
                limit = { has_blocker = no has_building = no }
                set_blocker = "tb_decrepit_dwellings"
                add_resource = {
                    resource = food
                    amount = 1
                    replace = yes
                }                  
            }
            random_tile = {
                limit = { has_blocker = no has_building = no }
                set_blocker = "tb_decrepit_dwellings"
                add_resource = {
                    resource = energy
                    amount = 1
                    replace = yes
                }              
            }
            random_tile = {
                limit = { has_blocker = no has_building = no }
                add_resource = {
                    resource = food
                    amount = 1
                    replace = yes
                }              
            }
        }      
        init_effect= {
            add_modifier = {
              modifier = "ancient_artifacts"
              days = -1 #(-1 for permanent/# for expiring)
            }
        }
      
        init_effect= {
            add_modifier = {
              modifier = "mineral_rich"
            }
        }
      
        change_orbit = @base_moon_distance

        moon = {
            count = { min = 0 max = 1 }
            class = random_non_colonizable
            orbit_angle = { min = 90 max = 270 }
            orbit_distance = 5
        }
    }
 
Might it have something to do with the "modifiers = none" on line 10?

That line is just there to prevent the game from randomly adding a modifier.

As to the planet, try merging all your init_effect sections thusly -
Code:
init_effect= {
   prevent_anomaly = yes
   add_modifier = {
     modifier = "ancient_artifacts"
     days = -1 #(-1 for permanent/# for expiring)
   }
   add_modifier = {
     modifier = "mineral_rich"
     days = -1
   }
}

I've seen entries in the error log about too many separate init_effect so that might be the issue.
 
You're probably going to need to add it with an (silent) event after the game loads, the system setup files can be quirky like that. Just give the planet a flag and limit your event action by has_planet_flag and add all the modifiers you want.
 
I did some testing and I ran into the same issue. It seems you can only reliably add modifiers to planets that aren't in your starting system.
 
I know the exact issue now. It's caused by this event in game_start.txt
Code:
event = {
   id = game_start.2
   hide_window = yes
   is_triggered_only = yes
  
   immediate = {
     every_country = {
       limit = { exists = capital_scope }
       capital_scope = {
         solar_system = {
           every_system_planet = {
             if = {
               limit = { has_modifier = hazardous_weather }
               remove_modifier = hazardous_weather
             }
             if = {
               limit = { has_modifier = dangerous_wildlife }
               remove_modifier = dangerous_wildlife
             }
             if = {
               limit = { has_modifier = weak_magnetic_field }
               remove_modifier = weak_magnetic_field
             }
             if = {
               limit = { has_modifier = strong_magnetic_field }
               remove_modifier = strong_magnetic_field
             }
             if = {
               limit = { has_modifier = unstable_tectonics }
               remove_modifier = unstable_tectonics
             }
             if = {
               limit = { has_modifier = tidal_locked }
               remove_modifier = tidal_locked
             }
             if = {
               limit = { has_modifier = chthonian_planet }
               remove_modifier = chthonian_planet
             }
             if = {
               limit = { has_modifier = asteroid_impacts }
               remove_modifier = asteroid_impacts
             }
             if = {
               limit = { has_modifier = extensive_moon_system }
               remove_modifier = extensive_moon_system
             }
             if = {
               limit = { has_modifier = carbon_world }
               remove_modifier = carbon_world
             }
             if = {
               limit = { has_modifier = wild_storms }
               remove_modifier = wild_storms
             }
             if = {
               limit = { has_modifier = low_gravity }
               remove_modifier = low_gravity
             }
             if = {
               limit = { has_modifier = high_gravity }
               remove_modifier = high_gravity
             }
             #if = {
             #   limit = { has_modifier = hollow_planet }
             #   remove_modifier = hollow_planet
             #}
             if = {
               limit = { has_modifier = mineral_rich }
               remove_modifier = mineral_rich
             }
             if = {
               limit = { has_modifier = ultra_rich }
               remove_modifier = ultra_rich
             }
             if = {
               limit = { has_modifier = mineral_poor }
               remove_modifier = mineral_poor
             }
             if = {
               limit = { has_modifier = titanic_life }
               remove_modifier = titanic_life
             }
             if = {
               limit = { has_modifier = mineral_poor }
               remove_modifier = mineral_poor
             }
             if = {
               limit = { has_modifier = asteroid_belt }
               remove_modifier = asteroid_belt
             }
             if = {
               limit = { has_modifier = natural_beauty }
               remove_modifier = natural_beauty
             }
             if = {
               limit = { has_modifier = atmospheric_aphrodisiac }
               remove_modifier = atmospheric_aphrodisiac
             }
             if = {
               limit = { has_modifier = atmospheric_hallucinogen }
               remove_modifier = atmospheric_hallucinogen
             }
             if = {
               limit = { has_modifier = lush_planet }
               remove_modifier = lush_planet
             }
             if = {
               limit = { has_modifier = bleak_planet }
               remove_modifier = bleak_planet
             }
             if = {
               limit = { has_modifier = irradiated_planet }
               remove_modifier = irradiated_planet
             }
           }
         }
       }
     }
   }
}

You'll need to make a custom "mineral_rich" modifierto bypass this event.