• 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.
well, if it helps, I just redownloaded CK2Plus (4054d) and ran it with the version of AutoBuild in the directory and it seems to run fine.

Generally the event that has no text or means of closing means that there's something wrong with one of your mod files. The validator can help you track down what mod file needs fixing.
 
EDIT: Google is my friend. I'm looking through everything now. I had some help with looking at cultural conversions earlier in the day and am hoping that the solution is there.
 
Last edited:
Also, I've noticed that the Auto-Build is NOT working with my copy of the game. Even though it is turned on. Do I need anything on top of the CK2+ version of the download? I have the dist downloaded, and extracted the internal folders and .mod into my mod folder. Everything shows up in game, but none of it seems to run. Primarily, none of my holdings are building anything at all.
 
Last edited:
You shouldn't need anything beyond CK2+ and the AutoBuild minimod for CK2+. My test was with that configuration. I do have all the DLC, but that shouldn't matter (at least in the case of AutoBuild.)

Are you sure you have gold and have set the right limits? e.g. by default it only builds in your personal holdings.
 
I toggled it to enable all vassals, and for testing console'd in some gold. It didn't work at all until I turned on Vanilla AB. At which point it gave me two instances of the decision.

I'm also curious if it also builds hospitals and forts, and improves them. If not, I think it should. And this might not be possible, but I think it would also be nice to automatically build holdings based off what they should be by the latest game start. Example: if holding #5 of province B is supposed to be a city based on the history file, then the script builds a city there. However, if Tribal province C is supposed to be a castle, it builds it into a castle. And Tribal Province D is supposed to be a city, it builds a city.

Just ideas. I don't mean to make any unnecessary work for you.
 
That's pretty wild. Well, if it's working for you I'm happy, but I'm not sure what's going on.

It doesn't build hospitals, but it does build buildings in them once they exist. The same goes for trade posts. I'm not sure it's possible to build hospitals/trade posts via commands (it might be, you can add holdings...) the problem is I'd have to add a framework (similar to what I did for buildings) since with commands they are built instantly. And if you start building a holding in the meantime, I'm not sure what I can do other than refund the money you invested. It's something I've thought about, but have no (current) plans to tackle. This might change.

In terms of building what should be there by a certain date, that'd be possible, but it'd require quite a bit of work, and I think it'd be pretty weird, since things can diverge quite a bit from history.
 
Last edited:
That's pretty wild. Well, if it's working for you I'm happy, but I'm not sure what's going on.

It doesn't build hospitals, but it does build buildings in them once they exist. The same goes for trade posts. I'm not sure it's possible to build hospitals/trade posts via commands (it might be, you can add holdings...) the problem is I'd have to add a framework (similar to what I did for buildings) since with commands they are built instantly. And if you start building a holding in the meantime, I'm not sure what I can do other than refund the money you invested. It's something I've thought about, but have no (current) plans to tackle. This might change.

In terms of building what should be there by a certain date, that'd be possible, but it'd require quite a bit of work, and I think it'd be pretty weird, since things can diverge quite a bit from history.
Its only kind of working. It doesn't build any of the CK2+ buildings AFAICT. For some reason I can't get the CK2+ version to work at all. I've even tried a fresh download and reinstall.

And I don't mean to say that it should build cities on specific dates. More over, if its has an empty plot available for construction, that it builds what would hold that tile. Example, looking at Brandenburg in the provincial history folders, It starts with a tribal holding, and a temple holding. The next holding would be a city, Juterborg. Then Berlin (city), Belzig (castle), Ruppin (castle) etc. And it would build those as income allows, following the formula within the history folder. How it would go about deciding to build those next settlements is iffy. I'd say that, if at all, it could do so once the previous settlements all are at a minimum level of profitability. And it would be nice to also build hospitals, trade posts, and even forts. Though those are different beasts all together.
 
That's odd. Both versions just stopped working tonight. I reloaded the save and they just went kaput.

Oh well. Its for the best i suppose, I was about to start a new game anyway.
 
[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.

Updates:
  • 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 2.7)

Mod DB Download Links:
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

