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

Hertog Jan

First Lieutenant
62 Badges
Jul 6, 2006
264
60
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Holy Knight (pre-order)
  • Europa Universalis III: Collection
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Cities: Skylines Deluxe Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Europa Universalis 4: Emperor
  • Europa Universalis IV: Wealth of Nations
  • 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: Sword of Islam
  • Europa Universalis III
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Cities in Motion 2
  • Europa Universalis IV: Call to arms event
  • Hearts of Iron III
  • Europa Universalis IV: Res Publica
  • Europa Universalis: Rome
  • Rome Gold
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • 500k Club
At the moment I am experimenting with modding the galaxy map. Now I would like to initialise a new system from an existing one. As always, one must specify the minimum and maximum distance allowed from the existing system.

But now I would like to make the new system's location conditional on the distance from other systems I have scripted before, and on characteristics of other systems. How do I do that?
 
You can only do it from one other system. You can chain them together as a linked list; however they spawn in random directions. So the second or third link may end up near the original star. Further more it appears that these "nearby systems" are generated on top of the standard map. So of you go nuts and chain several together, you will end up with a very dense region of stars.

My guess is you are trying to do what I did and create near Earth stars.
 
I Indeed want to create new systems from a system (let's call it 'system B' for convenience) I have created from Earth. You can specify the distance these new systems should have from system B, but I would also like to set a maximum distance from Earth.
 
To make matters more complicated. I would like to create a universe of playable custom empires, that can also be managed by the AI. One of these empires is the playable default Human empire. Then I would like to specify how far their starting systems are located from each other. How can I use solar system initialisation to do that? And do I have to script a new set of initializers for each custom empire?
 
In fact the starting location of the homeworlds should be random. But during initialization I would like them to conform to minimum and maximum distance with respect to other homeworlds, so that the homeworlds are in the same quadrant of the galaxy, but not exactly next to each other. One could call this setup semi-random or semi-static.

For the moment I have managed to work with a chain of initializers. Each initializer sets a planet flag on its system's main planet, so that it marks that planet.

Using the following code in triggers, I have made the initializers conform to distances (I have set a planet flag in every system already created).
Code:
any_system = {
    any_planet = {
        has_planet_flag = planet_flag
        distance = {
            source = THIS
            mindistance = 150
            maxdistance = 150
        }
    }
}

I would like to apologise for any vagueness in my posts concerning my reason for asking this question.
 
Last edited:
It seems like you are doing this - by necessity - through events rather than through initialization. Are you letting the game create a galaxy, then overwriting the systems with the empires and custom worlds as needed? Or creating new stars in addition? It seems relying on there being an existing system exactly 150 away from a given system would be prone to failure.
 
Another way to think of this... First, alter the galaxy configs to have fewer stars at greater distances.

In map/galaxy/base.lua (also pissble to add to all other shapes) you have:
Code:
stars_min_dist = 10.0                -- Min distance between stars
Which is pretty self explanatory, and:
Code:
countries = {
    ideal_sq_dist_between = 75*75,    -- Ideal square distance between countries
    min_sq_dist_between = 50*50,    -- Min square distance between countries
}
Doubling those, like the defaults for fallen empires, can spread them out more but you also need the next change.

In map/setup_scenarios/*.txt you have can control the distribution of homeworlds, default is to cluster them but you can easily change that like this (cluster_radius here is from a medium sized map):
Code:
    cluster_count = {
        # method = one_every_x_empire
        method = constant
        value = 1
    }
    cluster_radius = 400
    cluster_distance_from_core = 0
Essentially changing it from multiple clusters of empires into one giant cluster using the entire galaxy.

You can also reduce the number of stars in the setup_scenarios which you will need to do if you space them out further. And, once you have a map with fewer stars spread further apart and evenly distributed empires the rest of what you're trying to do should be pretty easy.

I was playing around with this to create a galaxy with small clusters of stars (like little mini galaxies) and more open space using some extreme values. Using the neighbors code for starting systems made it balanced enough to be playable and I didn't have to mess with events at all. My ADD kicked in and I was side-tracked by another idea so I didn't go very far with this idea but the concept worked well enough. I just thought you may want an option of approaching it differently if you hit too many roadblocks with your current method.

Oh, and in defines.lua you have this line:

CUSTOM_EMPIRE_SPAWN_CHANCE = 25, -- Chance that an empire will be created from an existing template instead of randomly generated (10 = 1% chance)

That should cover your other question about having only custom empires.

Hope that helps.
 
Apologies for jumping the thread, but seems a similar question and rather than start a new thread -

But can you cross-reference calls from the different starting system initializers? I.e., for example -- can I reference the Sanctuary system from the special initializers in the prescripted initializers using "nearest_system" - or do the references need to be local in the same initializer file?
 
Apologies for jumping the thread, but seems a similar question and rather than start a new thread -

But can you cross-reference calls from the different starting system initializers? I.e., for example -- can I reference the Sanctuary system from the special initializers in the prescripted initializers using "nearest_system" - or do the references need to be local in the same initializer file?

I'm pretty sure you can call any initializer in any file that is in the common/solar_system_initializers folder, in either the vanilla game or any installed mod.