I'm a doctor, not a mechanic

Legacy:INI File

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 15:09, 25 March 2008 by (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Unreal Engine based games make use of one or more INI files to hold configuration information for the classes used within the application running.

Some mods also use their own configuration file to avoid cluttering up the main program INI file and making their mod easier to install and uninstall. You can learn more about how this is done by reading about Config Vars And .Ini Files.

The INI file is broken into sections each with its own header. Each section within the INI file corresponds to the configuration of a class. The format of the section header is typically [package.classname] but not always.

An example INI file section showning the initialisation style of each variable type is shown below.

MyStaticStringArray[0]=string element 0
MyStaticStringArray[1]=string element 1
MyStaticStringArray[2]=string element 0

The most important thing to note about the above example is the difference between the initialisation of the static and dynamic arrays.

When a static array is specified all elements in the array are saved to the INI file, even though they may be empty (or contain NULL values). Also, the index of the element is stored with the value.

When a dynamic array is specified then the element indexes are ommitted and the variable name of the dynamic array is used in multiple assignments. The EditPackages=... lines in the UnrealTournament.ini file are a real life example of the initialisation of a dynamic array.

Although you can comment an INI file using the ;, # symbols or an apostraphy, all comments are lost as soon as the INI file is updated by a save of the configuration unless they are within a section (under a heading, see example) and have an = sign in them. You can use a few different ways to comment out lines. Note that I made up a section that is not related to any class, but it makes all comments with an = sign in them endure updates of the ini file. This will also work under any existing section.

rem=this is a test for comments.

Note that "rem=", "comment=", "DonkeyFeet=", will all work to start a comment line.

Related Topics[edit]