Script attached 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
  • 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 (though this is hard coded at the moment, and will not honor mod modifications to the vanilla max reduction of the construction technology (25%).
  • As of the latest version, it should re-enable itself on your dynastic heir when you die with your settings preserved.

Some Screenshots:
View attachment 112112
Baron/County Baron vassal options
View attachment 112113
"Select Building for Construction" event notification...
View attachment 112115
Placeholder buildings (and workers camp) which will be removed when building is completed.
View attachment 112116
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.



I know you might see this...
but I wanted to thank you for making this mod... it has really improved my gaming experiance and has become a must have for me in this game.
Also i wanted to ask if this mod is still supported and if so... are you perhaps going to update the mod for the latest game patch and perhaps the latest ck2+ ?
 
I found a minor bug in the script, and a workaround for those interested:

When using the ' or " character in the mods zip archive name, the generated gets confused.
For example, "flogi's fechmod.zip" will fail the auto generated script.

The work around is to rename the zip file and the reference to the zip file in the .mod descriptor file.
 
I have no idea how to make this work. I unzip the two vanilla files into mod folder, then when i start the game i select autobuild mod, but then in game there is no event whatsoever and nothing would build by itself. What am I missing here?

Edit: I just found the trigger in intrigue tab, dont know how i could miss it before. Really thanks a lot for this mod, saves a lot of time and nerves!
 
Last edited:
Sorry for going so long without reading the thread. Thanks, and yeah I understand the frustration of building by hand... I initially wrote this because I was getting tired of trying to manage a large empire in the Elder Kings mod. Some basic automation for that would go a long way in my opinion.

Any updates with MM? If so is that update Plus compatible?

Probably OBE, but what is MM?

I found a minor bug in the script, and a workaround for those interested:

When using the ' or " character in the mods zip archive name, the generated gets confused.
For example, "flogi's fechmod.zip" will fail the auto generated script.

The work around is to rename the zip file and the reference to the zip file in the .mod descriptor file.

Err, oops. Yeah that's a thing. Turns out I've just been using the workaround myself . I should post a note about it on the first page; or actually fix it. it's pretty edge casey though.
 
How do you get the script to work to build mods for other mods? I'm kinda of a noob in python, but as far as I can tell I got python and jinja, but when I try to run it from console, I get a bunch of errors and nothing happens :x
 
Hey Ishar, first of all great mod. I found a little bug/problem with the latest version of your generator script though. Or at least thats what I think. I just started a new game with a few mods and noticed that when I enabled the autobuild with the newly generated minimod I got a lot of spam regarding starting of construction and instantly finishing it, which was kinda odd, since it did work fine for me before with the same mods. So I tested it with just the vanilla version which worked fine as well. Went poking around in the files created for the minimod and found the following in the modded abse_general.txt:
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_10

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_09

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_08

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_07

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_06

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_05

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_04

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_03

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_02

}
and so on, you get the idea. Now tbh I have no idea about ck2 modding, but as it is different in the vanilla version and setting different flags all after the same check just doesn't seem right to me I thought I might mention it :D
 
Hey Ishar, first of all great mod. I found a little bug/problem with the latest version of your generator script though. Or at least thats what I think. I just started a new game with a few mods and noticed that when I enabled the autobuild with the newly generated minimod I got a lot of spam regarding starting of construction and instantly finishing it, which was kinda odd, since it did work fine for me before with the same mods. So I tested it with just the vanilla version which worked fine as well. Went poking around in the files created for the minimod and found the following in the modded abse_general.txt:
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_10

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_09

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_08

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_07

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_06

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_05

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_04

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_03

}
IF = { limit = {NOT = {has_province_flag=ab_evaluated_time_flag}
check_variable={which="ab_prov_build_mods_time" value=0.0}}
set_province_flag=ab_evaluated_time_flag
set_province_flag=ab_prov_bt_mod_dec_02

}
and so on, you get the idea. Now tbh I have no idea about ck2 modding, but as it is different in the vanilla version and setting different flags all after the same check just doesn't seem right to me I thought I might mention it :D

That is definitely incorrect. I'm not sure how that got generated; the 'value=' bit is supposed to range from the max theoretical 'malus' to build times/costs (computed naively by simply totaling all the modifiers it found; this is probably impossible for all practical purposes) to the max theoretical 'bonus' (assuming it's greater than -99 anyway, since the minimum build time/cost is 1, a -200 bonus is functionally the same as a -99% bonus so it only goes down to -99). It just divides that range into 20 'steps' so for vanilla it's 175,157.5,140...-99, for instance.

Since check is >=, the value is 0.0 so it applies the ab_prov_bt_mod_dec_10 flag which means build times go to 1; thus the "instant" building.

Without knowing what mod you were generating a minimod for, all I can assume is that either there were no build time/cost modifiers in the mod you were generating for, or it didn't find any. That said, it should have applied the "default" flag which doesn't change build time/cost. With more info I can try to replicate the situation.

I might write a check for that edge case as a separate; if it finds no modifiers it doesn't need to generate any of that code anyway. That said, modifiers are pretty ubiquitous, so I imagine it not finding any is some kind of parsing issue.
 
Last edited: