Is there anyway to control the dense of habitable planets in different location?

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

onlyplaystellaris

Private
38 Badges
Apr 22, 2021
15
1
  • Stellaris: Ancient Relics
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Cities: Skylines Industries
  • Stellaris: Megacorp
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Campus
  • Cities: Skylines - Green Cities
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Battle for Bosporus
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Victoria 3 Sign Up
  • Hearts of Iron IV: No Step Back
  • Stellaris: Galaxy Edition
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Europa Universalis IV
  • Hearts of Iron IV: Cadet
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
Sorry, I'm quite new to modding, I wanna make a mod about galaxy generation. In my thoughts, the galaxy core should be much more denser than the outer, but there should also be less amount of habitable planets than the outer galaxy. In this way, the inner ring empires can control more systems, but they will eventually own the same amount of habitable planets as the outer ring countries.

屏幕截图 2021-07-13 105236.png


Is there anyway to do this? Thanks.
 
Last edited:
Okay, I successfully make the core denser than outer galaxy.

屏幕截图 2021-07-13 131940.png


by editing these codes:
core_radius_perc = 0.4 # Core radius is 30% of the galaxy radius
num_stars_core_perc = 0.25 # Number of stars in core

under map\galaxy\spiral_4.txt

Next step is to find out how to control the habitable planets generation.
 
I wanna make a mod about galaxy generation. In my thoughts, the galaxy core should be much more denser than the outer, but there should also be less amount of habitable planets than the outer galaxy.
You could write a script that runs on game start and looks at all stars within 0 - 0.25 (to use your variable) distance from the core, for each star system, if it has a habitable planet, that is not a capital/owned, roll a value (random list 1 / 2 / 3 ) and if it lands on, say, 1, convert that planet (from any of the habitable types) to a barren one. Do nothing if its not rolling a #1. This would lower the number of habitable worlds around the core by some fraction (e.g. 33%).

You can also run a second script to do the opposite on star-systems that are 0.6-0.8 distance from the core [if I remember right a distance of "1" from the 0-1 % scale, is equivalent to "500", which is the max stellaris distance unit that galaxies can go to), and add extra habitable worlds to them, randomly. (though this is slightly more complex with randomly picking habitable world types, but not much more complex).
 
You could write a script that runs on game start and looks at all stars within 0 - 0.25 (to use your variable) distance from the core, for each star system, if it has a habitable planet, that is not a capital/owned, roll a value (random list 1 / 2 / 3 ) and if it lands on, say, 1, convert that planet (from any of the habitable types) to a barren one. Do nothing if its not rolling a #1. This would lower the number of habitable worlds around the core by some fraction (e.g. 33%).

You can also run a second script to do the opposite on star-systems that are 0.6-0.8 distance from the core [if I remember right a distance of "1" from the 0-1 % scale, is equivalent to "500", which is the max stellaris distance unit that galaxies can go to), and add extra habitable worlds to them, randomly. (though this is slightly more complex with randomly picking habitable world types, but not much more complex).
Thank you, but how to define the distance between solar system and the galactic core?
 
Oh forgot to tell you, value comparing with distance_to_core_percent should be within the range of 0 to 1.
This might help other guys that have the same problem I used to have.
Should they? The 3.1 documentation has them as 1-100:

Code:
distance_to_core_percent - Checks the ship/fleet/planet/leader/pop/system's distance to the galactic core in percent, where center = 0 and galactic rim = 100
distance_to_core_percent < 60
Supported Scopes: all
 
Yeah, seems like you're right. Needs to be 0-1.

Code:
effect every_system = { limit = { distance_to_core_percent < 50 } set_name = "Near Center" }
...renames every planet, whereas...
Code:
effect every_system = { limit = { distance_to_core_percent < 0.5 } set_name = "Near Center" }
...reanames approximately the systems one would assume.
 
  • 1
Reactions: