Static Galaxies and Prescripted/Custom Empires

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

G33kh4n

Prothy, the Prothean
11 Badges
Jun 22, 2013
32
8
  • Crusader Kings II
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Heir to the Throne
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Victoria 2
  • Europa Universalis IV: Pre-order
Sorry if this is derailing the thread, but here it goes.

I used an init_effect in a system initializer file to spawn a primitive species on a scripted planet. While it does spawn that species as intended, it also renames the planet they're on to something completely random. Why would that be?

Here's the relevant code

Code:
planet = {
        name = "Earth"
        class = "pc_continental"
        orbit_distance = 20
        orbit_angle = 120
        size = 16
        starting_planet = yes
        home_planet = yes
        has_ring = no
        entity = "continental_planet_earth_entity"
        tile_blockers = none
        modifiers = none
      
        init_effect = {
            prevent_anomaly = yes
        }
        init_effect = {
            create_species = {
                        name = Human
                        plural = Humans
                        class = MAM
                        portrait = "human"
                        homeworld = THIS
                        traits = {
                            trait="trait_industrious"
                            trait="trait_natural_engineers"
                            trait="trait_adaptive"
                            trait="trait_intelligent"
                        }
                    }
                    create_country = {
                        name = "Systems Alliance"
                        government="primitive_feudalism"
                        species = last_created_species
                        ethos = {
                            ethic="ethic_inidivualist"
                            ethic="ethic_fanatic_materialist"      
                        }
                        flag = {
                            icon={
                                category="human"
                                file="flag_human_08.dds"
                            }
                            background={
                                category="backgrounds"
                                file="00_solid.dds"
                            }
                            colors={
                                "blue"
                                "black"
                                "null"
                                "null"
                            }
                        }
                        type = primitive
                    }
                    last_created_country = {
                        set_graphical_culture="mammalian_01"
                      
                    }
                    create_colony = {
                        owner = last_created_country
                        species = owner_main_species
                        ethos = owner
                    }
                    create_pop = {
                        species = owner_main_species
                        ethos = owner
                    }
                  
                    create_pop = {
                        species = owner_main_species
                        ethos = owner
                    }
                    create_pop = {
                        species = owner_main_species
                        ethos = owner
        }

            }          
      
        moon = {
            name = "Luna"
            class = "pc_barren_cold"
            size = 5
            orbit_distance = 12
            orbit_angle = 40
            has_ring = no
            entity = "cold_barren_planet_luna_entity"
        }
    }
 

G33kh4n

Prothy, the Prothean
11 Badges
Jun 22, 2013
32
8
  • Crusader Kings II
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Heir to the Throne
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Victoria 2
  • Europa Universalis IV: Pre-order
Is there some way to force hyperlane connection between two specified systems (and remove unwanted ones) or did you just get really lucky with autogeneration algorithm?
Not who you originately asked, but there is a way, yes.

The following line of code can be used in your "setup scenarios" .txt file to add hyperlanes.
Code:
add_hyperlane = { from = "system_x" to = "system_y" }

You can use the following line at the beginning of your scenario file to stop the game from generating random hyperlanes:

Code:
    random_hyperlanes = no
 
  • 3
Reactions:

Axelius

Scriptkid
86 Badges
Sep 23, 2003
585
538
  • War of the Roses
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Sengoku
  • Sword of the Stars
  • Teleglitch: Die More Edition
  • The Showdown Effect
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Warlock: Master of the Arcane
  • March of the Eagles
  • 500k Club
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris: Nemesis
  • Divine Wind
  • 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
  • Dungeonland
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Crusader Kings II
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Leviathan: Warships
Sorry if this is derailing the thread, but here it goes.

I used an init_effect in a system initializer file to spawn a primitive species on a scripted planet. While it does spawn that species as intended, it also renames the planet they're on to something completely random. Why would that be?

Because settled planets are named by the country that settles it, as the country you created don't have a name_list assigned it takes a random planet name from a random name_list.
 
  • 2
Reactions:

poopchute

Sergeant
25 Badges
Dec 19, 2013
89
6
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Cities in Motion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Leviathan: Warships
  • Magicka
  • Stellaris - Path to Destruction bundle
  • Imperator: Rome
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Surviving Mars
  • BATTLETECH
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Way of Life
  • Warlock: Master of the Arcane
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
For those of you trying to create an entire static galaxy, why not just do it exactly as mentioned here, then find out which star system was overwritten by the human player, and then just save edit? move the human player star system to where it is supposed to be and enter in the correct system where the human system spawned. You may need to manually remove and add hyperlanes to avoid oddness.
 

