[MiniMod] AutoBuild Buildings in Holdings (and Generator Script)
Generated minimod to automatically select buildings to build in your holdings. I didn't want to make it an complete cheat, and in trying to do so I ended up with a slightly convoluted scheme which currently appears to function.
I don't think there are any huge outstanding issues, though in particular, various MiniMods might have issues that need to be discovered and worked through; though none were glaringly obvious.
Adding this to an in-progress game should not cause any problems; since it does create events, removing it might do so, though you can disable it (via config menu), and wait a few months, and all queued events should have went away.
Note that the script is currently only guaranteed to be compatible with python 2.7. Also note that it requires the python library Jinja2 to run.
Known Issues:
Steam Links:
Vanilla (CK2 3.2.1)
Mod DB Download Links:
CK2 3.2.1
Various Minimods + Vanilla
CK2 3.1.0
Various Minimods + Vanilla
CK2 3.0.1 [Updated 19-1]
Various Minimods + Vanilla [19-1]
Script for creating your own:
19-1
A 'release' version is attached and git links are provided below for the technically minded; shouldn't mess up anything by default though you will almost certainly have to configure some directories (such as your CK2 installation directory). See above links for downloading the minimods.
Technically speaking
Some Screenshots:
Baron/County Baron vassal options
"Select Building for Construction" event notification...
Placeholder buildings (and workers camp) which will be removed when building is completed.
Modifier displaying that something is being auto-built in the province, and how long until it is completed.
It is, admittedly, somewhat convoluted. I welcome any idea's to simplify (or optimize) it; for some mods (lux invicta, for example) the generated events are quite large, but for the vast majority they are fairly small. I also welcome any other feedback, feature requests, or bug reports.
Generated minimod to automatically select buildings to build in your holdings. I didn't want to make it an complete cheat, and in trying to do so I ended up with a slightly convoluted scheme which currently appears to function.
I don't think there are any huge outstanding issues, though in particular, various MiniMods might have issues that need to be discovered and worked through; though none were glaringly obvious.
Adding this to an in-progress game should not cause any problems; since it does create events, removing it might do so, though you can disable it (via config menu), and wait a few months, and all queued events should have went away.
Note that the script is currently only guaranteed to be compatible with python 2.7. Also note that it requires the python library Jinja2 to run.
Known Issues:
- If you run the script, I didn't account for special characters in mod archive names (e.g. flogi's techmod.zip). As a work around, if you modify the zip name and reference in the .mod file, it will work just fine.
- Localization is absolutely terrible and based on a combination of google translate and string substitution (e.g. "Tu hablas {}?").
- It ignores bloodline related bonuses to build times / build costs.
- Generated a version for 3.2.1; seems to work fine and didn't require any script changes.
- Script updated, see ck2autobuild-19-1a.zip. I really should look before I leap. In previous release it was impossible to actually get the "max discount" flag.
- Script updated, see ck2autobuild-19-1.zip. I fixed an issue related to build cost/time modifiers. Unless a building takes a few centuries to build the time/cost can now be reduced to 1. This is to match what the CK2 does (in the build window) if you have really high build time/cost modifiers. Unlikely to apply in Vanilla, but applies to some mods.
- Script updated, see ck2autobuild-18-12.zip. I fixed some issues with bulk_update being dumb, and fixed numerous issues associated with trying to properly check event_modifiers to build times. I implemented artifacts. I wrote code for bloodlines, but turned it off when I realized there was no simple way to compare bloodline types (e.g. detect if a character has any builder bloodline) without using flags.
- Initial release for 3.0. No script updates necessary for basic functionality, though it ignores bloodline related building speed/cost bonuses. Prerequisites are checked, so figured I'd release before diving into parsing the bloodline related stuff.
- Updated 7/26/2018 with minor changes to the python script; namely some edge cases with reading archive files in other mods as well as issues with mods that had buildings with no build costs. See ck2autobuild-18-7.zip.
- Updated 4/22/2018 with really minor changes to the python script; there was an issue with the way it was generating decisions that came up. Updates to the releases to follow, but for now please use dist_ab-18-4.zip.
- Uploaded generated files for 2.7; so far script updates have not necessary with new patch.
- Updated 2/4/2017 with changes to how it determines build_time and build_cost modifiers. It now parses technology.txt, job_actions, and event_modifiers and attempts to check for the total build_time/build_cost modifier from all sources before it starts building something. Due to the large number of possible combinations, it maps the number found to a evenly distributed 10 point scale based on the theoretical max modifier (which is usually 99% based off a chancellor with crazy stats.) Also added support for parsing zipped mods (e.g. steam mods) when considering what minimods to generate. This version also added a requirement of the python jinja2 library. Attached as dist_ab-17-2.zip
- Updated 1/11/2017 with a hotfix for 17-1d. My internal changes introduced issues with ports being built in the wrong places and re-enabling autobuild after disabling it. Steam / ModDB links below are updated. Script attached as AB 17-1d Fix.zip.
- Updated 1/11/2017 with more internal changes. Did lots of things to make the files smaller. It certainly generates minimods faster (down to seconds again after creeping up to minutes for some of the bigger mods.) I did some experiments with control flow tracking through logging and dramatically reduced the number of scope blocks so it should execute faster. In theory. Attached as AutoBuild 17-1d (CK2 2.6).zip.
- Updated 1/7/2017 with a hotfix to the previous file. I forgot a tab character and well, that's pretty bad news in python. Worse, in this case, it lead to a logic error that I didn't notice for half a day. Whee. Fix attached as AutoBuild 17-1c hotfix (CK2 2.6).zip.
- Updated 1/7/2017 mostly with back end changes to take advantage of new modding features and generate shorter, better mod code. Attached as AutoBuild 17-1c (CK2 2.6).zip. A consolidated zip with the minimods regenerated with 17-1c is available at ModDB and linked below.
- Updated 1/2/2017 to fix an issue that only seemed to effect the Elder Kings minimod. Note that 17-1 (attached as AutoBuild 17-1 (CK2 2.6).zip) is a fairly major rewrite of the internals of the script (and to a lesser extend, the generated mini mod files) in preparation for a future design overhaul.
- Updated 12/26/16 for general compatibility with 2.6. Added support for hospitals, fixed trade posts and family palaces. Menu is now sorted, and more important options are at the top. Fixed various minor issues/edge cases with other mods. Available as (AutoBuild 16-12 (CK2 2.6).zip)
- Updated 8/22/15 for general compatibility with 2.4.4. Script attached (AutoBuild-CK2 2.4.4-version1.zip)
- Updated on 5/12/15 to fix an issue with double billing and one with the AGOT 0.9.5.
- Updated on 1/6/15 to fix issue with pagans and prestige. dist_ab_1_6_15.rar
- Generated for Vanilla 2.3 autobuild-dist for 2.3.4 version 1.zip
- Generated for Vanilla 2.2.1 and versions for various existent mods.
- Now ignores buildings with 0 build time. This pertains to odd buildings in the AGOT mod, but shoudln't affect any other mods.
- Now uses location = { port = yes } to avoid trying to construct buildings with port = yes in the definition in landlocked provinces.
- Updated for 2.2; in my limited testing it seems to work (understands prestige, has prestige reserves). The script itself *should* be backwards compatible but no effort was made to ensure that. See ModDB for a MiniMod downloads.
- Found a silly bug (tabbing error) in script that invalidated all potential blocks. Attached script is fixed version, minimod downloads are updated as well.
- The mods no longer use the .zip file bit; they are now regular directories (like most mods) which should simplify installation a bit.
Steam Links:
Vanilla (CK2 3.2.1)
Mod DB Download Links:
CK2 3.2.1
Various Minimods + Vanilla
CK2 3.1.0
Various Minimods + Vanilla
CK2 3.0.1 [Updated 19-1]
Various Minimods + Vanilla [19-1]
Script for creating your own:
19-1
CK2 2.8.3.X
Various Minimods + Vanilla [18-7]
CK2 2.7
Various Minimods + Vanilla [17-2]
CK2 2.6
Various Minimods + Vanilla [17-2]
Variousl MiniMods + Vanilla [17-1e]
Various Minimods + Vanilla [17-1d]
Various MiniMods + Vanilla [17-1c]
Vanilla 2.6
Warhammer 1.02
Castles Expanded 23-0-3
Castles Expanded No Tech 23-0-3
Middle Earth Project 0.7
CK2Plus 4.05.4b
Lux Invicta 0 6k11
HIP RD 2016-11-25
WTWSMS 0.9.9.1
AGOT 1.3.2
Elder Kings 2.0
CK2 2.4
Vanilla 2.4
CK2+ 3.11
HIP
Warhammer
Your Personal Castle
WTWSMS
CK2 2.3.4
Vanilla 2.3.4
AGOT 0.9.6
COTC 0.10.1
AutoBuild WTWSMS 0.9.5
AutoBuild Flogi's TechMod
CK2 2.3
Vanilla 2.3
AutoBuild [HIP 2014-12-18] CK2 2.3
AutoBuild NMIH Alpha phase 0.0.7.x (CK2 2.3)
AutoBuild Diadochi Kings 0.2.3 (CKII v2.3)
AutoBuild CK2Plus 2.3
AutoBuild Flogi's Technology & Buildings Mod
AutoBuild Witcher Kings
AutoBuild After the End 0.4
AutoBuild [HIP 2015-01-24]
AutoBuild AGOT 0.9.2
AutoBuild Project Augustus
AutoBuild When the World Stopped Making Sense
CK2 2.2.1
ck2 Vanilla 2.2.1
AGOT 0.9
Diadochi_Kings 0.2.2
HIP - CM - 2014-11-19
Lux Invicta v06k2
NMIH 0.0.6.x Alpha
MiniMod for CK2 Vanilla 2.2
MiniMod for CK2 Vanilla 2.1.6
Various Minimods + Vanilla [18-7]
CK2 2.7
Various Minimods + Vanilla [17-2]
CK2 2.6
Various Minimods + Vanilla [17-2]
Variousl MiniMods + Vanilla [17-1e]
Various Minimods + Vanilla [17-1d]
Various MiniMods + Vanilla [17-1c]
Vanilla 2.6
Warhammer 1.02
Castles Expanded 23-0-3
Castles Expanded No Tech 23-0-3
Middle Earth Project 0.7
CK2Plus 4.05.4b
Lux Invicta 0 6k11
HIP RD 2016-11-25
WTWSMS 0.9.9.1
AGOT 1.3.2
Elder Kings 2.0
CK2 2.4
Vanilla 2.4
CK2+ 3.11
HIP
Warhammer
Your Personal Castle
WTWSMS
CK2 2.3.4
Vanilla 2.3.4
AGOT 0.9.6
COTC 0.10.1
AutoBuild WTWSMS 0.9.5
AutoBuild Flogi's TechMod
CK2 2.3
Vanilla 2.3
AutoBuild [HIP 2014-12-18] CK2 2.3
AutoBuild NMIH Alpha phase 0.0.7.x (CK2 2.3)
AutoBuild Diadochi Kings 0.2.3 (CKII v2.3)
AutoBuild CK2Plus 2.3
AutoBuild Flogi's Technology & Buildings Mod
AutoBuild Witcher Kings
AutoBuild After the End 0.4
AutoBuild [HIP 2015-01-24]
AutoBuild AGOT 0.9.2
AutoBuild Project Augustus
AutoBuild When the World Stopped Making Sense
CK2 2.2.1
ck2 Vanilla 2.2.1
AGOT 0.9
Diadochi_Kings 0.2.2
HIP - CM - 2014-11-19
Lux Invicta v06k2
NMIH 0.0.6.x Alpha
MiniMod for CK2 Vanilla 2.2
MiniMod for CK2 Vanilla 2.1.6
A 'release' version is attached and git links are provided below for the technically minded; shouldn't mess up anything by default though you will almost certainly have to configure some directories (such as your CK2 installation directory). See above links for downloading the minimods.
Main Repo:
https://gitlab.com/jeremy.kackley/ck2autobuild
CK2Lib Repo: (to avoid shared code between AB and my other projects)
https://gitlab.com/jeremy.kackley/ck2lib
https://gitlab.com/jeremy.kackley/ck2autobuild
CK2Lib Repo: (to avoid shared code between AB and my other projects)
https://gitlab.com/jeremy.kackley/ck2lib
Technically speaking
- Parses vanilla buildings + mod added buildings (excludes vanilla buildings if mod replaces the building directory...)
- Generates a decision that honors wealth, prestige, technology, prerequisite, and potential requirements, and selects buildings.
- Generates a configuration menu to enable/disable auto building (per character), set gold reserves, and enable/disable building buildings in vassal baron or county baron holdings.
- A province modifier lets you know how long until the current building is built.
- Placeholder buildings are used to store/communicate what is being build, but do not currently 'block' building the building or other buildings; and do not provide any stats.
- The placeholder is replaced by an event, and if the building that was under construction was built in the meantime, it's cost is refunded.
- Local Construction cost/time reductions are honored, more or less.
- As of the latest version, it should re-enable itself on your dynastic heir when you die with your settings preserved.
Some Screenshots:
Baron/County Baron vassal options
"Select Building for Construction" event notification...
Placeholder buildings (and workers camp) which will be removed when building is completed.
Modifier displaying that something is being auto-built in the province, and how long until it is completed.
It is, admittedly, somewhat convoluted. I welcome any idea's to simplify (or optimize) it; for some mods (lux invicta, for example) the generated events are quite large, but for the vast majority they are fairly small. I also welcome any other feedback, feature requests, or bug reports.
Attachments
-
DanHHoE.png4 MB · Views: 1.012
-
cbrhknC.png1,1 MB · Views: 890
-
JNIukv3.png1,2 MB · Views: 665
-
dist_ab_1_6_15.rar138,9 KB · Views: 60
-
autobuild-dist for 2.3.4 version 1.zip157,2 KB · Views: 30
-
AutoBuild-CK2 2.4.4-version1.zip158,3 KB · Views: 41
-
AutoBuild 16-12 (CK2 2.6).zip198,2 KB · Views: 9
-
AutoBuild 17-1 (CK2 2.6).zip210,4 KB · Views: 12
-
AutoBuild 17-1c (CK2 2.6).zip211,7 KB · Views: 8
-
AutoBuild 17-1c hotfix (CK2 2.6).zip190,2 KB · Views: 10
-
AutoBuild 17-1d (CK2 2.6).zip235,2 KB · Views: 17
-
AB 17-1d Fix.zip237,8 KB · Views: 23
-
dist_ab-17-2.zip321,7 KB · Views: 60
-
dist_ab-18-4.zip319,7 KB · Views: 83
-
ck2autobuild-18-7.zip167,1 KB · Views: 59
-
ck2autobuild-18-12.zip246,1 KB · Views: 16
-
ck2autobuild-19-1.zip246,4 KB · Views: 9
-
ck2autobuild-19-1a.zip247 KB · Views: 213
Last edited: