Stellaris Mod Creation and Upload Log

How to become a qualified 4th crisis without using the console.

The Mods mentioned in the document were created based on Stellaris version 3.8.4, with the launcher version being 2023.11. Please be aware of their timeliness.

The Paradox Wiki provides detailed instructions on mod creation. This document serves only as a personal development record for the mod and as a supplement to the Wiki content.

Software Installations

VS Code

Stellaris configuration files are mostly in txt format and can be edited using VS Code with the CWTools extension installed. CWTools provides features like code autocompletion and error prompts, making it quite convenient. After installation, you can set the Stellaris installation path in the extension settings, which is typically located at [Steam installation path]/steamapps/common/Stellaris/.

Stellaris-CWTools.jpg

DDS Plug-in

In Stellaris, many image files are in DDS format. To save images as DDS format in Photoshop, you need to install a plugin. Place the downloaded plugin file (.8bi) into the ./Required/Plug-ins/File Formats folder within the Photoshop directory. Then, open Photoshop, and if you see DDS under Help -> About Plug-In in the menu, it means the installation was successful.

Mod Creation

  1. In the Stellaris launcher, select “All installed mods” from the left sidebar, then click on “UPLOAD MOD” in the upper right corner.
  2. In the pop-up window, provide the necessary information, which you can modify later:
    • Name: The name that will be displayed for your mod in the launcher and the Steam Workshop. For example, let’s use Example here.
    • Version: The game version your mod is compatible with. You can enter the current minor version, such as 3.8.4, or use an asterisk * to indicate compatibility with the entire 3.8 major version, like 3.8.*.
    • Directory: Enter the name of the folder where your mod files are located, following mod/. This name can be different from your mod’s name. Let’s use exp as an example.
    • Tags: Categories that describe your mod’s content changes, mainly for others to filter mods in the Steam Workshop by different types.
  3. Click on CREATE MOD.
  4. A folder with the name you provided for the directory and a corresponding .mod file will appear in C:/Users/Documents/Paradox Interactive/Stellaris/mod.
Stellaris-Mod-Creation-1.jpg
Stellaris-Mod-Creation-2.jpg
Stellaris-Mod-Creation-3.jpg

The directory of the files after the mod is created is as follows:

1
2
3
4
5
6
7
C:/Users/Documents/Paradox Interactive/Stellaris/mod

├─ exp.mod

└─ exp

└─ descriptor.mod
  • .../mod/exp.mod records the information we provided when creating the local mod and generally doesn’t need editing.
  • .../mod/exp/descriptor.mod is similar to .../mod/exp.mod, we will use it when uploading the mod to the Steam Workshop later.
  • The .../mod/exp/ folder is used to store our mod files.

Notes

Mod Principles

The operation of mods in Stellaris works roughly as follows:

  • If a mod contains content identical to the base game, the mod’s content will replace the base game’s content.
  • If the content in a mod does not exist in the base game, it will merge with the base game’s content.
  • If multiple mods define the same content, only the mod at the bottom of the launcher’s mod list will take effect, meaning that the content from earlier mods with the same definition will be overridden by later mods.

File Encoding

Mod files require two different encoding modes, which can be adjusted from the status bar at the bottom of VS Code:

  • txt and mod files use UTF-8 encoding.
  • yml files use UTF-8 with BOM encoding.

Stellaris-File-Encoding.jpg

Image Formats

After completing image creation in Photoshop, go to File -> Save As, select the file type as DDS, and then click save. In the pop-up dialog, set Format to DXT5, check Mipmap, and for Alpha Channel, choose Transparency.

Stellaris-DDS.jpg

For specific image dimensions, you can refer to official images located in ../Stellaris/gfx. Files like icons for interfaces can be found in ../Stellaris/gfx/interface/icons.

Please note that although the size of building icons is 98x98px, you should leave at least 22px or more of blank space on the left and bottom of the image. Content exceeding these boundaries will not be displayed.

多语言

See Localisation modding for details

Localization files are placed in the mod/localisation folder, and the file format is YAML. Files for different languages should be stored separately. Stellaris determines the language type based on the identifier at the beginning of the file: English uses l_english:, Simplified Chinese uses l_simp_chinese:, and desc suffix indicates that the following text is an explanation of the above property. Examples are given below:

1
2
3
4
//eg_l_english.yml
l_english:
eg:0 "Example"
eg_desc:0 "This is an example description."
1
2
3
4
//eg_l_simp_chinese.yml
l_simp_chinese:
eg:0 "示例"
eg_desc:0 "这是一段示例的介绍。"

Note: File naming should be unique to avoid conflicts with other mods. If there are duplicates, it may not work because the files get overwritten.

Mod Example

Species Trait Mod

Let’s start with something simple: adding an immortal trait to a species so that leaders don’t die of old age as soon as they reach maximum level. The Mod file directory is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
C:/Users/Documents/Paradox Interactive/Stellaris/mod/Immortal_Species_Trait

├─ common
│ │
│ └─ trait
│ │
│ └─ immortal_species_traits.txt //Trait Definition File

├─ gfx
│ │
│ └─ interface
│ │
│ └─ icon
│ │
│ └─ traits
│ │
│ └─ the_immortal.dds //Trait icon, size 40*40 pixels

├─ localisation
│ │
│ ├─ ist_l_english.yml //English Localisation File
│ │
│ └─ ist_l_simp_chinese.yml //Simplified Chinese Localisation File

├─ thumbnail.png //Cover Image

└─ descriptor.mod //Mod Info Record

Here is the content and explanation from immortal_species_traits.txt:

1
2
3
4
5
6
7
8
9
10
11
the_immortal = {
cost = 0 # Trait point cost
icon = "gfx/interface/icons/traits/the_immortal.dds" # Icon path
allowed_archetypes = { BIOLOGICAL } # Only allowed for biological species, not for machines
randomized = no # This trait can not be randomly generated among species in the galaxy
immortal_leaders = yes # Leaders with this trait are immortal, same effect as the Chosen One trait
modification = no # This trait can not be acquired through species genetic modification
ai_weight = {
weight = 0 # Can AI use this trait? 0 means AI is prohibited from using it.
}
}

And here is the content from ist_l_english.yml:

1
2
3
l_english:
the_immortal:0 "Immortal"
the_immortal_desc:0 "This species has an extremely long lifespan"

Building and Spaceport Mod

