Stellaris

Stellaris

Venture Politics
Hansetron  [developer] 19 Apr, 2020 @ 7:49pm
Compatibility Help Thread
If you ask nicely, I will try to help point out how to fix compatibility between this mod's files and some other mod that you find conflicts with.

If you look at the documentation link in my mod description, it lays out what each file in the mod changes, and whether it changes base game content. This is a great reference to scan through if you notice one thing isn't working and want to find out where it is changed.
Last edited by Hansetron; 20 Apr, 2020 @ 5:36pm
< >
Showing 1-15 of 23 comments
mofocro 20 Apr, 2020 @ 11:19am 
Thanks for making this, I'd really enjoy learning how to do this. So once again, my conflicted mods are reported to be: Venture Politics : Logical Administration Cap Bonus : Civics Expanded +

I tried to modify 03_worker_jobs in the LACB mod by adding your line of code, but was not sure exactly where. I put it below the "possible" section of code. As the Civic + mod did not have the same file from what I could see, I did not modify there.

Next I tried the policy addition from your mod to the Civic+ mod. I believe I modified the megacorp_policies_mod to the mod_policies section of Civic+.
mofocro 20 Apr, 2020 @ 11:22am 
However, I recently tried to just not load Civic+ and I still do not see the science trade policy at all. I am going through all my mods to see what it could be since it is not listing any more conflicts other than those two previously said.
Hansetron  [developer] 20 Apr, 2020 @ 5:19pm 
Okay so when you look at 2 mods, the first thing to do is look at their folder and see the subfolders. When modding stellaris, your mod files have to take on the folder structure of the base game's folder structure, so that it knows where to apply what.
The main one is to look at the "common" folder. This is what most mods primarily change - the common folder is the base data the game uses. There are other folders at the same level as common, namely localisation (how text gets added/updated), events, and gfx (how you add new graphics, icons, etc.)

Almost all mods have a Mod_name/common/ folder, but the key is looking for overlap in the folders beneath that. For example, in this case, you'll see Venture Politics and LACB likely both have a folder called /pop_jobs/. Most folders can have standalone changes; for example, i could write a small update to a particular building and place it in modname/common/buildings/myfile and it will only affect that building. Other mods that changes /buildings/, but not that particular building, won't conflict. If I had defined a new building instead of modified an existing one, there would never be conflicts unless I used the same technical name as some other mod's building.