Axelius

Scriptkid
86 Badges
Sep 23, 2003
585
538
  • War of the Roses
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Semper Fi
  • Sengoku
  • Sword of the Stars
  • Teleglitch: Die More Edition
  • The Showdown Effect
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Warlock: Master of the Arcane
  • March of the Eagles
  • 500k Club
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris: Nemesis
  • Divine Wind
  • 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
  • Dungeonland
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Crusader Kings II
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Leviathan: Warships
For those of you trying to create an entire static galaxy, why not just do it exactly as mentioned here, then find out which star system was overwritten by the human player, and then just save edit? move the human player star system to where it is supposed to be and enter in the correct system where the human system spawned. You may need to manually remove and add hyperlanes to avoid oddness.
Because that requires:
1) For you to close the game after starting the game.
2) Manual work
3) Starting up the game again

For most people any of these would be a no-no, even if they knew how to do the 2 part.
 

poopchute

Sergeant
25 Badges
Dec 19, 2013
89
6
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Cities in Motion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Leviathan: Warships
  • Magicka
  • Stellaris - Path to Destruction bundle
  • Imperator: Rome
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Surviving Mars
  • BATTLETECH
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Way of Life
  • Warlock: Master of the Arcane
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
Because that requires:
1) For you to close the game after starting the game.
2) Manual work
3) Starting up the game again

For most people any of these would be a no-no, even if they knew how to do the 2 part.


Only once, by the mod creator, after the rest of their galaxy is made. Once you've already spent dozens of hours making the mod, adding another 15 minutes is next to nothing. For players, all they need to do is download the save file and load it. A bit harder than subscribing to a mod in the Steam Workshop, for sure, but not much.
 

poopchute

Sergeant
25 Badges
Dec 19, 2013
89
6
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Cities in Motion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Leviathan: Warships
  • Magicka
  • Stellaris - Path to Destruction bundle
  • Imperator: Rome
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Surviving Mars
  • BATTLETECH
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Way of Life
  • Warlock: Master of the Arcane
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
Yeah... this block is in an event. And there are a lot more possibilities. Look up special system initializers and crisis events.

Just tested it out. If you add random tile blockers like a normal player has on their own homeworld, it sometimes squashes the pops. So sometimes the AI player - or another human player if you did this for multiplayer - would only have 3 pops to start, for example. Only reasonable workaround seems to be to allow all players to start on a clean 4X4 homeworld. Or use scripting to make sure the pops don't get squashed somehow?

If you set each prescripted species with its own flags, you can shove a call for the initializer into game_start.txt, in game_start.1 if the human player is not playing as that species. Then create the species and government in an init_effect, don't use the create colony. That way, the species can spawn in as AI, in the custom solar system, and have proper 100 percent habitability on their own homeworld.


EDIT: create resources first, then put down the capital building, then the neighbouring buildings, then the tile blockers, then add the pops, and they auto spawn on the best tiles and don't get squashed by the tile blockers.
 

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
@poopchute, in answer to your question about the save edit: it's because it totally breaks immersion to fiddle about with the save game like that. I'm prepared to put work into the front end, so I can start the game the way I want to, but once that game's been started it's untouchable. No save edits, no reloads, nothing. I do see that to edit the save game is technically not much more, but it's actually a world away from the way I want to play.

Also, it wouldn't work for those wanting to create mods for other people. You could hardly include save edit instructions as part of the installation procedure ;-)
 

poopchute

Sergeant
25 Badges
Dec 19, 2013
89
6
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Cities in Motion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Leviathan: Warships
  • Magicka
  • Stellaris - Path to Destruction bundle
  • Imperator: Rome
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Surviving Mars
  • BATTLETECH
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Way of Life
  • Warlock: Master of the Arcane
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
Also, it wouldn't work for those wanting to create mods for other people. You could hardly include save edit instructions as part of the installation procedure ;-)

All people would need to do is download the save file, put it into their saves folder, and load it.

Yes, it is really frustrating that making static galaxies and custom systems for non-player-one's is so difficult. I recently figured out that after you make the custom system for the AI player, you have to manually give them their leaders, starting ships, everything manually. Would be so nice if they could just use the prescripted_species_systems.txt
 
  • 1
Reactions:

Torakka

Colonel
90 Badges
Oct 20, 2010
898
6.103
  • 500k Club
  • Victoria 3 Sign Up
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Call to arms event
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Victoria: Revolutions
  • Pillars of Eternity
Save editing is not really a long term solution as that save (or those saves) would need to be recreated and edited each time there is a new patch, either for the main game or the mod in question.
 
  • 3
Reactions:

G33kh4n

Prothy, the Prothean
11 Badges
Jun 22, 2013
32
8
  • Crusader Kings II
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Heir to the Throne
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Victoria 2
  • Europa Universalis IV: Pre-order
It's not ideal, but you could make the player spawn in and then they use the console to switch to the AI country that theyshould've been. Maybe do some "kill_country" while you're there
 

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
That may be true, but who wants to use the console when playing a game? I only use the console when I'm testing something. I never touch the console during normal games. Its certainly far from ideal, and if that's the only way, then I think the devs need to provide additional options.
 
  • 1
Reactions:

G33kh4n

Prothy, the Prothean
11 Badges
Jun 22, 2013
32
8
  • Crusader Kings II
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Heir to the Throne
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Victoria 2
  • Europa Universalis IV: Pre-order
Oh, I absolutely agree. It's a huge design overlook and the devs should work on it. I'm just saying that the console is the easiest way to go around the restrictions of the game.
 

Kordishal

Second Lieutenant
48 Badges
Jan 3, 2013
113
140
  • Crusader Kings II: Legacy of Rome
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Pre-order
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Majesty 2
  • Magicka
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Art of War
  • Crusader Kings II: The Old Gods
  • Crusader Kings II
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Dungeonland
  • Europa Universalis IV
  • Imperator: Rome Sign Up
  • Stellaris: Megacorp
  • Shadowrun Returns
  • Stellaris: Distant Stars
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Age of Wonders III
  • Stellaris: Ancient Relics
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Warlock: Master of the Arcane
  • Victoria 2
  • Europa Universalis IV: Third Rome
  • Cities: Skylines
Considering that it is at the moment not possible to either place player or AI empires from scripts, other than resorting to the console I decided to simply not try to set up a full galaxy and just have the galaxy and then have pre-scripted nations spawn in it at random locations. Actual scenarios would have to come later when someone figured out how that stuff works and paradox expanded the modifiability...

However I ran into a problem here as well.

Currently I have the entire galaxy filled with pre-scripted systems. Each system has a position and an unique system initializer. Then I have a bunch of pre-scripted empires, each with a special initializer as well. I though this would work to avoid the generator all together, as it is incapable of placing randomly generated and player created empires into my pre-scripted galaxy, on proper planets. (They usually will inhabit gas giants and toxic worlds....)

And in general this works most of the time, but the game will regularly crash when it tries to create the galaxy or if it survives that it will crash sometime after...

The only error message that I get is this:

Code:
[16:41:48][galaxy_generator.cpp:2058]: Could not find starting systems for all empires. Too few systems have spawn_weight!

Does anyone else have this problem? Or know how to add spawn_weight to systems? This seems like it could fix the issue of placing pre-scripted empires, but I have not found any spawn_weight modifier/trigger anywhere...

Edit: And just adding it to the galaxy setup file does not work.
 
Last edited:

G33kh4n

Prothy, the Prothean
11 Badges
Jun 22, 2013
32
8
  • Crusader Kings II
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Heir to the Throne
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Victoria 2
  • Europa Universalis IV: Pre-order
Considering that it is at the moment not possible to either place player or AI empires from scripts, other than resorting to the console I decided to simply not try to set up a full galaxy and just have the galaxy and then have pre-scripted nations spawn in it at random locations. Actual scenarios would have to come later when someone figured out how that stuff works and paradox expanded the modifiability...

However I ran into a problem here as well.

Currently I have the entire galaxy filled with pre-scripted systems. Each system has a position and an unique system initializer. Then I have a bunch of pre-scripted empires, each with a special initializer as well. I though this would work to avoid the generator all together, as it is incapable of placing randomly generated and player created empires into my pre-scripted galaxy, on proper planets. (They usually will inhabit gas giants and toxic worlds....)

And in general this works most of the time, but the game will regularly crash when it tries to create the galaxy or if it survives that it will crash sometime after...

The only error message that I get is this:

Code:
[16:41:48][galaxy_generator.cpp:2058]: Could not find starting systems for all empires. Too few systems have spawn_weight!

Does anyone else have this problem? Or know how to add spawn_weight to systems? This seems like it could fix the issue of placing pre-scripted empires, but I have not found any spawn_weight modifier/trigger anywhere...

I don't know if I misread, but it's definitely possible to spawn in Empires (and primivites) in scripted systems via the System initializerrs.


Code:
tikkun_initializer = {
    name = "Tikkun"
    max_instances = 1
    asteroids_distance = 60
  
    planet = {
        name = "Tikkun"
        class = "pc_k_star"
        orbit_distance = 0
        orbit_angle = 1
        size = 30
        has_ring = no
    }
  
    planet = {
        name =  "Rannoch"
        class = "pc_arid"
        orbit_distance = 30
        orbit_angle = -110
        size = 20
        has_ring = no
      
        init_effect = {
            prevent_anomaly = yes
        }
        init_effect = {
            create_species = {
                        name = Quarian
                        plural = Quarians
                        class = MAM
                        portrait = "human"
                        homeworld = THIS
                        traits = {
                            trait="trait_industrious"
                            trait="trait_natural_engineers"
                            trait="trait_adaptive"
                            trait="trait_intelligent"
                        }
                    }
                    create_country = {
                        name = "Quarian civilization"
                        government="primitive_feudalism"
                        species = last_created_species
                        name_list = "Quarian1"
                        ethos = {
                            ethic="ethic_inidivualist"
                            ethic="ethic_fanatic_materialist"      
                        }
                        flag = {
                            icon={
                                category="special"
                                file="primitive.dds"
                            }
                            background={
                                category="backgrounds"
                                file="new_dawn.dds"
                            }
                            colors={
                                "turquoise"
                                "green"
                                "null"
                                "null"
                            }
                        }
                        type = primitive

                    }
                    last_created_country = {
                        set_graphical_culture= preindustrial_01
                        set_country_flag = iron_age
                        set_primitive_age = iron_age
                    }
                  
                    create_colony = {
                        owner = last_created_country
                        species = owner_main_species
                        ethos = owner
                    }
                    random_tile = {
                        limit = {
                            has_blocker = no
                            has_grown_pop = no
                            has_growing_pop = no
                        }
                        create_pop = {
                            species = last_created
                            ethos = owner
                        }
                    }
                    random_tile = {
                        limit = {
                            has_blocker = no
                            has_grown_pop = no
                            has_growing_pop = no
                        }
                        create_pop = {
                            species = last_created
                            ethos = owner
                        }
                    }
                    random_tile = {
                        limit = {
                            has_blocker = no
                            has_grown_pop = no
                            has_growing_pop = no
                        }
                        create_pop = {
                            species = last_created
                            ethos = owner
                        }
                    }
                    random_tile = {
                        limit = {
                            has_blocker = no
                            has_building = no
                            has_grown_pop = yes
                        }
                        set_building = "building_primitive_farm"
                        add_resource = {
                            resource = food
                            amount = 1
                            replace = yes
                        }
                    }
                    random_tile = {
                        limit = {
                            has_blocker = no
                            has_building = no
                            has_grown_pop = yes
                        }
                        set_building = "building_primitive_farm"
                        add_resource = {
                            resource = food
                            amount = 1
                            replace = yes
                        }
                    }
                    random_tile = {
                        limit = {
                            has_blocker = no
                            has_building = no
                            has_grown_pop = yes
                        }
                        set_building = "building_primitive_farm"
                        add_resource = {
                            resource = food
                            amount = 1
                            replace = yes
                        }
                    }                  
                    random_tile = {
                        limit = {
                            has_blocker = no
                            has_building = no
                            has_grown_pop = yes
                        }
                        set_building = "building_primitive_farm"
                        add_resource = {
                            resource = food
                            amount = 1
                            replace = yes
                        }
                    }
                    random_tile = {
                        limit = { has_building = "building_colony_shelter" }
                        remove_building = yes
                    }
                    create_army = {
                                    name = "Primitive Army"
                                    owner = last_created
                                    species = last_created
                                    type = "primitive_army"
                                }
                    create_army = {
                                    name = "Primitive Army"
                                    owner = last_created
                                    species = last_created
                                    type = "primitive_army"
                                }
                    create_army = {
                                    name = "Primitive Army"
                                    owner = last_created
                                    species = last_created
                                    type = "primitive_army"
                                }
                }
    }  
  
  
    planet = {
        name =  "Adas"
        class = "pc_barren"
        orbit_distance = 60
        orbit_angle = 140
        size = 14
        has_ring = no
    }  
  
    planet = {
        name =  "Kaddi"
        class = "pc_barren_cold"
        orbit_distance = 20
        orbit_angle = 35
        size = 28
        has_ring = no
    }  
  
    planet = {
        name =  "Haza"
        class = "pc_gas_giant"
        orbit_distance = 20
        orbit_angle = -80
        size = 22
        has_ring = no
    }  
}

