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

Swizzlewizzle

First Lieutenant
7 Badges
May 6, 2016
214
49
  • Magicka
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Megacorp
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
Hello all. I am trying to create a custom empire initializer to be used by a premade race in a static, premade galaxy.

In terms of the planets themselves (buildings, blockers, etc..) everything has worked exactly as expected.

However, when I start to try to "set_owner" and "create_pop" using the init_effect section, nothing seems to register. It also seems as though the vanilla empire initializers do not include any creation of pop.... this leads me to believe that the ownership and population spawning of an initializer called using a premade galaxy is causing all pop/ownership changes to be overwritten.

Here is the code for the system I am trying to spawn pops (and give ownership of two planets) on empire spawn:
http://pastebin.com/JwKc91DT

It seems that chain spawned systems from "neighbor_system" also are not giving ownership correctly even though the planets/buildings/etc.. seem to be being created fine as well.

Any ideas on if this indeed is being overwritten, or workarounds?
 
I think the problem is that you're using set_owner at all. create_pop definitely does work (the Fallen Empire initializers use it), so the issue has to be something to do with how you're assigning the system to the Romulans.

By using set_owner = ROOT, you're likely setting the empire owner to the thing which generates the universe in the first place, which is a null player. Hence, no species for the pops to belong to and no owner for the planet to have. Try just setting it up as a custom species empire initializer with usage = custom_empire instead.
 
Had no idea there was a "custom_empire" usage (didn't see it in the example.txt initializers).

You mean to set usage as custom_empire and remove set_owner? However, for remus I do need to set the ownership as by default whatever hard code that sets up the empire runs seems to place 7 pops *only* on the primary planet set as starting planet.

Is there anything I can do to get set_owner running correctly on multiple other planets?

*Edit: Just wanted to add.. even for Romulus i'm not getting additional pops even though the owner is not set explicitly.. so it doesn't seem to be working either way.
 
Last edited:
Well, how have you got the Romulans set up in the prescripted empire file? As far as I can see, the game reads the prescripted country, finds the name of the planet in there, then goes and finds the initializer for it to determine where it's sending the POPs. The other planets should belong to them if they're part of the same Empire Intiializer.

I suggest you take a good long look at the Fallen Empire init file, since it does most of what you're looking to do here - multi-planet empires, spawning additional pops etc.
 
Yes actually the code here is largely from the fallen empire code in which is uses set_owner = root to set the owner. That's why i'm confused that it's not working since the scopes and everything are the same.

Still not able to get this to work. :(
 
Just wanted to add... the example file indicates that the scope is a galactic object where Root points to the first system in the tree. I tried set_owner = root.space_owner and didn't have any success though... To be honest though.. there should be no reason why my add pop code isn't working on romulus, since that is definitely owned by me for sure. :)

*Edit: Update, the pops are spawning when I manually set the species (in this case species = "human" for testing) (not using owner_main_species which works for the fallen empire initializers).. however, still having issues getting any sort of ownership on additional planets working.. :(

The main thing I don't understand is that... the fallen empire initializers are also run at game start but the same code for them does not work for empire initializers in terms of ROOT and setting ownership.
 
Last edited:
Naselus are you able to get anything working on your side using the fallen empire related code? For some reason set_owner = root doesn't work when used by an empire initializer.. perhaps fallen empires are initialized in a slightly different way by the code? I'm trying to see if there is a way I can manually set the owner via using the name of the empire... however.. set_owner = "some empire" doesn't seem to work when using a name. I wonder if there is a way to pick an empire using a empire flag?
 
Alright, so I solved this issue... for anyone who encounters this problem and/or wants to create initializers that give multiple planets on game start (directly through the initializer)...

It seems that the empire initializers create the system *before* the empire has been initialized or given ownership of the system.. thus you cannot grab the owner by root.space_owner or whatever.

Instead, what you should do is the following:

Code:
every_country = {
                limit = {
                    has_country_flag = romulan_empire
                }
                save_event_target_as = romulan_empire
            }

            set_owner = event_target:romulan_empire

What this does is allows you to directly bring in an empire (that only has it's basic initialization done by this point) and set it as the owner/w/e you want right here via using flags. You should define whatever flags you need in the empire's setup using: flags = { romulan_empire flag2 noFTL minor_faction } like that. Doing it this way, you should be able to set up pre-created empires in very advanced and detailed ways.

I hope this helps, and if anyone finds issues with this code, please do add to the solution so that others in the future won't have this problem. :)

*Edit: however, note that each init_effect is treated as it's own "event".. so for other planets, you will have to set an event target again (or alternatively you could create global event targets... probably not a good idea though)
 
  • 1
Reactions:
Had a feeling it would be something alone those lines :)