The directory structure is largely similar, so here’s an explanation of building definition files. The following buildings can turn you into a qualified 4th crisis (LOL).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
building_spb_sanctuary = {
icon = "building_spb_sanctuary" # Icon name, no need to include the path, it defaults to ./gfx/interface/icons/buildings/
can_be_ruined = no # Cannot be destroyed, won't be damaged during orbital bombardment
base_buildtime = 233 # Default build time
base_cap_amount = 1 # Number of these buildings that can be constructed on one planet

planet_modifier = { # Modifiers that only apply on the planet
pop_happiness = 0.3 # Pop happiness +30%
planet_decision_enact_speed_mult = 1.00 # Planet decision enactment speed +100%
planet_stability_add = 80 # Planet stability +80
planet_crime_add = -80 # Crime -80
planet_amenities_add = 233 # Amenities +233
planet_resettlement_unemployed_mult = 1.00 # Resettlement of unemployed pops speed +100%
planet_orbital_bombardment_damage = -1.00 # Orbital bombardment damage reduction 100%
planet_jobs_unity_produces_mult = 0.6 # Jobs produce Unity +60%
planet_administrators_produces_mult = 0.6 # Administrators produce +60%
planet_max_buildings_add = 11 # Planet building slots +11
pop_growth_speed = 1.0 # Organic pop growth speed +100%
planet_housing_add = 2333 # Housing +2333
building_time_mult = -0.3 # Building time -30%
planet_building_build_speed_mult = 0.3 # Building build speed +30%
planet_clear_blocker_time_mult = -0.3 # Clear blocker time -30%

# The following indicates how many jobs are added per population for each type of job
job_technician_per_pop = 0.05 # Technician, displays as every 20 pops add 1 of this job
job_miner_per_pop = 0.2 # Miner
job_chemist_per_pop = 0.05 # Chemist
job_gas_refiner_per_pop = 0.05 # Gas Refiner
job_translucer_per_pop = 0.05 # Translucer
job_foundry_per_pop = 0.1 # Foundry
job_artisan_per_pop = 0.1 # Artisan
job_farmer_per_pop = 0.1 # Farmer
job_clerk_per_pop = 0.2 # Clerk
job_researcher_per_pop = 0.1 # Researcher

# The following indicates how many fixed output points each job type generates
job_merchant_add = 1 # Merchant
job_head_researcher_add = 2 # Head Researcher
job_archaeoengineers_add = 3 # Archaeoengineers

# The following indicates how many points of fixed output are added for each job type
planet_technician_energy_produces_add = 6 # Technicians produce Energy
planet_miners_minerals_produces_add = 6 # Miners produce Minerals
planet_miners_alloys_produces_add = 3 # Miners produce Alloys (surprise!)
planet_metallurgists_alloys_produces_add = 6 # Metallurgists produce Alloys
planet_artisans_consumer_goods_produces_add = 6 # Artisans produce Consumer Goods
planet_farmers_food_produces_add = 6 # Farmers produce Food

# The following indicates the percentage output increase for each job type
planet_jobs_exotic_gases_produces_mult = 0.6 # Jobs that produce Exotic Gases +60%
planet_jobs_rare_crystals_produces_mult = 0.6 # Jobs that produce Rare Crystals +60%
planet_jobs_volatile_motes_produces_mult = 0.6 # Jobs that produce Volatile Motes +60%
planet_metallurgists_produces_mult = 0.6 # Metallurgists, jobs producing Alloys +60%
planet_artisans_produces_mult = 0.6 # Artisans, jobs producing Consumer Goods +60%
planet_researchers_produces_mult = 0.6 # Researchers, jobs producing Research +60%

trade_value_mult = 0.3 # Trade value +30%
trade_value_add = 233 # Fixed trade value added +233
}

country_modifier = { # Modifiers that apply to the entire country
country_government_civic_points_add = 3 # Civic points +3
edict_length_mult = 10.0 # Edict duration +1000%
pop_government_ethic_attraction = 0.10 # Government ethic attraction +10%
envoys_add = 3 # Envoys +3
intel_decryption_add = 30 # Decryption +30
intel_encryption_add = 30 # Encryption +30
add_base_country_intel = 30 # Base intel level +30
ship_windup_mult = -0.30 # Hyperdrive windup time -30%
ship_winddown_mult = -0.30 # Hyperdrive winddown -30%
ship_fire_rate_mult = 0.30 # Ship weapon fire rate +30%
ship_disengage_chance_mult = 0.3 # Combat disengagement chance +30%
ship_emergency_ftl_min_days_mult = -0.30 # Emergency FTL cooldown -30%
ship_emergency_ftl_mult = -0.30 # Emergency FTL risk reduction -30%
country_leader_cap_add = 3 # Leader cap +3
country_naval_cap_add = 3000 # Naval capacity +3000
army_health = 0.30 # Army health +30%
country_resource_max_add = 500000 # Resource storage capacity +500000
megastructure_build_speed_mult = 0.3 # Megastructure build speed +30%

all_technology_research_speed = 0.3 # Technology research speed +30%
science_ship_survey_speed = 0.3 # Science ship survey speed +30%
ship_anomaly_research_speed_mult = 0.3 # Ship anomaly research speed +30%
num_tech_alternatives_add = 3 # Tech alternatives +3
ship_archaeological_site_excavation_speed_mult = 0.3 # Archaeological site excavation speed +30%
ship_ftl_jumpdrive_range_mult = 3.0 # Ship jumpdrive range +300%
ship_jumpdrive_cooldown_mult = -0.3 # Jumpdrive cooldown -30%
species_leader_exp_gain = 0.3 # Species leader experience gain +30%
country_resource_max_minor_artifacts_add = 2000 # Minor artifacts storage capacity +2000
category_archaeostudies_research_speed_mult = 1.0 # Archaeology research speed +100%
}

army_modifier = {
army_starting_experience_add = 1000 # Starting army experience +1000
}

resources = {
category = planet_buildings
cost = { # Build cost
alloys = 233
}
upkeep = { # Building upkeep
energy = 100
consumer_goods = 20
food = 10
}
produces = { # Resource production
energy = 3000
unity = 100
minerals = 500
alloys = 150
consumer_goods = 150
volatile_motes = 10
exotic_gases = 10
rare_crystals = 10
nanites = 3
sr_zro = 3
sr_living_metal = 3
sr_dark_matter = 3
society_research = 100
engineering_research = 100
physics_research = 100
minor_artifacts = 3
}
}

allow = { owner = { is_ai = no } } # Prohibits AI from building
}

