Avorion

Avorion

28 ratings
Config Loader
   
Award
Favorite
Favorited
Unfavorite
Mods: Mod
File Size
Posted
Updated
59.151 KB
Feb 21, 2020 @ 10:39am
Sep 20, 2021 @ 11:22pm
13 Change Notes ( view )

Subscribe to download
Config Loader

Description
Networking and saving of mod configs made easy.
--Graphics design is my passion.

Usage:

Create config/config.lua and have that file return a table with your values in it.

In your file loading the config do:
package.path = package.path .. ";data/scripts/lib/?.lua"
local Config = include("ConfigLoader")

Then you can index your values as if it was returning that table from config/config.lua ie:
Config.myvalue will return config.lua's myvalue property.


TLDR:

1. Create lua file in scripts/config/ that returns a table with your values in it
2. Include the configloader as a variable and index your values as if it were that table from the config folder


Additional Info:

It stores the config in moddata for modification by server admins, and that modified file is sent to players on connect syncing the files.
Due to some technical limitations the client's config will be delayed until the second reconnect.
23 Comments
Digan Feb 15 @ 6:24am 
Could use an update alright.
InsanityXL Dec 7, 2022 @ 12:59pm 
I am getting this on our Dedicated Server

2003555597 is problematic: Mod 'Config Loader' [2003555597]'s base game requirement (0.33.5 to 2.0.*) doesn't match version 2.3 of the game.

Any plans on updating this mod or any of your other mods?
Redrum Jackle Aug 4, 2022 @ 3:35pm 
It needs an update, but works so far.
CurtimusPrime92 Aug 4, 2022 @ 1:13pm 
is this 2.2 compatible?
Bubbet!  [author] May 12, 2021 @ 7:49pm 
Sounds like you've messed up one of your configs?
Mialu May 12, 2021 @ 1:43pm 

Error while adding file D:\Program Files (x86)\Steam\steamapps\workshop\content\445220\2003555597\data/scripts/lib/ConfigLoader.lua:
D:\Program Files (x86)\Steam\steamapps\workshop\content\445220\2003555597\data/scripts/lib/tabletofile.lua:103: attempt to get length of local 'tables' (a nil value)
VortexBox Sep 17, 2020 @ 7:15am 
update please and thank you
Me_Who_Else Jun 29, 2020 @ 10:35pm 
Are you going to update this one?
MachoNatchoMan May 15, 2020 @ 12:15am 
aah oki sorry for the disturbance, thank you for the answer :)
in the grand scheme of things it turned out your mod wasn't much of an issue at all
Bubbet!  [author] May 12, 2020 @ 1:01pm 
Again, i've wrote code to reduce disk reads/writes down to one time on startup and none on clients which should be much faster. But im not allowed to use it because of server hard crashing bugs that the devs have to resolve before i can roll out the update again. I've already emailed koonschi but he's out of office currently.