As you can see we have distinct types of return, i generally use GetValueString because its easier to manage.These approaches require some parameters:

OptionName: Set the name of the selection in the INI fileCategory: Set the category exactly where the option will beDefaultValue: Set the default value that will be returned when the selection never exists in the INI file

You can skip the Category parameter, but its not great concept.

Keep in mind that the structure of an INI file is some thing like:

[CATEGORY]OPTION1=VALUE1OPTION2=VALUE2

[CATEGORY2]OPTION12=VALUE12OPTION22=VALUE22

So, to study an string from the INI file we can use:

The same notion with Integers, floats, and so forth..

Writing data

We have only one method to write data in the INI file:

&nbsp &nbsp &nbsp &nbsp Settings.SetValue

We can use any of the Reading varieties in this method, the strategy will detect and create the correct information. The params necessary are:

OptionName, Category and the Value that can be a single of the types &nbsplisted in "Reading data" section of this tutorial.

Right after writing into the INI file we need to use the technique Save to save the info in the INI file, if the file never exists it will be automatically developed:

&nbsp &nbsp &nbsp &nbsp Settings.Save

The name of the file will be the name of the script file significantly less .net.dll/.vb/.cs element.

In my scripts i constantly attempt to keep all settings offered in .INI file with no the need of release the mod with the INI file, to do this i constantly verify if the selection exists in the INI file, if never exists i set my default value. to do this i use an strategy:

This strategy will attempt to study an String from the INI, if nothing is located it will set in the INI the default value, then study it again and return the outcome as String.&nbsp

To use i get in touch with it like this:

We can use this approach to study double and integer values as well, we just require to convert the result to the preferred type:

To study Crucial worth i use yet another strategy that will constantly return an Key:

making use of it:

The variable need to be an Keys variety:

One more way to study and create

When i need to have to study and create INI file with custom names like i do in Air Combat IV exactly where i want to study ini files that are inside folder Jets and the names are custom (armor_jet_name.ini) i use the following strategies:

As you can see we want to import the Technique.Text to use the StringBuilder object :)

We are utilizing windows API's to read and write data from the INI file.

This strategy calls for that the ini file already exists, so i use this method to confirm the INI file existence before use it:

Also i use an International string variable&nbsp(iniFile)&nbspto be the INI file name that im making use of, you can modify the approaches to add this as parameter but i favor to use this way. You should use the complete path to decide the INI file, it can be relative:&nbsp