Leader Mod

This mod provides the following functionalities:

  • Creates a new leader with a unique portrait at the start of the game and makes this new leader the new ruler.
  • This leader possesses three exclusive traits.
  • Resets the leader’s portrait and age on the 1st of every month (because when species gene modification occurs, the portrait reverts to the default species) and removes all negative traits.

The file structure of this Mod is shown below.

Stellaris-Leader-Mod-Structure.png

The following are some partial code examples

On actions

On actions is a way of triggering events, see Paradox Wiki for more information.

1
2
3
4
5
6
7
8
9
10
11
12
# common/on_actions/00_bronya.txt
on_game_start_country = { # Execute the event bronya.0 at the start of the game
events = {
bronya.0
}
}

on_monthly_pulse_country = { # Execute event bronya.3 at the beginning of each month
events = {
bronya.3
}
}

Event

Paradox Wiki’s description of events

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# events/bronya_event.txt
namespace = bronya

country_event = { # Creating a leader and setting her as the ruler at the start of the game
id = bronya.0 # Event ID, used by triggers to match the event to execute
hide_window = yes # Hide the event pop-up window
is_triggered_only = yes # Specifies that the event can only be triggered by triggers or another event; otherwise, it would be constantly triggered, increasing CPU load
trigger = {
is_ai = no # Prevent AI from using this
}
immediate = { # Actions to be executed immediately after the event is triggered
set_country_flag = ruled_by_bronya # Add a flag to the country for later matching
}
after = {
hidden_effect = { # Perform actions without generating notifications
create_leader = { # Create a leader
class = governor # Governor type
name = NAME_Bronya # Name key; its value needs to be set in the localization file
immortal = yes # Immortal, won't die of old age
set_age = 17 # Set age (Note: Doesn't take effect here)
gender = female # Gender
skill = 1 # Skill level
traits = { # Set traits
trait = leader_trait_yamen
trait = leader_trait_three_duck_turbo
trait = leader_trait_lychee
}
event_leader = yes # Prevent leader from joining factions
effect = {
set_leader_flag = ruler_bronya # Add a flag to the leader
}
}
last_created_leader = {
change_leader_portrait = Bronya0 # Set the portrait
}
set_leader = last_created_leader # Set as the ruler
}
}
}

# Monthly event used to restore portraits, etc.
country_event = {
id = bronya.3
hide_window = yes
is_triggered_only = yes
trigger = {
is_ai = no
has_country_flag = ruled_by_bronya # Only countries with this flag can trigger this event
}
immediate = {
if = {
limit = {
has_country_flag = ruled_by_bronya # Match the country
}
every_owned_leader = {
limit = {
has_leader_flag = ruler_bronya # Match the leader
}
change_leader_portrait = Bronya0 # Set the portrait
set_age = 17 # Set age
remove_all_negative_traits = yes # Remove all negative traits
}
}
}
}

Leader Traits

Paradox Wiki’s description of Leadership Traits

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# common/traits/00_bronya_traits.txt
# Herrscher of Lychee
leader_trait_lychee = {
cost = 0
valid_for_all_ethics = yes # Applies to all ethics
councilor_trait = yes # Only applies when the leader is in the council
icon = "gfx/interface/icons/traits/trait_lychee.dds" # Path to the trait's icon; the icon size is 29x29 pixels.
modifier = { # Provides a bonus
all_technology_research_speed = 0.3
ship_archaeological_site_excavation_speed_mult = 0.3
species_leader_exp_gain = 0.3
planet_jobs_food_produces_mult = 0.3
empire_size_penalty_mult = -0.3
country_starbase_influence_cost_mult = -0.3
army_experience_gain_mult = 0.3
pop_growth_speed = 0.3
}
leader_class = { # Only effective for governors
governor
}

# Prevent other leaders from acquiring this trait
initial = no
randomized = no

notify_on_gained = no # No notification when the trait is gained
}

Portrait

