How are duplicate keys in SkyrimPrefs.ini treated

the-elder-scrolls-v-skyrim

In the Skyrim config files, how are duplicate keys treated? For example if the file contains:

bFloatPointRenderTarget=1
bTreesReceiveShadows=1

## Notice two occurrences of the next value
bShadowsOnGrass=0
bShadowsOnGrass=1

What is the value of bShadowsOnGrass? I think there are three options:

  1. The first value is set, then all others ignored.
  2. The last value is kept, overwriting all earlier values.
  3. No value (or some default) gets set because of the conflict.

Which is right?

Best Answer

It ignores the second value.

Tested by using the following cases:

Case 1

[General]
sIntroSequence = 
sIntroSequence = BGS_Logo.bik 

Case 2

[General]
sIntroSequence = BGS_Logo.bik
sIntroSequence =

In Case 1, game went straight to main menu. In Case 2 it showed the Bethesda logo before going to menu.

While I couldn't say for sure if this is the case for every setting (.ini file behaviour with duplicate names isn't unambigously defined), I would guess that this is the case and that the second value always gets discarded.