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

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
Hey guys

Okay ive been asking alot of questions but yeah another one!

Is it possible to ensure that certain species do spawn next to each other? or like ven 2 to 3 systems away Do we use the System Starts?

I am trying to recreate a certain scenario, but I still want some randomness to it
 
You can make a certain system spawn within so close of a system you set to generate.

So add species Y to the random system
 
  • 1
Reactions:
You can make a certain system spawn within so close of a system you set to generate.

So add species Y to the random system

How would you do that or rather an example of the coding for that? and where would you place that?

Okay this is it, basically I have a huge system initializer that spawns +- over a 100 systems with several homeworlds systems,

Lets call the initializer Sol, Sol will have neighbor system called System A, B and C

System C would have another Neighbour system called System D, E, F

Now I created system F to be extremely far away from the other systems and created a Home System here, I have already defined usage for "Custom Empire" and created its own initilazer

I assumed by just selecting the other race to use that Initializer it will automatically use the System F that already created with the Sol Initializer

However all it did was create a Duplicate System F on the other side of the Galaxy.

My goal is to basically for me to spawn at Sol, and the collection of various races to spawn at specific points that are linked to the Sol Initialzer (i.e. Neighbours of Neighbours etc) i know one way of getting this to work is by creating a static galaxy map, but I want some form of randomness though.

Thanks in advance:D
 
Take a look at \common\solar_system_initializers\prescripted_species_systems.txt and specifically the first entry, sol_system_initializer

Near the end it has this:
Code:
    neighbor_system = {
        distance = { min = 10 max = @distance }   
        initializer = "sol_neighbor_t1"
    }
    neighbor_system = {
        distance = { min = 10 max = @distance }   
        initializer = "sol_neighbor_t1_first_colony"
    }

sol_neighbor_t1 and sol_neighbor_t1_first_colony are both additional systems listed in the same file, which it forces to spawn adjacent.

By using the same mechanics you can create an adjacent system holding the other species.
 
  • 1
Reactions:
Take a look at \common\solar_system_initializers\prescripted_species_systems.txt and specifically the first entry, sol_system_initializer

Near the end it has this:
Code:
    neighbor_system = {
        distance = { min = 10 max = @distance }
        initializer = "sol_neighbor_t1"
    }
    neighbor_system = {
        distance = { min = 10 max = @distance }
        initializer = "sol_neighbor_t1_first_colony"
    }

sol_neighbor_t1 and sol_neighbor_t1_first_colony are both additional systems listed in the same file, which it forces to spawn adjacent.

By using the same mechanics you can create an adjacent system holding the other species.

Thanks for the response, I did that already, I got the neighbour set that is linked to Sol via its custom Neighbour, but the species itself is spawning a Duplicate of that System somewhere in the Galaxy, so in essence lets call the Home System Alpha, now theres 2 Home Systems Alpha.

Would restricting it like how Sol is restricted work in terms of duplication of Sol work?

Have a look at the file attached, I got the whole file, but I am testing each section in bits to see if it spawns correctly.
 

Attachments

  • sol_system.txt
    65,9 KB · Views: 2
Spawn the second race through script, rather than having them as a prescripted species. The code goes inside an init_effect = {} event block inside the solar system initializer, which gets called using neighbor_system during your first species initialization. Just set the min distance to something like 50 if you don't want them too close. example code:


Code:
krogan_init = {
    name = "Aralahk"
    flags = { aralahk krogan }
    class = "sc_f"
    asteroids_distance = 150

    planet = {
        name = "Aralahk"
        count = 1
        class = "pc_f_star"
        orbit_distance = 0
        orbit_angle = 1
        size = 40
        has_ring = no
    }

    planet = {
        name = "Durak"
        class = "pc_molten"
        orbit_distance = 40
        orbit_angle = 15
        size = 10
        has_ring = no
    }

    planet = {
        name = "Kanin"
        class = "pc_molten"
        orbit_distance = 15
        orbit_angle = 15
        size = 10
        has_ring = no
    }
   
    planet = {
        name = "Kruban"
        class = "pc_toxic"
        orbit_distance = 15
        orbit_angle = 125
        size = 20
        has_ring = no
    }

   
    planet = {
        name = "Tuchanka"
        class = "pc_arid"
        orbit_distance = 40
        orbit_angle = 120
        size = 16
        starting_planet = yes
        has_ring = no
        tile_blockers = none
        modifiers = none
       
        init_effect = {
            prevent_anomaly = yes
        }
       
        init_effect = {
            save_event_target_as = krogan_spawn
            create_species = {
                name = Krogan
                plural = Krogan
                class = "REP"
                portrait = "rep14"
                homeworld = THIS
                ftl=hyperdrive
                weapon="tech_mass_drivers_1"
                traits = {
                    trait="trait_strong"
                    trait="trait_resilient"
                    trait="trait_rapid_breeders"
                    trait="trait_repugnant"
                }
            }

            create_country = {
                name = Krogan Empire
                type = empire
                government = military_junta
                flags = { krogan }
                species = last_created
                ethos = {
                    ethic="ethic_individualist"
                    ethic="ethic_xenophobe"
                    ethic="ethic_militarist"       
                }
                flag = {
                    icon = {
                        category="zoological"
                        file="flag_zoological_12.dds"
                    }
                    background= {
                        category = "backgrounds"
                        file="00_solid.dds"
                    }
                    colors={
                        "black"
                        "black"
                        "null"
                        "null"
                    }
                }
            }
           
            last_created_country = {
                create_leader = {
                    type = governor
                    name = random
                    species = owner_main_species
                    skill = 201
                }
                create_leader = {
                    type = scientist
                    name = random
                    species = owner_main_species
                    skill = 201
                }
                create_leader = {
                    type = scientist
                    name = random
                    species = owner_main_species
                    skill = 201
                }
                create_leader = {
                    type = scientist
                    name = random
                    species = owner_main_species
                    skill = 201
                }
                #create_leader = {
                #    type = admiral
                #    species = owner_main_species
                #    name = random
                #    skill = 100
                #}   
                create_fleet = {name = "1st Fleet"}
                last_created_fleet = {
                    set_owner = last_created_country
                    create_ship = {
                        name = "Dagger"
                        design = "Dagger"
                    }
                    create_ship = {
                        name = "Dagger"
                        design = "Dagger"
                    }
                    create_ship = {
                        name = "Dagger"
                        design = "Dagger"
                    }
                    set_location = event_target:krogan_spawn
                    #assign_leader = last_created_leader
                }
                create_fleet = {}
                last_created_fleet = {
                    set_owner = last_created_country
                    create_ship = { name = random design = "Constructor"}
                    set_location = event_target:krogan_spawn
                }
               
                create_leader = {
                    type = scientist
                    species = owner_main_species
                    name = random
                    skill = 100
                }
                create_fleet = {}

                last_created_fleet = {
                    set_owner = last_created_country
                    create_ship = { name = random design = "Prototype"}
                    set_location = event_target:krogan_spawn
                    assign_leader = last_created_leader
                }
                add_minerals = 350
            }
           
        }
   
        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 = 1
                        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 = 1
                        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
                }               
            }
           

           
            create_pop = {
                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
            }create_pop = {
                species = owner_main_species
                ethos = owner
            }
            create_pop = {
                species = owner_main_species
                ethos = owner
            }   
            create_pop = {
                species = owner_main_species
                ethos = owner
            }
        }
    }
    planet = {
        name = "Raum"
        class = "pc_gas_giant"
        orbit_distance = 30
        orbit_angle = -160
        size = 35
        has_ring = no
       

    }

    planet = {
        name = "Vaul"
        class = "pc_gas_giant"
        orbit_distance = 30
        orbit_angle = -160
        size = 35
        has_ring = no

    }
   
}

Note that this will not provide them a spaceport, but gives them resources so if played by AI building the spaceport with those resources is almost certainly the first thing they will do. This is based off the code for when a pre-spacefaring race first makes it into space. It may be possible to create a spaceport using scripts instead.
 
  • 1
Reactions:
Thank you both!!! :D this is what I was looking for lol,

I am also sure there could be a way to reference a prescripted race (that is not spawnable) using flags will look into it that as well, but it is agood start!!