As I mentioned before, pop_jobs is one of the special ones that is very poorly designed on Paradox's side. If you look at wherever your stellaris game is installed, usually, Steam Library/steamapps/common/stellaris/, you can look in stellaris/common/pop_jobs and see there is one file per "stratum" of jobs - workers, specialists, rulers, primitives, etc.
Within each file is all the jobs in that tier.
Each job is defined like this:
jobname = {
<stuff>
}
This is where a little code literacy is useful - everything within the curly braces is tied to that specific job. Each job is at the "top level" of the file: ie, it's not inside any braces itself.
Within this definition of the job, there are several blocks:
jobname = {
block1 = {}
block2 = {}
...
}
Each block does something specific and is independent of other blocks.
The "possible" block is very common in stellaris' game language, and dictates whether the content can be selected. In this case, when a pop can take this job. Jobs also have a weight block, which influence the algorithm that places pops in jobs that it thinks suits them- like having good traits, etc. We can mostly ignore these.
Almost all jobs have either resources and/or planet modifier blocks. Resources is how a job creates yields of almost everything, like minerals or science. Planet modifiers is how the special resources of trade value, amenities, and stability get added. (This is an extremely poor choice on Paradox's part, since it makes dealing with trade or amenities a coding nightmare.)

Anyways, if you see a mod has 03_worker_jobs, then all you have to do to make it compatible with this one is copy the "resources" block from my clerk job and insert it into their definition of a clerk. Clerks only produce trade and amenities, so they don't normally have a resources - {} block. Make sure you get everything inside the braces; lines 22 to 34 as of this writing.

I'll cover specialist jobs in the next comment.




Hansetron  [developer] 20 Apr, 2020 @ 5:29pm 
Specialist jobs are just like worker jobs, only i touch a few jobs instead of just clerks.
You can ctrl f search "megacorp_mod" to find my comment tags of anywhere i added code. The line numbers refer to my files.
Specifically:
--Bureaucrat Job: lines 1205 to 1208 replace the line "owner = { has_valid_civic = civic_byzantine_bureaucracy }" in regular versions of this code. It simply allows +1 stability to be added by either civic instead of just byzantine. Lines 1215 to 1225, this entire triggered planet modifier, should be added to the bureaucrat job definition (inside bureaucrat = {} but not inside another block.)

--chemist, translucer, gas refiner: in each of these jobs, within their resources = {} block, add my commented "produces" sub-block. Lines 1331-1337 for chemist, 1398-1404 for translucer, 1472-1478 for gas refiner.

--manager job: this one is a bit more involved, but still just transferring code blocks. The entire chunk from 1674 to 1693 covers 2 triggered planet modifiers. This is just adding trade value and extra trade value for thrifty. Then, we have the produces={} sub-block inside resources={}. Lines 1701 to 1708. This handles unity and society.

Hansetron  [developer] 20 Apr, 2020 @ 5:36pm 
The policy file I have only changes the trade_policy code (there are several policies defined int he base file.) So when you look to another mod's policy file, you need to check to see if it already defines trade_policy, and simply add lines 92 to 115 as a new "option" block inside trade_policy = {}. This adds the abbility to take the science policy.
If you added the entire trade_policy block I added to a file that already has trade_policy = {} defined, things will get weird at it will ignore one of them. So we only want to add just the option = {} in lines 92 to 115.
If their policy file doesn't have trade_policy = {} in it, then it should not conflict.

If you look at the documentation link in my mod description, it lays out what each file in the mod changes, and whether it changes base game content. This is a great reference to scan through if you notice one thing isn't working and want to find out where it is changed.
mofocro 21 Apr, 2020 @ 2:13pm 
Awesome! Ya I had to relearn coding syntax from when I took a few classes some years ago but I got it down at the end. Thank you for the help.
Bojangles 26 Apr, 2020 @ 12:16am 
So I'm currently merging a bunch of mods for a modpack for my friends, and I gotta say I really like how you've stated what you've changed in the vanilla files and how you really went into detail with it here. It really makes my life easier and I don't see many modders do that. So thank you!:cozybethesda:
Bojangles 26 Apr, 2020 @ 12:21am 
Oh and marking where you made changes in the files themselves is SUPER NICE!
Hansetron  [developer] 26 Apr, 2020 @ 5:22pm 
@Bojangles I appreciate the recognition. If you have any difficulties, just let me know. I haven't yet updated the documentation for the Maniacal Monopolist civic but that civic is fully standalone.
nomad 28 May, 2020 @ 7:41am 
Great mod and thank you for extensive documentation and code quality, really helps with mod merging, but one major issue I've noticed when trying to fix compatibility with "Ethics And Civics Alternative" is that you both use civic_consumerism for totally different effects.
I know changing the id would affect savegames for players currently using this civic but please consider appending mod name to id of the civics (and other possibly conflicting items) you add from scratch.
ShinyNobody 12 May, 2021 @ 1:51am 
Just a dumb question. i do not know how to mod. but For example Acot adds new capital buildings and they mostly remove ANY speciel added civic jobs. any idea how i can add them to this buildings?
Is this mod compatible with Revolutions?
Hansetron  [developer] 13 May, 2021 @ 3:21pm 
Originally posted by Alice the Scientific Eliksni:
Is this mod compatible with Revolutions?
Glancing at the mod page, there are going to be incompatibilities. I cannot say to what extent, though - the main ones that look like trouble being tied to pop_jobs and possibly random government names.

Only a few civics in this mod rely on adjusted jobs, for example, so it's largely no big deal if you don't take them.

There is only so much I can do to make mods compatible; I am limited by the game code itself.
Hansetron  [developer] 13 May, 2021 @ 3:30pm 
Originally posted by Herr Maledictus Made:
Just a dumb question. i do not know how to mod. but For example Acot adds new capital buildings and they mostly remove ANY speciel added civic jobs. any idea how i can add them to this buildings?
It's tedious but not complicated.

If you go to the ACOT mod folder, you should be able to find where those buildings are defined. It should be like <Whatever mod folder is called>/common/buildings/some_file.txt. Opent his with Notepad++ if possible to make your life easier.

You will see, for the capital buildings, that they have blocks of code called "triggered_planet_modifier" that, if a condition is met, grant jobs.
triggered_planet_modifier = { potential = { exists = owner owner = { has_authority = auth_corporate } owner = { NOT = { has_civic = civic_bancorp } } owner = { NOT = { has_civic = civic_science_syndicate } } } modifier = { job_executive_add = 3 } }
So what we can see above is if the planet's owner has corporate authority, but NOT one of the two civics, the planet gets 3 executives. There are other blocks that catch those civics and add the correct amount of jobs:
triggered_planet_modifier = { #megacorp_mod potential = { exists = owner owner = { has_authority = auth_corporate } owner = { has_civic = civic_bancorp } } modifier = { job_merchant_add = 1 job_executive_add = 2 } }
And here is an example of a block that specifically catches having civic_bancorp.

You can see examples of how this is laid out in <venture politics mod folder>/common/buildings/megacorp_mod_buildings_capital.txt.I tage stuff with comments when i splice in new code for updating existing assets.

I don't know where your steam workshop content sits, so I can't point you to the exact folder path. Make a backup of the file first, but otherwise you should be able to save the file and you'll have the jobs.
Originally posted by hanson825:
Originally posted by Alice the Scientific Eliksni:
Is this mod compatible with Revolutions?
Glancing at the mod page, there are going to be incompatibilities. I cannot say to what extent, though - the main ones that look like trouble being tied to pop_jobs and possibly random government names.

Only a few civics in this mod rely on adjusted jobs, for example, so it's largely no big deal if you don't take them.

There is only so much I can do to make mods compatible; I am limited by the game code itself.

Understandable, wasn't entirely sure what I was expecting but yeah. This is understandable from seeing how this and the Revolutions mod is.
< >
Showing 1-15 of 23 comments
Per page: 1530 50