Building Solar Systems (2024)

R

rastro

Second Lieutenant

53 Badges

Jun 8, 2017
104
14
  • Building Solar Systems (1)
  • Building Solar Systems (2)
  • Building Solar Systems (3)
  • Building Solar Systems (4)
  • Building Solar Systems (5)
  • Building Solar Systems (6)
  • Building Solar Systems (7)
  • Building Solar Systems (8)
  • Building Solar Systems (9)
  • Building Solar Systems (10)
  • Building Solar Systems (11)
  • Building Solar Systems (12)
  • Building Solar Systems (13)
  • Building Solar Systems (14)
  • Building Solar Systems (15)
  • Building Solar Systems (16)
  • Building Solar Systems (17)
  • Building Solar Systems (18)
  • Building Solar Systems (19)
  • Building Solar Systems (20)
  • Building Solar Systems (21)
  • Building Solar Systems (22)
  • Building Solar Systems (23)
  • Building Solar Systems (24)
  • Building Solar Systems (25)
  • Building Solar Systems (26)
  • Building Solar Systems (27)
  • Building Solar Systems (28)
  • Building Solar Systems (29)
  • Building Solar Systems (30)
  • Building Solar Systems (31)
  • Building Solar Systems (32)
  • Building Solar Systems (33)
  • Building Solar Systems (34)
  • Building Solar Systems (35)
  • Building Solar Systems (36)
  • Building Solar Systems (37)
  • Building Solar Systems (38)
  • Building Solar Systems (39)
  • Building Solar Systems (40)
  • Building Solar Systems (41)
  • Building Solar Systems (42)
  • Building Solar Systems (43)
  • Building Solar Systems (44)
  • Building Solar Systems (45)
  • Building Solar Systems (46)
  • Building Solar Systems (47)
  • Building Solar Systems (48)
  • Building Solar Systems (49)
  • Building Solar Systems (50)
  • Dec 22, 2018
  • Add bookmark
  • #1

So I have been trying my hand at modding, with mixed results.
A few main problems;
1) How to spawn neighboring systems; I coded it similar to how the Sol system spawns neighbors, but with no luck
2) How to code for resources; how to make specific resources spawn or to make sure none spawn
3) How to make a home planet spawn as a specific kind (override ideal type)
4) How to properly code binary systems
5) How to specify what districts and how many exist on planets

If anyone can help me, I would really appreciate it, cause I am at a loss. Thank you.

Mitchz95

Field Marshal

17 Badges

Feb 4, 2016
3.562
2.608
steamcommunity.com
  • Building Solar Systems (52)
  • Building Solar Systems (53)
  • Building Solar Systems (54)
  • Building Solar Systems (55)
  • Building Solar Systems (56)
  • Building Solar Systems (57)
  • Building Solar Systems (58)
  • Building Solar Systems (59)
  • Building Solar Systems (60)
  • Building Solar Systems (61)
  • Building Solar Systems (62)
  • Building Solar Systems (63)
  • Building Solar Systems (64)
  • Building Solar Systems (65)
  • Building Solar Systems (66)
  • Building Solar Systems (67)
  • Building Solar Systems (68)
  • Dec 22, 2018
  • Add bookmark
  • #2

rastro said:

1) How to spawn neighboring systems; I coded it similar to how the Sol system spawns neighbors, but with no luck

What range are you using? There may not be any systems close enough. Can you post the code?

rastro said:

2) How to code for resources; how to make specific resources spawn or to make sure none spawn

Not sure about that one, sorry.

rastro said:

3) How to make a home planet spawn as a specific kind (override ideal type)

init_effect = { change_pc = pc_continental }

rastro said:

4) How to properly code binary systems

Look in the various solar system initializers for that. And in star_classes for which stars will be used.

rastro said:

5) How to specify what districts and how many exist on planets

Not sure, sorry.

bobgrey1997

Captain

1 Badges

Feb 16, 2015
398
2
  • Building Solar Systems (70)
  • Dec 22, 2018
  • Add bookmark
  • #3