Paradox Wiki’s description of portrait.

I used the simplest method: a static portrait with a portrait image size of 496*380 pixels.

1
2
3
4
# gfx/portraits/portraits/01_bronya_potraits.txt
portraits = {
Bronya0 = {textureFile = "gfx/models/portraits/Custom/Bronya0.dds"}
}

Solar System Mod

The last and most complex mod involves creating a custom solar system at the center of the Milky Way as the initial galaxy for your empire. The file structure is shown below.

Stellaris-System-Mod-Structure.png

Custom Solar System Class

In Stellaris, the default solar system types include single stars, binary stars, and trinary stars. Here, I want to create a quaternary solar system with a black hole at the center, surrounded by a neutron star, an A-class star, and a B-class star.

Paradox Wiki’s description of system modding

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# common/star_classes/starry_star_classes.txt
sc_starry_galaxy_center = {
class = black_hole # Setting the system background
icon = black_hole # Setting the icon style of the system on the star map
planet = { # Black hole
key = pc_black_hole
class = black_hole
}
planet = { # B-class star
key = pc_b_star
class = b_star
}
planet = { # Neutron star
key = pc_neutron_star
class = neutron_star
}
planet = { # A-class star
key = pc_a_star
class = a_star
}
spawn_odds = 0 # The probability of generating such solar systems randomly is...
num_planets = { # Number of planets in the system
min = 8
max = 25
}
is_environmental_hazard = yes # Are there any environmental hazards
modifier = {
ship_disengage_chance_reduction = 0.5
ship_emergency_ftl_min_days_mult = 0.5
ship_speed_reduction = 0.5
}
}

Custom Starting Solar System

The principle of setting the initial galaxy at the center of the Milky Way is as follows: at the beginning of the game, create a regular solar system at a random location on the map. For the sake of distinction, I refer to this as the “original starting solar system.” During the initialization process of this solar system, use init_effect to create the custom solar system at the center of the galaxy, which I call the “Central Galaxy.” Finally, through events and script effects, migrate all population from the original starting solar system to habitable planets in the Central Galaxy, create new spaceports, science ships, construction ships, and fleets in the Central Galaxy, and then dismantle all ships, spaceports, mining stations, and buildings within the original starting solar system and its sectors.

Paradox Wiki’s description of Effect

Because the solar system I’ve set up is quite extensive, the code spans nearly 500 lines. I won’t include all of it here, but I’ll provide the specific code for creating nebulas and constructing megastructures.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# common/solar_system_initializers/galaxy_center_starry_system.txt

# The initializer for the original starting solar system.
d_starry_galaxy_center_system = {
class = "sc_black_hole"
usage = custom_empire
name = "starry_name_galaxy_original_system"
flags = {
empire_home_system
}
planet = {
class = star
orbit_distance = 0
orbit_angle = 1
size = {
min = 20
max = 30
}
has_ring = no
name = "starry_name_galaxy_original_system"
}

##############################
# Omitted content
##############################

# Homeworld of the original starting solar system.
planet = {
##########################
# Omitted content
##########################
home_planet = yes
init_effect = {
set_planet_flag = starry_galaxy_center_origin_planet
}
##########################
#Omitted content
##########################
}

##############################
#Omitted content
##############################

init_effect = {
set_spawn_system_batch = begin # Optimising the effect of spawn_system calls
# Generate Central Galaxy
no_scope = {
spawn_system = {
min_distance >= 1
max_distance <= 2
min_orientation_angle = 1
max_orientation_angle = 2
hyperlane = no
initializer = starry_galaxy_center_init_00 # Calling the Central Galaxy initialiser
}
}
# Remove all hyper lanes
random_system = {
limit = {
has_star_flag = starry_galaxy_center_flag_0
}
save_event_target_as = starry_galaxy_center_flag_0
every_neighbor_system = {
limit = {
has_hyperlane_to = prev
}
remove_hyperlane = {
from = this
to = prev
}
}
}
set_spawn_system_batch = end
}
##############################
# Omitted content
##############################
}

# Central Galaxy initialiser
starry_galaxy_center_init_00 = {
class = "sc_starry_galaxy_center" # The previously customised solar system class
name = "starry_name_galaxy_center_system"
flags = {
empire_cluster
starry_galaxy_center_flag_0
}
# Black holes with damaged matter decompressor
planet = {
class = star
orbit_distance = 0
name = "starry_name_galaxy_center_system"
init_effect = {
save_event_target_as = matter_decompressor_star
clear_deposits = yes
}
}

##############################
# Omitted content
##############################

# Habitable planet
planet = {
class = star
orbit_distance = 0
orbit_angle = 120
size = 28
has_ring = no
name = "starry_name_galaxy_center_homestar"
change_orbit = 60
# Homeworld
planet = {
class = pc_gaia
orbit_distance = 1
orbit_angle = {
min = 90
max = 270
}
name = "starry_name_galaxy_center_homeland"
size = 30
has_ring = yes
home_planet = yes
init_effect = {
set_planet_flag = starry_galaxy_center_real_init_system
save_event_target_as = starry_galaxy_center_capital
}
moon = {
class = "pc_barren_cold"
size = 5
orbit_distance = 12
orbit_angle = 40
has_ring = no
init_effect = {
set_planet_flag = starry_init_moon
}
}
}
###########################
# Omitted content
###########################
}
init_effect = {
# Generate nebula background
save_event_target_as = starry_galaxy_center_system_target
create_ambient_object = {
type = "turbulent_nebula_2"
location = this
}
last_created_ambient_object = {
set_location = {
target = prev
distance = 0
angle = random
}
}
# Generate nebula
if = {
limit = {
is_inside_nebula = no
}
create_nebula = {
radius = 40
}
set_star_flag = starry_galaxy_center_nebula
}
# Generate megastructure
spawn_megastructure = {
type = "matter_decompressor_ruined"
planet = event_target:matter_decompressor_star
}
###########################
# Omitted content
###########################
}
}

Event

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# events/starry_galaxy_center_game_start.txt
namespace = starry_galaxy_center_start

planet_event = {
id = starry_galaxy_center_start.1
hide_window = yes
is_triggered_only = yes

trigger = {
has_planet_flag = starry_galaxy_center_origin_planet
}

immediate = {
owner = {
set_country_flag = starry_galaxy_center_country
}

starry_home_planet_first_pass = yes # executing script
}
}

country_event = {
id = starry_galaxy_center_start.2
hide_window = yes
is_triggered_only = yes

trigger = {
has_country_flag = starry_galaxy_center_country
}

immediate = {
capital_scope = {
starry_home_planet_secondery_pass = yes # executing script
}
}
}

Scripted Effects

Paradox Wiki’s description of scripted effects

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# common/scripted_effects/starry_planet_scripted_effects.txt
starry_home_planet_first_pass = {
IF = {
limit = {
OR = {
has_planet_flag = starry_galaxy_center_origin_planet
has_planet_flag = starry_galaxy_center_real_init_system
}
}
owner = {
give_technology = {
tech = "tech_gateway_activation" #Unlock Gateway Activation Technology without Notification
message = no
}
}
}
}

starry_home_planet_secondery_pass = {
IF = {
limit = {
has_planet_flag = starry_galaxy_center_origin_planet
}
owner = {
save_event_target_as = starry_galaxy_center_owner
}
random_system = {
limit = { # Match Central Galaxy
has_star_flag = starry_galaxy_center_flag_0
}
# Rebuild star base
create_starbase = {
size = "starbase_starport"
module = "shipyard"
module = "shipyard"
building = "crew_quarters"
}
# Initialise the homeworld
every_system_planet = {
if = {
limit = {
is_colonizable = yes
is_colony = no
}
create_colony = { # Creating colonies using default species
owner = event_target:starry_galaxy_center_owner
species = owner_main_species
}
generate_start_buildings_and_districts = yes # Generate initial buildings and districts
save_event_target_as = starry_galaxy_center_capital

# Setup ownership
set_owner = root
set_controller = root

set_capital = yes # Set as capital
set_name = starry_name_galaxy_center_homeland # Set homeworld name
sector = { # Set sector name
set_name = starry_name_galaxy_center_system
}

# Add planet modifieres
add_modifier = {
modifier = soothing_crystals
days = -1
}
add_modifier = {
modifier = good_vibrations
days = -1
}
add_modifier = {
modifier = paradise_planet
days = -1
}

# Add deposits to homeworld
add_deposit = d_alien_pets_deposit
add_deposit = d_hot_springs
add_deposit = d_underwater_vent
add_deposit = d_rushing_waterfalls
add_deposit = d_submerged_ore_veins
add_deposit = d_tropical_island
add_deposit = d_teeming_reef
add_deposit = d_crystal_reef
add_deposit = d_betharian_deposit
}
# Create mining station
else_if = {
limit = {
has_deposit_for = shipclass_mining_station
has_mining_station = no
}
create_mining_station = {
owner = root
}
}
# Create research station
else_if = {
limit = {
has_deposit_for = shipclass_research_station
has_research_station = no
}
create_research_station = {
owner = root
}
}
}
# Recreate science ship
create_fleet = {
effect = {
set_owner = root
create_ship = {
name = random
random_existing_design = science
}
set_fleet_stance = evasive
}
}
# Recreate constructor ship
create_fleet = {
effect = {
set_owner = root
create_ship = {
name = random
random_existing_design = constructor
}
set_fleet_stance = evasive
}
}
# Recreate military fleet
create_fleet = {
set_take_point = yes
effect = {
set_owner = root
set_name = "starry_first_fleet_name"
while = {
count = 3
create_ship = {
name = random
random_existing_design = corvette
}
}
}
}
# Set Central Galaxy as surveyed
solar_system = {
set_surveyed = {
surveyed = yes
surveyor = event_target:starry_galaxy_center_owner
}
}
# Set the moon as a cCandidate planet for terraforming
solar_system = {
every_system_planet = {
limit = {
has_planet_flag = starry_init_moon
}
prevent_anomaly = yes
add_modifier = {
modifier = terraforming_candidate
days = -1
}
}
}
}
# Move the entire population to this planet
every_owned_pop = {
resettle_pop = {
pop = THIS
planet = event_target:starry_galaxy_center_capital
}
unemploy_pop = yes
}
# Abandonment of the original planet and change of the planet to the shielded planet
remove_all_buildings = yes
remove_all_districts = yes
clear_deposits = yes
destroy_colony = yes
change_pc = pc_shielded
# Destroy all ships and space bases in the original starting solar system.
solar_system = {
every_fleet_in_system = {
delete_fleet = {
target = this
kill_leader = no
}
}
set_name = random
}
}
}

Steam Workshop

Once your mod is complete, you can upload it to the Steam Workshop, allowing other players to subscribe to and use your mod.

Add a Cover Image

In Stellaris’ launcher, locally created mods won’t display a cover image. Only mods subscribed to on the Steam Workshop will have a cover image, which serves as the thumbnail for your mod on the Workshop.

Here are some considerations for the cover image:

  1. The image size should not exceed 1MB.
  2. It’s recommended to use the png format.
  3. The aspect ratio is generally 1:1.
  4. It’s suggested to name it thumbnail.png, but ensure your system displays file extensions.

After creating the cover image, open the descriptor.mod file inside your mod folder. In my case, the file path is .../mod/exp/descriptor.mod. Paste the following code and save:

1
picture="thumbnail.png"

Upload Mod

  1. In the Stellaris launcher, select All installed mods from the left sidebar, then click UPLOAD MOD in the upper right corner.
  2. In the dropdown menu under Mod, select the mod you want to upload.
  3. At this point, you can rename the mod and adjust the game version it supports.
  4. You don’t need to fill in the Mod ID; it will be generated automatically during upload.
  5. Choose to upload it to the Steam Workshop.
  6. You can leave the description blank for now and add it later on the Workshop.
  7. Click Upload Mod.
  8. In Steam, find your Workshop item and then edit the mod’s description and add preview images.
  9. After editing, remember to change the visibility to Public so that other players can search for your mod.
Stellaris-Mod-Upload.jpg
Stellaris-mod-cover.jpg

Update Mod

The steps for updating a mod are similar to uploading:

  1. In the Stellaris launcher, select All installed mods from the left sidebar, then click UPLOAD MOD in the upper right corner.
  2. In the dropdown menu under Mod, select the mod you want to update.
  3. The Mod ID field will be automatically filled with the mod’s Workshop ID; you don’t need to fill it manually.
  4. Click Upload Mod to update it.