Stellaris

Stellaris

Automatic Repeatables - 2.8.*
TheFlyingPotato  [developer] 3 Nov, 2020 @ 2:40am
How to create a compatibility patch
I will go in details file by file. Please note that I haven't made a patch yet and that I'm a bit unfamiliar with my code right now, so I might have overlooked some things. Do not hesitate to contact me if you need help/aren't sure/... You can either use the discussion/comments from steam or use the Stellaris Modding Den Discord server in the stellaris-list-extender channel (better as it allows for easier discussion)

When I use ... I mean one of 3 research field (physics, society, engineering)

common files:
  • Overwrite "AR_upgrade_if_possible_..." in common/scripted_effects/automatic_repeatables_scripted_effects.txt to add your techs near the other "AR_give_tech"
  • Overwrite "AR_select_repeatable_..._random" in common/scripted_effects/automatic_repeatables_select_technology.txt to add your techs to the "random_list"
  • Overwrite "AR_check_researchable_..." in common/scripted_effects/automatic_repeatables_select_technology.txt to add your techs to the "if limit"
  • Overwrite everything in common/scripted_triggers/automatic_repeatables_scripted_triggers.txt to add your techs
  • Overwrite the scripted variables in common/scripted_variables/AR_scripted_variables.txt to set the number of repeatables techs in each field (so vanilla + your techs)
  • Overwrite your techs to add a potential clause similar to the one in AR (to allow shuffle)

events files:
  • Overwrite the events in events/automatic_repeatables_events_allow.txt by adding one option for every tech added. The index of the list is in hexadecimal form (0, 1, 2, 3, 4, ..., 8, 9, a, b, c, d, e, f, 10, 11, ..., 19, 1a, 1b, ..., 1f, 20, ... ff). So use AR_engineering_disallowed_a and not AR_engineering_disallowed_10 for the tenth element.
  • Overwrite the events in events/automatic_repeatables_events_ordering.txt. This is quite annoying to do because you need to add 1 name for every option, and add one option for every tech. Yes, the number of lines of code is roughly proportionnal to the number of techs (in a field) squared. Sadly I lost my code generator so you will have to do it by hand or code a new code generator. Similarly to the previous file, the index of the list is in hexadecimal form (so AR_priority_engineering_a is in hexadecimal a = 10, but the "value = 10" is in decimal form) : "trigger = { check_variable = { which = AR_priority_engineering_a value = 10 } }" is correct.
  • Overwrite the event "automatic_repeatables.10" in events/automatic_repeatables_events_tech_increased.txt to increase the variable tracking the level of your tech and set AR_selected_..._tech to -1 if it was a capped repeatable that reached the cap. Here as well, use "AR_engineering_tech_levels_a" for the level of the tenth tech.

localisation files:
Finally add the needed localisation (use english for languages you couldn't translate).

You don't need to look at the files with "update" in it, they were needed to convert data from an old update to a new one (to be able to continue a playthrough) several months ago so everyone should have updated by now

If the new repeatables have a non-vanilla cost, look at common/automatic_repeatables_scripted_effects.txt to add your way to compute it.

If one of the mod for the patch changes how the techs cost are calculated (like making sprawl higher in some cases) look at the event automatic_repeatables.2