I could also be wrong here, but I believe that using
Code:
starting_planet = no
home_planet = no

in the system initializer would also stop randomly spawning empires from spawning on the specific planet.
 

Kordishal

Second Lieutenant
48 Badges
Jan 3, 2013
113
140
  • Crusader Kings II: Legacy of Rome
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Pre-order
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Majesty 2
  • Magicka
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Art of War
  • Crusader Kings II: The Old Gods
  • Crusader Kings II
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Dungeonland
  • Europa Universalis IV
  • Imperator: Rome Sign Up
  • Stellaris: Megacorp
  • Shadowrun Returns
  • Stellaris: Distant Stars
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Cradle of Civilization
  • Age of Wonders III
  • Stellaris: Ancient Relics
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Warlock: Master of the Arcane
  • Victoria 2
  • Europa Universalis IV: Third Rome
  • Cities: Skylines
I don't know if I misread, but it's definitely possible to spawn in Empires (and primivites) in scripted systems via the System initializerrs.

I am aware that this is possible, but that is not what I meant. You can't place the player in this way and you can't spawn AI empires created by the game or pre-scripted by us this way.

When I have a script for an empire that the player can choose there is no way for me to easily get this empire into the game if he does not choose it. The way you described is a lot of work, to create an empire like that. In addition not everything is possible like this, for example there does not seem to be an easy way to create and assign a ruler to this country...
 

poopchute

Sergeant
25 Badges
Dec 19, 2013
89
6
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Cities in Motion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Leviathan: Warships
  • Magicka
  • Stellaris - Path to Destruction bundle
  • Imperator: Rome
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Surviving Mars
  • BATTLETECH
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Way of Life
  • Warlock: Master of the Arcane
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Old Gods
I am aware that this is possible, but that is not what I meant. You can't place the player in this way and you can't spawn AI empires created by the game or pre-scripted by us this way.

When I have a script for an empire that the player can choose there is no way for me to easily get this empire into the game if he does not choose it. The way you described is a lot of work, to create an empire like that. In addition not everything is possible like this, for example there does not seem to be an easy way to create and assign a ruler to this country...

Definitely not easy, but you can certainly have a list of prescripted races, and if they are not selected by the player, you can spawn them in using a method similar to G33kh4n's. in game_start.txt (mod version not overwrite original!) or a similar file in same folder within mod, inside event game_start.1:
if = {
limit = {
NOT = {
any_country = {
has_country_flag = krogan
}
}
}
random_system = {
spawn_system = { initializer = "krogan_init" }
}
}

Make sure you put:
flags = { krogan }
inside the prescripted_species.txt, and set spawn_enabled to no. I'm looking into using empire_init instead, so the races appear in the center of clusters the same as if they are game generated.

There is an example of a fleet being created with an admiral being assigned inside special_system_initializers.txt, so I think it is just a matter of figuring out the syntax for creating all the leaders for AI controlled custom species:

create_leader = {
type = admiral
species = owner_main_species
name = random
skill = 100
}
then create fleet, then create ships in the fleet, then:
assign_leader = last_created_leader

It looks like mostly copy-paste-edit work once you get the first species laid out.
 

H4shX

Second Lieutenant
42 Badges
Aug 12, 2014
107
58
  • Sword of the Stars
  • Stellaris: Synthetic Dawn
  • Stellaris: Galaxy Edition
  • Stellaris
  • Cities: Skylines Deluxe Edition
  • Crusader Kings II
  • Supreme Ruler 2020
  • 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
  • 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
  • Europa Universalis IV: Art of War
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Cities: Skylines - Parklife
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Cities: Skylines - Snowfall
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
helpful thread!!

I have one question, can you specify the exact Graphical Culture / Ship Type the spawned AI can use? and based on 1.2 how do we specify the FTL and Weapons technology used, as well as set the Ruler Titles?

Thanks