Stellaris

Stellaris

Extragalactic Cluster Start
Draconas  [developer] May 18, 2020 @ 9:27am
Adding A New Home System
Remember to always do things in a local copy of your own mod, if you use the steam workshop copy of my mod then you risk it being overriden every time i release a new version.

you should look at the other forum thread about what actually happens to understand what is going on.

Add a Menu Button
All the menus happen in egs_menu_events.txt Add you new option into the relevant menu event there and make sure you set yourself a new flag. Also make sure you add clearing your flag to the script_trigger that you will see all optiosn call, which unset all exsting flags of that type.

But lets face it, this is for you, so you don't care about nice menus, you don't need customisation, so hijack one of the existing options. Simply see which country_flag it sets and that is what you are going to use elsewhere. Most of the flags are pretty self explanatory for what option they are.


Solar System Init
If you are adding a whole new start solar system as opposed to just bodging a existing start planet then first you need a solar system initaliser and then you need to make sure it gets used.
Copy your solar system initaliser into the normal place. In addition to the normal stuff it does it needs:
Star Flag: egs_empire_home_system
Home Planet Flag: egs_home_planet_marker

which are what the later scripts use to find it and set it to the right stuff.
Your homeworld defaults to a barren lifeless planet unless you give it a planet type.

To make it spawn in you need to set it in the cluster spawn event: these are relatively obviously named as egs_<CLUSTER NAME>_events.txt The ones that end in _p2 are used for player 2 in mulitplayer.

These are generally only 1 massive event, that first spawns all the stars, then hyperlanes them up.
If you scroll down, usually around bout star 7 for most clusters is the home system spawn. It is easy to spot because it will have a massive IF THEN ELSE block. It's star 9 on line 250 for Hexagon.
if = {
limit = {
has_country_flag = EGS_START_SOL
}
event_target:egs_cluster_08 = {
spawn_system = {
min_distance >= 40
max_distance <= 42
min_orientation_angle = 79
max_orientation_angle = 81
initializer = egs_sol_system_initializer
}
}
}
else_if = {
limit = {
has_country_flag = EGS_START_DENEB
}

Simply find the block that matches the flag you are going to use (or add your own if you have gone for a fancy extra option) and change the initaliser to be yours.


Funny Business
The next events that fire, going from top to bottom of the file is egs_colony_events.txt

You will probably need to add a section in here checking for your country flag and then if detected, doing whatever hacky thing your start wants that is different from a normal start. If you read down the events in that file you will see that the first ones set up the cluster itself, making sure the planets are habitable. The later parts set up the starting buildings and districts on your home planet. Edit as as required.

There will be loads of if statements in the home system and planet setup that mention "retile" that is the flag set by Stellaris Immortal. If you are using Stellaris Immortal you want the bits inside the if, if you are not you want the bits in the else = {}

Towards the bottom it sets up the connection to the rest of the galaxy and triggers PD/GPM.
Last edited by Draconas; May 18, 2020 @ 9:38am