Planet Modifiers not working for Custom Solar System

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

Stargate00001

Second Lieutenant
115 Badges
May 28, 2011
178
18
  • Victoria 2: Heart of Darkness
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Ship Simulator Extremes
  • Sword of the Stars
  • Sword of the Stars II
  • Supreme Ruler: Cold War
  • Europa Universalis IV: Mare Nostrum
  • The Showdown Effect
  • Victoria 2
  • Victoria 2: A House Divided
  • March of the Eagles
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Warlock 2: The Exiled
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - After Dark
  • Cities: Skylines Deluxe Edition
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis IV: Pre-order
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Darkest Hour
  • Arsenal of Democracy
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • 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
  • Ancient Space
  • Dungeonland
  • Europa Universalis III
  • Stellaris
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Leviathan: Warships
  • Magicka
I want to add "weak magnetic field" and "mineral rich" to Mars and "hazardous weather" to Earth so I created a mini mod that would add a new Solar System. Everything checks out but I'm having a lot of trouble with adding planetary modifiers.

Here's what my code looks like:
Code:
    planet = {
        name = "NAME_Earth"
        class = "pc_ocean"
        orbit_distance = 25
        orbit_angle = 120
        size = 16
        has_ring = no
        entity = "continental_planet_earth2_entity"
        tile_blockers = none
        flags = { planet_earth }
        init_effect = {
            prevent_anomaly = yes
        }
       
        init_effect = {
            add_modifier = {
                modifier = "hazardous_weather"
                days = -1
            }
        }  
       
        planet_modifier = "pm_hazardous_weather"
       
        moon = {
            name = "NAME_Luna"
            class = "pc_barren_cold"
            size = 5
            orbit_distance = 12
            orbit_angle = 40
            has_ring = no
            entity = "cold_barren_planet_luna_entity"
        }
    }
   
    planet = {
        name = "NAME_Mars"
        class = "pc_continental"
        orbit_distance = 25
        orbit_angle = 60
        size = 18
        has_ring = no
        starting_planet = yes
        entity = "green_mars_entity"
        tile_blockers = none
        init_effect = {
            generate_start_buildings_and_blockers = yes
        }
       
        init_effect = {
            add_modifier = {
                modifier = "mineral_rich"
                days = -1
            }
        }
       
        init_effect = {
            add_modifier = {
                modifier = "weak_magnetic_field"
                days = -1
            }
        }
       
        planet_modifier = "pm_mineral_rich"
        planet_modifier = "pm_weak_magnetic_field"
    }

I launched the game earlier with "planet_modifier = "pm_weak_weak_magnetic_field" immediately after the first "init_effect" in the Mars section like so:
Code:
   planet = {
        name = "NAME_Mars"
        class = "pc_continental"
        orbit_distance = 25
        orbit_angle = 60
        size = 18
        has_ring = no
        starting_planet = yes
        entity = "green_mars_entity"
        tile_blockers = none
        init_effect = {
            generate_start_buildings_and_blockers = yes
        }
       
        init_effect = {
            add_modifier = {
                modifier = "mineral_rich"
                days = -1
            }
        }

        planet_modifier = "pm_mineral_rich"
       
        init_effect = {
            add_modifier = {
                modifier = "weak_magnetic_field"
                days = -1
            }
        }
       
        planet_modifier = "pm_weak_magnetic_field"
    }

What's odd is that when I launched the game with the bottom block of code, the Hazardous Weather modifier showed up on Earth but none of the modifiers showed up on Mars. When I tried switching to the first block of code (and I only modified the Mars section, didn't touch the Earth section) and relaunched the game, the modifiers weren't showing up on Mars (as before) AND the hazardous weather modifier had been removed from Earth.

I'm really stumped on this one. When I tried launching without the "planet_modifier" lines, the modifiers would show up but wouldn't list an icon, name, effect, or description. I've searched online to see how modifiers are done and I've looked in the planet modifiers file as well as the base prescripted solar system initialization file and I can't find how to do modifiers correctly.

Can someone please help me out here?
 

Courageous

Sergeant
43 Badges
Jan 1, 2011
66
0
  • Crusader Kings II
  • Europa Universalis IV
  • Rome: Vae Victis
  • Crusader Kings III: Royal Edition
  • Cities: Skylines
  • Pillars of Eternity
  • Cities: Skylines - After Dark
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Knights of Honor
  • Age of Wonders III
  • Stellaris: Humanoids Species Pack
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Sign Up
  • Age of Wonders: Planetfall - Revelations
  • Crusader Kings III
  • Supreme Ruler 2020
  • Victoria 2
  • Arsenal of Democracy
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Stellaris: Apocalypse
  • Hearts of Iron III
  • Heir to the Throne
  • Stellaris: Synthetic Dawn
  • Lead and Gold
  • The Kings Crusade
  • Majesty 2
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Ship Simulator Extremes
  • Sword of the Stars
I think you may have gotten your answer already, but read through common/on_actions/00_on_actions.txt, and check the various on_game_start, and on_game_start_colony actions. Basically, the game is overwriting some of what you do. IIRC.