Stellaris

Stellaris

[Unmaintained] Automated Repeatables
 This topic has been pinned, so it's probably important
Modders guide to add compatibility [Automated Repeatables, 3.6]
This is my update to the original guide because this mod (Automated Repeatables) changed more than just the mod name.

Welcome!

First part:
Add the country events in a text file in the events/ folder (in different files if you want):
namespace = repeat_colony_register # Replace these with something related to your tech. If you want, you can use one namespace as long as you use different numbers for the 3 event IDs below. namespace = repeat_colony_level namespace = repeat_colony_weight country_event = { id = repeat_colony_register.1 # Change the namespace to what you have above is_triggered_only = yes hide_window = yes immediate = { automated_repeatables_register_repeatable = { CR_NAME = tech_repeatable_colonize_speed.icon # replace by the localisation key holding how your repeatable should be displayed at (name + very small description for example) (see below for loc) CR_FLAG = tech_repeatable_colonize_speed_flag # replace by a UNIQUE flag for that repeatable (1 per repeatable you add) CR_AREA = society # the area (physics/society/engineering) CR_DEFAULT_WEIGHT = 1 # the default weight, can be omitted, BUT has to be either (0 to 10, 15, 20, 25, 50, 100) } } } country_event = { id = repeat_colony_level.1 # Change the namespace to what you have above, and the number if you're using the same namespace is_triggered_only = yes hide_window = yes trigger = { last_increased_tech = tech_repeatable_colonize_speed # the name of the tech } immediate = { automated_repeatables_notify_level_increase = { CR_FLAG = tech_repeatable_colonize_speed_flag # the UNIQUE flag for that repeatable you set above } } } # Here make sure NOT TO FIRE AN INTERMEDIARY EVENT (as this scripted effect needs the FROM) country_event = { id = repeat_colony_weight.1 # Change the namespace to what you have above, and the number if you're using the same namespace is_triggered_only = yes hide_window = yes trigger = { from = { has_leader_flag = tech_repeatable_colonize_speed_flag # the UNIQUE flag for that repeatable you set above } } immediate = { automated_repeatables_apply_weights = { CR_WEIGHT_NAME = tech_repeatable_colonize_speed_weight # a UNIQUE variable name that will old the weight (you can set it to the same as the flag if you want too) } } }

Create a text file in common/on_actions/ using the event IDs you defined earlier:
# automated_repeatables_register_repeatable = { events = { repeat_colony_register.1 # Replace with your register event } } on_tech_increased = { events = { repeat_colony_level.1 # Replace } } automated_repeatables_apply_weights = { events = { repeat_colony_weight.1 # Replace } }

Second part: add the ai weights in your probably existing technology file in common/technology/:
ai_weight = { factor = 1 # Or whatever factor you set before modifier = { weight = 0 has_country_flag = automated_repeatable_initialized check_variable = { which = tech_repeatable_colonize_speed_weight # replace each by the UNIQUE variable name you set previously value = 0 } } modifier = { weight = 100 check_variable = { which = tech_repeatable_colonize_speed_weight value = 1 } } modifier = { weight = 200 check_variable = { which = tech_repeatable_colonize_speed_weight value = 2 } } modifier = { weight = 300 check_variable = { which = tech_repeatable_colonize_speed_weight value = 3 } } modifier = { weight = 400 check_variable = { which = tech_repeatable_colonize_speed_weight value = 4 } } modifier = { weight = 500 check_variable = { which = tech_repeatable_colonize_speed_weight value = 5 } } modifier = { weight = 900 check_variable = { which = tech_repeatable_colonize_speed_weight value = 9 } } modifier = { weight = 1000 check_variable = { which = tech_repeatable_colonize_speed_weight value = 10 } } modifier = { weight = 1500 check_variable = { which = tech_repeatable_colonize_speed_weight value = 15 } } modifier = { weight = 2000 check_variable = { which = tech_repeatable_colonize_speed_weight value = 20 } } modifier = { weight = 2500 check_variable = { which = tech_repeatable_colonize_speed_weight value = 25 } } modifier = { weight = 5000 check_variable = { which = tech_repeatable_colonize_speed_weight value = 50 } } modifier = { weight = 10000 check_variable = { which = tech_repeatable_colonize_speed_weight value = 100 } } }

Third part: You will also need to localise a new string in localisation/english/repeat_colony_l_english.yml (and/or other languages). The list of £icons£ is here[stellaris.paradoxwikis.com]:

l_english: # Your other strings here # In this snippet "tech_repeatable_colonize_speed" is excluded but must be present. Rename for your tech and match the icon string set above. tech_repeatable_colonize_speed.icon:0 "$tech_repeatable_colonize_speed$ (£time£ time)"

There! Done!
Last edited by forbiddenlake; 1 Mar, 2023 @ 2:09pm