For the 5th;
I believe district types and sizes are determined by the planet's class, so you can find that in planet classes/00_planet_classes.txt
The base amount of districts is defined by the planet's size. You may be able to set this in your system inializer, but I'm not sure.
As for which kinds of districts you want, you will have to choose a planet class that has the right set up, or make your own planet class (or edit an existing one) and use that new class for your planet.

  • Dec 22, 2018
  • Add bookmark
  • #4

Mitchz95 said:

What range are you using? There may not be any systems close enough. Can you post the code?

Not sure about that one, sorry.

init_effect = { change_pc = pc_continental }

Look in the various solar system initializers for that. And in star_classes for which stars will be used.

Not sure, sorry.

neighbor_system = {
distance = { min = 10 max = @distance }
initializer = "cyrannus_b"
}

for 4) do you know of what solar system would be a good example of binary to work off of?

R

rastro

Second Lieutenant

53 Badges

Jun 8, 2017
104
14
  • Building Solar Systems (121)
  • Building Solar Systems (122)
  • Building Solar Systems (123)
  • Building Solar Systems (124)
  • Building Solar Systems (125)
  • Building Solar Systems (126)
  • Building Solar Systems (127)
  • Building Solar Systems (128)
  • Building Solar Systems (129)
  • Building Solar Systems (130)
  • Building Solar Systems (131)
  • Building Solar Systems (132)
  • Building Solar Systems (133)
  • Building Solar Systems (134)
  • Building Solar Systems (135)
  • Building Solar Systems (136)
  • Building Solar Systems (137)
  • Building Solar Systems (138)
  • Building Solar Systems (139)
  • Building Solar Systems (140)
  • Building Solar Systems (141)
  • Building Solar Systems (142)
  • Building Solar Systems (143)
  • Building Solar Systems (144)
  • Building Solar Systems (145)
  • Building Solar Systems (146)
  • Building Solar Systems (147)
  • Building Solar Systems (148)
  • Building Solar Systems (149)
  • Building Solar Systems (150)
  • Building Solar Systems (151)
  • Building Solar Systems (152)
  • Building Solar Systems (153)
  • Building Solar Systems (154)
  • Building Solar Systems (155)
  • Building Solar Systems (156)
  • Building Solar Systems (157)
  • Building Solar Systems (158)
  • Building Solar Systems (159)
  • Building Solar Systems (160)
  • Building Solar Systems (161)
  • Building Solar Systems (162)
  • Building Solar Systems (163)
  • Building Solar Systems (164)
  • Building Solar Systems (165)
  • Building Solar Systems (166)
  • Building Solar Systems (167)
  • Building Solar Systems (168)
  • Building Solar Systems (169)
  • Building Solar Systems (170)
  • Dec 22, 2018
  • Add bookmark
  • #5

bobgrey1997 said:

For the 5th;
I believe district types and sizes are determined by the planet's class, so you can find that in planet classes/00_planet_classes.txt
The base amount of districts is defined by the planet's size. You may be able to set this in your system inializer, but I'm not sure.
As for which kinds of districts you want, you will have to choose a planet class that has the right set up, or make your own planet class (or edit an existing one) and use that new class for your planet.

And I don't really want to override anything else, but thank you. Once the code is settled, will the homeworld (and other worlds) still randomize districts every time?

R

rastro

Second Lieutenant

53 Badges

Jun 8, 2017
104
14
  • Building Solar Systems (171)
  • Building Solar Systems (172)
  • Building Solar Systems (173)
  • Building Solar Systems (174)
  • Building Solar Systems (175)
  • Building Solar Systems (176)
  • Building Solar Systems (177)
  • Building Solar Systems (178)
  • Building Solar Systems (179)
  • Building Solar Systems (180)
  • Building Solar Systems (181)
  • Building Solar Systems (182)
  • Building Solar Systems (183)
  • Building Solar Systems (184)
  • Building Solar Systems (185)
  • Building Solar Systems (186)
  • Building Solar Systems (187)
  • Building Solar Systems (188)
  • Building Solar Systems (189)
  • Building Solar Systems (190)
  • Building Solar Systems (191)
  • Building Solar Systems (192)
  • Building Solar Systems (193)
  • Building Solar Systems (194)
  • Building Solar Systems (195)
  • Building Solar Systems (196)
  • Building Solar Systems (197)
  • Building Solar Systems (198)
  • Building Solar Systems (199)
  • Building Solar Systems (200)
  • Building Solar Systems (201)
  • Building Solar Systems (202)
  • Building Solar Systems (203)
  • Building Solar Systems (204)
  • Building Solar Systems (205)
  • Building Solar Systems (206)
  • Building Solar Systems (207)
  • Building Solar Systems (208)
  • Building Solar Systems (209)
  • Building Solar Systems (210)
  • Building Solar Systems (211)
  • Building Solar Systems (212)
  • Building Solar Systems (213)
  • Building Solar Systems (214)
  • Building Solar Systems (215)
  • Building Solar Systems (216)
  • Building Solar Systems (217)
  • Building Solar Systems (218)
  • Building Solar Systems (219)
  • Building Solar Systems (220)
  • Dec 22, 2018
  • Add bookmark
  • #6

Mitchz95 said:

What range are you using? There may not be any systems close enough. Can you post the code?

Not sure about that one, sorry.

init_effect = { change_pc = pc_continental }

Look in the various solar system initializers for that. And in star_classes for which stars will be used.

Not sure, sorry.

I figured I'd just post the end part of the code;

neighbor_system = {
distance = { min = 10 max = @distance }
initializer = "cyrannus_b"
}
}

cyrannus_b = {
name = "Cyrannus B"
class = sc_m

init_effect = {
every_neighbor_system = {
set_star_flag = empire_cluster
#every_neighbor_system = {
# set_star_flag = empire_cluster
#}
}
}

planet = {
name = "Helios Delta"
count = 1
class = "pc_k_star"
orbit_distance = 0
orbit_angle = 0
size = 40
has_ring = no
}
}

Mitchz95

Field Marshal

17 Badges

Feb 4, 2016
3.562
2.608
steamcommunity.com
  • Building Solar Systems (222)
  • Building Solar Systems (223)
  • Building Solar Systems (224)
  • Building Solar Systems (225)
  • Building Solar Systems (226)
  • Building Solar Systems (227)
  • Building Solar Systems (228)
  • Building Solar Systems (229)
  • Building Solar Systems (230)
  • Building Solar Systems (231)
  • Building Solar Systems (232)
  • Building Solar Systems (233)
  • Building Solar Systems (234)
  • Building Solar Systems (235)
  • Building Solar Systems (236)
  • Building Solar Systems (237)
  • Building Solar Systems (238)
  • Dec 23, 2018
  • Add bookmark
  • #7

rastro said:

I figured I'd just post the end part of the code;

neighbor_system = {
distance = { min = 10 max = @distance }
initializer = "cyrannus_b"
}
}

Hmm... looks fine to me. Maybe check your error log?

rastro said:

Code:

