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

-Leonidas-

Sergeant
66 Badges
Apr 28, 2016
85
98
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Jade Dragon
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Third Rome
  • Sengoku
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Holy Fury
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis 4: Emperor
  • Cities: Skylines - Green Cities
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
I'm trying to create a mod that adds more habitable planets and resources to the standard solar starting system in order to make it easier to play tall. While making planets habitable works just fine I can't find a way to add resources. The only tip I could find on the internet looked like this:

Code:
    planet = {
        name = "NAME_3_Juno"
        class = "pc_asteroid"
        orbit_distance = 0
        orbit_angle = 285
        size = 5
        has_ring = no
        init_effect = {
            orbital_deposit_tile = {
            clear_deposits = yes
            add_deposit = d_volatile_motes_5
            add_deposit = d_physics_5
            }
        }
    }

This however doesn't work and no resources are added. In case of planets like Jupiter, that get a random resource, just get a random resource as normal instead of the one I assigned to them. Maybe it's because the thread I found the code it in is from 2016 and the system has been changed since then. Could anyone tell me what is wrong with it or if there is another way to add resources to the starting system?
 
The game will delete all resources from systems that act as empire starts when it initializes them. So you can't do it with a system initializer.

Instead, you have to add the resources manually with an event after the initialization is done, hooked into (for example) the on_game_start on_action. If you add a special star flag to the system during initialization, you can find it very easily via the event system.