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

Lucre

Second Lieutenant
87 Badges
Mar 19, 2012
144
79
  • Crusader Kings II: Monks and Mystics
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Sword of the Stars
  • Sword of the Stars II
  • Knights of Honor
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Charlemagne
  • Stellaris: Galaxy Edition
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: Pre-order
  • Age of Wonders III
  • Stellaris: Synthetic Dawn
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Tyranny: Archon Edition
  • Cities: Skylines - Snowfall
  • Stellaris
  • Majesty 2 Collection
  • Crusader Kings II
  • 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
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Divine Wind
  • Europa Universalis IV
  • 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
  • Heir to the Throne
  • Magicka
  • Europa Universalis IV: Res Publica
  • Crusader Kings III
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Stellaris: Galaxy Edition
I tried using this language in prescripted_species_systems, within another system initializer:

spawn_system = { initializer = "sys_init_01" }

where sys_init_01 is defined later in the same file.

It crashes.

Just wondering whether there is a way to achieve this effect, or whether it's just something that can't be done.

Lucre
 
I tried using this language in prescripted_species_systems, within another system initializer:

spawn_system = { initializer = "sys_init_01" }

where sys_init_01 is defined later in the same file.

It crashes.

Just wondering whether there is a way to achieve this effect, or whether it's just something that can't be done.

Lucre

I think the safest bet is just to use the neighbor_system to grab a random neighboring generic star system and rewrite it to have the star and planets you want. You can spawn new systems through an event, but I got stuck with it spawning all the new systems in the same location.
 
Thanks for the reply. The problem is that my real reason for asking this question was that I wanted to spawn from a random list of systems. I don't know whether that would even work, but I do know that you can't spawn neighbors from a random list - or at least I never found a way to make it work.
 
Thanks for the reply. The problem is that my real reason for asking this question was that I wanted to spawn from a random list of systems. I don't know whether that would even work, but I do know that you can't spawn neighbors from a random list - or at least I never found a way to make it work.

In your initializer for the neighbor, you could use weighting to have a chance to spawn one of several systems. I don't know if you could use a limit to make it so only one of each of those systems could appear, however. I don't know if it only works inside events, or if you could use inside the start of neighbor initializer, something like:

random_list = {
10 = { initializer1 }
20 = { initializer2 }
70 = {initializer3 }
}

to have a 10 percent chance of system 1, 20 percent 2 and 70 percent 3, for example. If all else fails, you can put an immediate = {} event inside an initializer, then have the planet generation by chance be inside that event.
 
I've gotten the following to work:

Code:
        if = {
            limit = {
                any_system = { has_star_flag = aralahk }
            }
                random_list = {
                    50 = {
                        random_system = {
                            spawn_system = { initializer = "test1_initializer" }      
                        }
                    }
                    50 = {
                        random_system = {
                            spawn_system = { initializer = "test2_initializer" }      
                        }
                    }
                }
        }

inside a startup event. That way, when my race spawns in with its home star flags = { aralahk } there is a 50/50 chance of a random system spawning in as either Dranek or Branek. Unfortunately, I have not had any luck in controlling where it spawns, particularly relative to aralahk. using distance = {min = 5 max = 50} does not work in random_system or spawn_system. in random_system it prevents the system from spawning, whereas in spawn_system it is that distance from a random system it seems.

neighbor_system and any_neighbor_system also do not seem to work.
 
Ok, I have it working overloading game_start.txt game_start.1 with the following code:
Code:
        if = {
            limit = { any_system = { has_star_flag = aralahk }}
            random_system = { limit = { has_star_flag = aralahk }
                random_list = {
                    50 = { spawn_system = { min_distance = 10 max_distance = 30 initializer = "test1_initializer" }}
                    50 = { spawn_system = { min_distance = 10 max_distance = 30 initializer = "test2_initializer" }}
                }
            }
        }

Obviously if you want your mod to be compatible, you will need to make your own separate event to trigger this. The conditional checks if the homeworld exists, then we select that system as the scope, then we randomly spawn a system within a range using one of the initializers.

Your original initializer must contain:
flags = { aralahk }
in this example, for it to be properly flagged to meet the conditional, and then that initializer must be run, normally by having that empire be in the game with that homeworld system initialized.
 
Last edited: