Mods / Auto Config Lib
Author: TheInsanityGod
Side: Both
Created: Jan 7th at 10:34 PM
Last modified: Sep 10th at 8:35 AM
Downloads: 34766
Follow Unfollow 638
Latest release (for Vintage Story 1.21.0 and 1.21.1, potentially outdated):
autoconfiglib_2.0.9.zip
1-click install
Requires: Config Lib
Ever wanted to edit some setting through ConfigLib's mod setting menu, only to realize the other mod doesn't have a ConfigLib implementation? Well I haven't but I'm here to try and fix this anyway.
Features:
- Automated ConfigLib implementation for Typed Configs (meaning configs that have an actual code class associated with it)
- World Config gets added to ConfigLib automatically as well
- Shows description from code documentation*
- Supports data annotation attributes
*This required the creator of the mod to enable the output of the documentation file
Suported data annotations:
- DisplayName (sets the name in config)
- Description (sets the description in config)
- Category (sets the group to display this item under)
- DefaultValue (sets the value to use for the reset button)
- ReadOnly (sets whether this value should be editable or just displayed)
- Browsable (sets whether this item should be visible, by default fields & properties are considered browseable(true) while methods are considered browseable(false) and yes changing this will make the method show up as a button in the config)
- Range (sets the minimum and maximum value for numbers, as long as the min or max is not infinite this will also turn it into a slider)
- MaxLength (sets the maximum length of the string field, default MaxLength is 128)
- DisplayFormat (sets the display format, currently only supports "P" for showing floats as percentages where 0 is considered 0% and 1 is considered 100%)
Note for modders: if you want a more complete code first config management (and not just configLib integration) then consider using InsanityLib instead
| Mod Version | For Game version | Downloads | Released | Changelog | Download | 1-click mod install* |
|---|---|---|---|---|---|---|
| 2.0.9 | 13069 | Sep 10th at 8:35 AM | autoconfiglib_2.0.9.zip | 1-click install | ||
|
enabled world config editor again. (don't know what happend but it works again) | ||||||
| 2.0.8 | 2442 | Aug 28th at 9:51 PM | autoconfiglib_2.0.8.zip | 1-click install | ||
| ||||||
| 2.0.7 | 729 | Aug 26th at 10:53 AM | autoconfiglib_2.0.7.zip | 1-click install | ||
| ||||||
| 2.0.6 | 12863 | Feb 12th at 4:39 PM | autoconfiglib_2.0.6.zip | 1-click install | ||
|
Fix edge case where Harmony can't find Assembly because I'm patching the method :P | ||||||
| 2.0.5 | 401 | Feb 11th at 3:34 PM | autoconfiglib_2.0.5.zip | 1-click install | ||
|
Changed execution order so my mod always loads first | ||||||
| 2.0.4 | 2394 | Jan 27th at 9:03 PM | autoconfiglib_2.0.4.zip | 1-click install | ||
|
Fixed the exact same issue as in the previous release but this time for my own mod config lol | ||||||
| 2.0.3 | 173 | Jan 27th at 8:20 PM | autoconfiglib_2.0.3.zip | 1-click install | ||
(only happens the first world load after adding a new mod) | ||||||
| 2.0.2 | 1443 | Jan 15th at 4:30 PM | autoconfiglib_2.0.2.zip | 1-click install | ||
| ||||||
| 2.0.1 | 300 | Jan 12th at 8:36 PM | autoconfiglib_2.0.1.zip | 1-click install | ||
|
Big refactor of code to allow for way better rendering and other features | ||||||
| 1.2.3 | 297 | Jan 9th at 6:26 PM | autoconfiglib_1.2.3.zip | 1-click install | ||
| ||||||
| 1.2.1 | 225 | Jan 8th at 4:07 PM | autoconfiglib_1.2.1.zip | 1-click install | ||
| ||||||
| 1.1.0 | 199 | Jan 8th at 9:43 AM | autoconfiglib_1.1.0.zip | 1-click install | ||
|
Added more:
| ||||||
| 1.0.0 | 231 | Jan 7th at 10:43 PM | autoconfiglib_1.0.0.zip | 1-click install | ||
|
initial release | ||||||
TrainDoc, nothing apperently. Not sure what broke it as it seems to work again now (prob indirectly fixed it without realizing it)
TheInsanityGod, thanks for the swift update support for 1.21, it's greatly appreciated. What are the blocking issues for getting world config back into the menu? Totally understand if it's something that's in the horizon to fix and isn't simple, just wanted to inquire as to it's status. Thanks for auto config lib, it makes my life so much easier in terms of dealing with all the mods I use!
Damage_Zedd, Roflnomish
Issue should be fixed in new release.
fixed (i disabled the mod "Configure Everything" https://news.kalataka.ru/show/mod/10411 and it fixed this issue.)
im having the issue where it says
'AutoConfigLib could not create auto config for `{configPath}` because they requested config before AutoConfigLib was started'
mods giving trouble
Roflnomish
Spoiler
MischievousCloud, what makes you think that config is from AutoConfigLib? for as far as I can see that mod has actual configLib support itself meaning my mod has no relation to it. (it does so through JSON even, meaning AutoConfigLib wouldn't even notice it exists)
PS: All automatic ConfigLib implementation are labeled with '(auto)'
This mod creates a config for https://news.kalataka.ru/show/mod/18932 this backpack mod but it creates typos. I try to manually adjust the config and it auto edits it back to the incorrect item id with the typo. Not sure where the typo is coming from as I looked in the json on the backpack mod and its spelled correctly. I will reach out to that mod author as well.
Roflnomish, If you are talking about:
'AutoConfigLib could not create auto config for `{configPath}` because they requested config before AutoConfigLib was started'
Then this has no relation to the world not loading (this is a non fatal error I'm manually logging and would at most mean you can't see that config in ConfigLib). I have some ideas on how to deal with this, could you tell me a mod with which this occurs with so I can test my solution?
is there any way to force this and configlib to load first? just tried loading my world and it spammed the console with errors that this mod was trying to do stuff with configs but other mods had requested the config first, and it wouldn't load the world
Kadlore, once I finish updating/fixing my other mods I'll try to figure what exactly 1.21 changed and bring the world config window back.
Hi, any idea if world config will be back with this mod?
CarryOn seems to have fixed this issue on their side and I've added some handling so it will throw a warning instead of crashing when/if another mod attempts to do the same.
I think I have a fix for CarryOn - just need to do more testing.
Would it be possible to add the ability to blacklist mods from hooking into Autoconfiglib? Carry On had a recent update that broke it when loaded alongside Autoconfiglib and I was just thinking it would be nice to have in the future for cases like this.
Here's the issue for reference: https://github.com/NerdScurvy/CarryOn/issues/37#issue-3349773393
MRGOOSE, no. Unfortunately there is no way to tell wether a config is relevant to the server, client or everyone.
if i use this on a server does it sync the configs with server or not
McTaco, this mod does not generate configs. As mentioned in the description, this mod auto creates ConfigLib Implementations for Typed Configs (meaning configs that have an actual code class associated with it)
Content mod => No Code => No Typed Config
Doesn't seem to generate a config for content mods such as
FotSA mods
Excellent, thanks very much!
CKitt should be compatible with any 1.20 and probably even any 1.19.8 version.
Usually mods don't break from a minor version upgrade but this mod in particular barely touches game code at all so unless ConfigLib made some drastic change it should work just fine on most versions
Wow, you're fast! Thanks very much. Is v2.0.6 ackwards compatible with 1.20.3? I started a long-term world, so I'm avoiding release candidates and sticking with stable now.
CKitt, just took a look and 'Texture Atlas Resized' still crashes even after the config generation.
Was a problem with harmony itself, fix is out now.
RowanSkie, what do you mean with this?
I only register configs that have an actual config file other then the WorldConfig, which doesn't run any code for the save button in the first place.
(I can't say much more without more info, like a log file or a reproduction path)
It seems like this crashes the game when you're trying to save a config that doesn't exactly have a config. Maybe find a way to catch/disable the save option for those without proper configs?
I think I found a weird incompatibility. When I installed Texture Atlas Resized it couldn't generate the normal config file, until I had removed Auto Config Lib and reopened a world. Afterwards, I reenabled this mod. Once I did that, everything was good to go.
Ossom,
This is actually the wrong exception 😅, you only get this exception because an earlier exception during mod startup occured (which wasn't considered fatal by vintage story for some unknown reason).
Should be fixed in newest version (it was a load order issue).
AutoConfig+RPVoiceChat on a server crashes clients
Just a heads up, there seems to be an issue between AutoConfigLib 2.0.4 and RPVoiceChat 2.3.12, but only on servers!
If AutoConfig is on the server and the client, the client will crash on connect, otherwise when only ConfigLib and RPVoiceChat is on the server, plus requirements, no problem.
First issue cropped up with a large modpack, the log of which i'll leave below, adding mods by groups till i found the issue is how i found the issue, and then checking client vs server setups is how i confirmed the issue.
Running on 64 bit Windows 10.0.19045.0 with 32636 MB RAM
Game Version: v1.20.3 (Stable)
09/02/2025 02:21:03: Critical error occurred
Loaded Mods: aculinaryartillery@1.2.3, ancientarmory@1.0.6, antlershorns@1.0.1, backpackpackpluscontinued@1.0.0, barkbeetle@1.0.3, scrapblocks@1.1.0, bettertraders@0.0.9, canoemod@1.0.2, clickuptorches@1.1.1, combatoverhaul@0.1.24, craftablecompanion@1.2.1, craftablejparts@1.0.0, expandedmolds@1.1.1, firestarters@1.4.2, goblinears@2.1.1, handtohand@1.0.3, indappledgroves@2.0.3, litbrig@0.7.3, long-term_food@0.2.1, manualdough@1.1.1, manualquenching@1.0.4, manualscraping@1.2.1, millwright@1.1.8, nudemod@1.0.0, polylocusts@1.0.1, primitivesurvival@3.7.5, prospecttogether@2.0.1, qolcraft@2.1.2, recyclemetalwork@1.0.3, repairablelocust@1.4.0, slowwalkmod@1.2.2, sticksarefirewood@1.0.0, undertangledboughs@1.0.2, upgradeablelocust@1.0.3, visibleore@1.0.1, game@1.20.3, vsimgui@1.1.7, wetlandharvest@0.0.1, AbsoluteProspecting@1.500.02, alchemy@1.6.42, armory@0.1.5, awearablelight@1.1.31, betterruins@0.4.6, bloodystory@0.0.13, butchering@1.7.8, carryon@1.8.0-pre.1, coinage@1.12.2, commonlib@2.6.1, configlib@1.4.4, foodshelves@1.5.1, gourmand@1.6.3, hydrateordiedrate@1.7.7, krpgenchantment@0.6.13, maltiezcrossbows@0.6.5, maltiezfirearms@0.10.7, metaltongs@1.2.1, monsternuggetdrops@1.0.0, spearexpantion@0.3.0, petai@3.0.1, pewter@1.0.0, rpvoicechat@2.3.12, rustboundmagic@2.1.48, smithingplus@1.1.8, stonebakeoven@1.1.6, trailmodcupdate@1.2.1, traitacquirer@0.9.6, unconscious@1.9.2, creative@1.20.3, survival@1.20.3, woodenfortifications@2.0.4, autoconfiglib@2.0.4, em@3.0.0, playercorpse@1.11.0, shearlib@1.1.2, stonequarry@3.4.3, wblockadj@1.0.0-dev.2, wtweaks@1.0.0-dev.5, wolftaming@3.0.3, theworkingclasses@1.0.3, wool@1.5.2
System.Exception: Don't know how to instantiate item of class 'soundemittingitem' did you forget to register a mapping?
at Vintagestory.Common.ClassRegistry.CreateItem(String itemClass) in VintagestoryLib\Common\ClassRegistry.cs:line 323
at Vintagestory.Common.ItemTypeNet.ReadItemTypePacket(Packet_ItemType packet, IWorldAccessor world, ClassRegistry registry) in VintagestoryLib\Common\Network\ItemTypeNet.cs:line 18
at Vintagestory.Client.NoObf.ClientSystemStartup.PopulateItems(List`1 items, Int32 listSize) in VintagestoryLib\Client\Systems\Startup.cs:line 590
at Vintagestory.Client.NoObf.ClientSystemStartup.LoadItemTypes() in VintagestoryLib\Client\Systems\Startup.cs:line 402
at Vintagestory.Client.NoObf.ClientSystemStartup.HandleServerAssets_Step1() in VintagestoryLib\Client\Systems\Startup.cs:line 344
at Vintagestory.API.Common.TyronThreadPool.<>c__DisplayClass13_0.<QueueTask>b__0(Object a) in VintagestoryApi\Common\TyronThreadPool.cs:line 121
at System.Threading.QueueUserWorkItemCallback.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
That's... actually really funny as far as oversights go! 😅
I'm glad it was a harmless error, but I figured it was better to mention it than not.
Edit: And I'm glad I can reenable it. Useful mod.
CKitt, thanks for the heads up but it works just fine with BedSpawn, it's my own config that's failing.
I just made an update that shows a message in the config that inform people about configs failing to bind because the config didn't exist yet (when you load a mod for the first time)... and I never bothered to check if my very own mod config might have the same issue lol.
PS: Should now no longer happen (not that you would notice since you already have the config now)
There seems to be an incompatibility with this mod and BedSpawn. I figured I'd give you a heads-up!
[Client Error] Failed to load AutoConfigLibConfig.json using default, exception: System.NullReferenceException: Object reference not set to an instance of an object.
at AutoConfigLib.Auto.AutoConfigGenerator.RegisterOrCollectConfigFile[T](ICoreAPI api, String configPath, T configValue) in D:\Modding\VintageStory\AutoConfigLib\AutoConfigLib\Auto\AutoConfigGenerator.cs:line 24
at AutoConfigLib.AutoConfigLibModSystem.StartPre(ICoreAPI api) in D:\Modding\VintageStory\AutoConfigLib\AutoConfigLib\AutoConfigLibModSystem.cs:line 58
Currently, no. but it's something I do plan on adding. evil1505
is there anyway to allow a player via a server to use auto config on server files
TheInsanityGod Sorry, called it a bug because it came from the server.main log throwing errors that mentioned this mod & the other one. I disabled this until I add more mods since I only need to generate the configs once (afaik), but yeah, I wouldn't be surprised if they've hardcoded in file paths to the dll, I was just very amused to have this insight into someone else's folder structures this way. No other mods had similar interactions so I doubt the issue is on your end.
SageOceiros, If you are talking about the xml files it's reading then this is not a bug.
As mentioned in my feature list this mod "Shows description from code documentation*" (*This required the creator of the mod to enable the output of the documentation file)
'documentation file' referring to the global standard in which documentation is provided for .dll files. These are (similarly to the SomeModName.pdb file, if provided) stored at the exact same location as the SomeModName.dll but with a different extension (SomeModName.xml)
Asside from that this mod merely intercept the call to api.LoadModConfig(filename) and use the filename and return value of this call to register it in ConfigLib. This mod makes no decisions about where these files are stored (directory is either decided by the game & other mod, or by where the used .dll file is located)
Since you called this a bug, are you experiencing some form of issue with this? (like crashing?)
(ps: I just looked at their code and I was horrified by what I saw :P)
Got a very interesting bug when it tried to run on Moves Like Kaji, where it tried to pull files from hardcoded locations, which included a user's C:/ drive complete with windows account name, and their D:/ drive modding folder. Very amusing. Not sure if this mod is the cause though.
Somehow I added this without adding config lib, due to somehow not realizing that config lib was a required mod and this wasnt like CombatOverhaul and Bullseye being inside of it.
Good mod!
Kwehlani, thanks for the mod list, should work in the newest release.
ps: I already had and upate ready locally and these mods load just fine together for me so I just released it :P
TheInsanityGod
It is a slightly long list of mods, but I will hyperlink all the related items!
I did see that a few of these were able to auto create config files in your example photos, so I'm not sure what's up with my game! 😅
Xerog, thank you for reporting this issue, it should be fixed by the new release.
Kwehlani, the only condition is that the config needs to have an actual code type associated to it.
(as in the mod needs to call api.LoadModConfig<CustomModConfigType>(ConfigFileName))
If you want me to check why some mod isn't getting an AutoConfig please mention the actual mod name
It crashed my game when I was trying to get into https://news.kalataka.ru/show/mod/367 Xandus inventory tweaks.
Hey!
Are there any specific conditions or buttons that need to be pressed to enable the auto creation of the config files? I was unable to get this to work and still only have my default configlib compatible mods available to edit.
Thanks!