cyrannus_b = { name = "Cyrannus B" class = sc_m init_effect = { every_neighbor_system = { set_star_flag = empire_cluster #every_neighbor_system = { # set_star_flag = empire_cluster #} } } planet = { name = "Helios Delta" count = 1 class = "pc_k_star" orbit_distance = 0 orbit_angle = 0 size = 40 has_ring = no }}

One thing that might be throwing this off is that the system is M-class, but the star itself is K-class. Try "class = star" for Helios Delta and see if that helps.

For specific binary systems to reference, look at binary_init_01 and binary_init_02 in misc_system_initializers. The former is a circumbinary system (two stars in the center, all planets orbit both), the latter has each sun with its own small system of planets.

R

rastro

Second Lieutenant

53 Badges

Jun 8, 2017
104
14
  • Building Solar Systems (239)
  • Building Solar Systems (240)
  • Building Solar Systems (241)
  • Building Solar Systems (242)
  • Building Solar Systems (243)
  • Building Solar Systems (244)
  • Building Solar Systems (245)
  • Building Solar Systems (246)
  • Building Solar Systems (247)
  • Building Solar Systems (248)
  • Building Solar Systems (249)
  • Building Solar Systems (250)
  • Building Solar Systems (251)
  • Building Solar Systems (252)
  • Building Solar Systems (253)
  • Building Solar Systems (254)
  • Building Solar Systems (255)
  • Building Solar Systems (256)
  • Building Solar Systems (257)
  • Building Solar Systems (258)
  • Building Solar Systems (259)
  • Building Solar Systems (260)
  • Building Solar Systems (261)
  • Building Solar Systems (262)
  • Building Solar Systems (263)
  • Building Solar Systems (264)
  • Building Solar Systems (265)
  • Building Solar Systems (266)
  • Building Solar Systems (267)
  • Building Solar Systems (268)
  • Building Solar Systems (269)
  • Building Solar Systems (270)
  • Building Solar Systems (271)
  • Building Solar Systems (272)
  • Building Solar Systems (273)
  • Building Solar Systems (274)
  • Building Solar Systems (275)
  • Building Solar Systems (276)
  • Building Solar Systems (277)
  • Building Solar Systems (278)
  • Building Solar Systems (279)
  • Building Solar Systems (280)
  • Building Solar Systems (281)
  • Building Solar Systems (282)
  • Building Solar Systems (283)
  • Building Solar Systems (284)
  • Building Solar Systems (285)
  • Building Solar Systems (286)
  • Building Solar Systems (287)
  • Building Solar Systems (288)
  • Dec 23, 2018
  • Add bookmark
  • #8

Mitchz95 said:

Hmm... looks fine to me. Maybe check your error log?

One thing that might be throwing this off is that the system is M-class, but the star itself is K-class. Try "class = star" for Helios Delta and see if that helps.

For specific binary systems to reference, look at binary_init_01 and binary_init_02 in misc_system_initializers. The former is a circumbinary system (two stars in the center, all planets orbit both), the latter has each sun with its own small system of planets.

I made the change, but no result. It's not crashing, it's just not spawning the neighbor system. Would that be recorded in an error log? (also where is the error log??)

Thanks, I'll take a peek at that file and mess around with the code

Last edited:

R

rastro

Second Lieutenant

53 Badges

Jun 8, 2017
104
14
  • Building Solar Systems (289)
  • Building Solar Systems (290)
  • Building Solar Systems (291)
  • Building Solar Systems (292)
  • Building Solar Systems (293)
  • Building Solar Systems (294)
  • Building Solar Systems (295)
  • Building Solar Systems (296)
  • Building Solar Systems (297)
  • Building Solar Systems (298)
  • Building Solar Systems (299)
  • Building Solar Systems (300)
  • Building Solar Systems (301)
  • Building Solar Systems (302)
  • Building Solar Systems (303)
  • Building Solar Systems (304)
  • Building Solar Systems (305)
  • Building Solar Systems (306)
  • Building Solar Systems (307)
  • Building Solar Systems (308)
  • Building Solar Systems (309)
  • Building Solar Systems (310)
  • Building Solar Systems (311)
  • Building Solar Systems (312)
  • Building Solar Systems (313)
  • Building Solar Systems (314)
  • Building Solar Systems (315)
  • Building Solar Systems (316)
  • Building Solar Systems (317)
  • Building Solar Systems (318)
  • Building Solar Systems (319)
  • Building Solar Systems (320)
  • Building Solar Systems (321)
  • Building Solar Systems (322)
  • Building Solar Systems (323)
  • Building Solar Systems (324)
  • Building Solar Systems (325)
  • Building Solar Systems (326)
  • Building Solar Systems (327)
  • Building Solar Systems (328)
  • Building Solar Systems (329)
  • Building Solar Systems (330)
  • Building Solar Systems (331)
  • Building Solar Systems (332)
  • Building Solar Systems (333)
  • Building Solar Systems (334)
  • Building Solar Systems (335)
  • Building Solar Systems (336)
  • Building Solar Systems (337)
  • Building Solar Systems (338)
  • Dec 24, 2018
  • Add bookmark
  • #9

Mitchz95 said:

Hmm... looks fine to me. Maybe check your error log?

One thing that might be throwing this off is that the system is M-class, but the star itself is K-class. Try "class = star" for Helios Delta and see if that helps.

For specific binary systems to reference, look at binary_init_01 and binary_init_02 in misc_system_initializers. The former is a circumbinary system (two stars in the center, all planets orbit both), the latter has each sun with its own small system of planets.

Ok, good news is I found out what the issue was (it was inside brackets). New problem; other star system mods I made don't show up at all

R

rastro

Second Lieutenant

53 Badges

Jun 8, 2017
104
14
  • Building Solar Systems (339)
  • Building Solar Systems (340)
  • Building Solar Systems (341)
  • Building Solar Systems (342)
  • Building Solar Systems (343)
  • Building Solar Systems (344)
  • Building Solar Systems (345)
  • Building Solar Systems (346)
  • Building Solar Systems (347)
  • Building Solar Systems (348)
  • Building Solar Systems (349)
  • Building Solar Systems (350)
  • Building Solar Systems (351)
  • Building Solar Systems (352)
  • Building Solar Systems (353)
  • Building Solar Systems (354)
  • Building Solar Systems (355)
  • Building Solar Systems (356)
  • Building Solar Systems (357)
  • Building Solar Systems (358)
  • Building Solar Systems (359)
  • Building Solar Systems (360)
  • Building Solar Systems (361)
  • Building Solar Systems (362)
  • Building Solar Systems (363)
  • Building Solar Systems (364)
  • Building Solar Systems (365)
  • Building Solar Systems (366)
  • Building Solar Systems (367)
  • Building Solar Systems (368)
  • Building Solar Systems (369)
  • Building Solar Systems (370)
  • Building Solar Systems (371)
  • Building Solar Systems (372)
  • Building Solar Systems (373)
  • Building Solar Systems (374)
  • Building Solar Systems (375)
  • Building Solar Systems (376)
  • Building Solar Systems (377)
  • Building Solar Systems (378)
  • Building Solar Systems (379)
  • Building Solar Systems (380)
  • Building Solar Systems (381)
  • Building Solar Systems (382)
  • Building Solar Systems (383)
  • Building Solar Systems (384)
  • Building Solar Systems (385)
  • Building Solar Systems (386)
  • Building Solar Systems (387)
  • Building Solar Systems (388)
  • Dec 24, 2018
  • Add bookmark
  • #10

Nevermind, I am an idiot, I had the initializers in the mod without putting them in the "common" folder....
It is hard to mod even simple things without messing something up

Mitchz95

Field Marshal

17 Badges

Feb 4, 2016
3.562
2.608
steamcommunity.com
  • Building Solar Systems (390)
  • Building Solar Systems (391)
  • Building Solar Systems (392)
  • Building Solar Systems (393)
  • Building Solar Systems (394)
  • Building Solar Systems (395)
  • Building Solar Systems (396)
  • Building Solar Systems (397)
  • Building Solar Systems (398)
  • Building Solar Systems (399)
  • Building Solar Systems (400)
  • Building Solar Systems (401)
  • Building Solar Systems (402)
  • Building Solar Systems (403)
  • Building Solar Systems (404)
  • Building Solar Systems (405)
  • Building Solar Systems (406)
  • Dec 25, 2018
  • Add bookmark
  • #11

Modding is a difficult game, for sure. I once spent days agonizing over every single line of code in a huge mod before realizing I had a typo in one of the file names.

bobgrey1997

Captain

1 Badges

Feb 16, 2015
398
2
  • Building Solar Systems (408)
  • Dec 25, 2018
  • Add bookmark
  • #12

I hate it when that happens!

K

Knaterflater

Private

10 Badges

Dec 22, 2018
11
0
  • Building Solar Systems (409)
  • Building Solar Systems (410)
  • Building Solar Systems (411)
  • Building Solar Systems (412)
  • Building Solar Systems (413)
  • Building Solar Systems (414)
  • Building Solar Systems (415)
  • Building Solar Systems (416)
  • Building Solar Systems (417)
  • Building Solar Systems (418)
  • Dec 25, 2018
  • Add bookmark
  • #13

rastro said:

2) How to code for resources; how to make specific resources spawn or to make sure none spawn

I'll try answer point number 2 as best as I can:
It seems system resources are generated elsewhere, after the solar systems. Most notably you've probably noticed the "generate_home_system_resources = yes" in every home system initializer found in "common\solar_system_initializers" (inside the init_effect brackets). "generate_home_system_resources" can be found in "common\scripted_effects\01_start_of_game_effects.txt". There you can see how the game handles system resources. Simply creating your own custom instance, similar to "generate_home_system_resources" seems to do the trick.

As an example I created a system with absolutely no orbital deposits. In my mod folder:

I've added \common\scripted_effects\02_my_start_of_game_effects.txt (I don't know how important it is to have "02_" in front of the filename in order have the file load straight after "01_start_of_game_effects.txt", but I did so anyway to be safe.) In this text file:

Code:

generate_empty_system_resources = { every_system_planet = { limit = { colonizeable_planet = no } prevent_anomaly = yes clear_deposits = yes set_deposit = d_null_deposit }}

Then after that I opened my solar system initializer text file and changed 'generate_home_system_resources = yes' to 'generate_empty_system_resources = yes' :

Code:

############################### # Testing Starting System ## ##############################@distance = 50@planet_min_size = 10@planet_max_size = 25@base_moon_distance = 10@moon_min_size = 6@moon_max_size = 10# Test Systemcustom_starting_init_test = { class = "rl_starting_stars" usage = custom_empire flags = { empire_home_system } init_effect = { every_neighbor_system = { set_star_flag = empire_cluster every_neighbor_system = { set_star_flag = empire_cluster } } generate_empty_system_resources = yes #THIS IS THE LINE I'M REFFERING TO } planet = { count = 1 class = star orbit_distance = 0 orbit_angle = 1 size = { min = 20 max = 30 } has_ring = no } change_orbit = 35 planet = { count = { min = 1 max = 3 } orbit_distance = 15 class = random_non_colonizable orbit_angle = { min = 90 max = 270 } } planet = { count = 1 orbit_distance = 20 home_planet = yes class = ideal_planet_class orbit_angle = { min = 90 max = 270 } size = { min = 16 max = 20 } deposit_blockers = none modifiers = none init_effect = { prevent_anomaly = yes } init_effect = { generate_empire_home_planet = yes } change_orbit = @base_moon_distance moon = { count = { min = 0 max = 1 } class = random_non_colonizable orbit_angle = { min = 90 max = 270 } orbit_distance = 5 } } planet = { count = { min = 1 max = 3 } orbit_distance = 25 class = random_non_colonizable orbit_angle = { min = 90 max = 270 } } planet = { count = { min = 1 max = 2 } orbit_distance = 20 class = pc_gas_giant orbit_angle = { min = 90 max = 270 } change_orbit = @base_moon_distance moon = { count = { min = 1 max = 3 } class = random_non_colonizable orbit_angle = { min = 90 max = 270 } orbit_distance = 5 } } planet = { count = { min = 0 max = 1 } orbit_distance = 20 class = random_non_colonizable orbit_angle = { min = 90 max = 270 } } neighbor_system = { trigger = { num_guaranteed_colonies >= 2 } distance = { min = 10 max = @distance } initializer = "neighbor_t1" } neighbor_system = { trigger = { num_guaranteed_colonies >= 1 } distance = { min = 10 max = @distance } initializer = "neighbor_t1_first_colony" }}

The result:

Building Solar Systems (419)

(Colonized planets were excluded under "generate_empty_system_resources")

For spawning specific resources, you can look at "generate_home_system_resources" under "common\scripted_effects\01_start_of_game_effects.txt" as an example. It looks like you can decide to add a deposit to the system star, every system planet (as I did above) or a random system planet. The random_system_planet looks like it can be given a condition for the type of planet the game needs to select. I didn't test this beyond the example above. You should play around with it, go nuts, try absolutely bonkers experiments!

I hope this helps and that I didn't waste your time mentioning something you already know.

Last edited:

Show hidden low quality content

You must log in or register to reply here.

Building Solar Systems (2024)

References

Top Articles
Latest Posts
Article information

Author: Saturnina Altenwerth DVM

Last Updated:

Views: 5971

Rating: 4.3 / 5 (44 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Saturnina Altenwerth DVM

Birthday: 1992-08-21

Address: Apt. 237 662 Haag Mills, East Verenaport, MO 57071-5493

Phone: +331850833384

Job: District Real-Estate Architect

Hobby: Skateboarding, Taxidermy, Air sports, Painting, Knife making, Letterboxing, Inline skating

Introduction: My name is Saturnina Altenwerth DVM, I am a witty, perfect, combative, beautiful, determined, fancy, determined person who loves writing and wants to share my knowledge and understanding with you.