18 posts
Posted 26 October 2014 - 02:39 PM
I am trying to make something and I need a config file system.
Is there any easy way to use a file for that?
1080 posts
Location
In the Matrix
Posted 26 October 2014 - 03:09 PM
You can get started by looking at this easy FS tutorial.
Here. And if you still have questions, i'm sure we'll be happy to help
7083 posts
Location
Tasmania (AU)
Posted 26 October 2014 - 09:40 PM
As a bit of an example, take a read through lines 1160-1204 in
this script. If the game's INI file is found in the current directory, it opens it and parses the contents. If it's not, it generates a new INI file, and the default values defined up on line 32 are used instead.
18 posts
Posted 27 October 2014 - 09:44 AM
Wouldn't a serialized table make things easier? For the programmers at least?
756 posts
Posted 27 October 2014 - 10:37 AM
Wouldn't a serialized table make things easier? For the programmers at least?
Congratulation, you've answered you own question :D/>
7508 posts
Location
Australia
Posted 27 October 2014 - 12:18 PM
In the event that you do actually want an API which deals with configuration files for you, I have an API called ccConfig which you can find in my programs thread (link in signature), it supports the ability for you to have user configurable strings, numbers, booleans, colours, etc.
132 posts
Location
Florida, USA
Posted 27 October 2014 - 04:20 PM
Yeah, you could use serialized tables pretty easily. just use textutils and fs to do it. I actaully use that method for my configs.