Background for Skyrim SE
Member of the DbIniFunctions script
voidfunctionWriteForceSetIniFunction(stringinputFilePath, stringoutputFilePath, stringfunctionName, boolonlyInisWithDefaults=true)Global

Description

Documentation Comment

used to write a function in your script to create an ini file for your mod.
Let's say you have a script Data/Scripts/Source/MyScript.psc
In the script you have a bunch of GetIni functions from this script like:
String MyString = DbIniFunctions.GetIniString("Data/Interface/MyMod/Settings.ini", "Strings", "MyString", "My String")
int MyInt = DbIniFunctions.GetIniInt("Data/Interface/MyMod/Settings.ini", "Main", "MyInt", 42)
Using this function: 'WriteForceSetIniFunction("Data/Scripts/Source/MyScript.psc", "Data/Scripts/Source/MyScript.psc", "CreateIniFile")'
Will write this function in your script:
Function CreateIniFile()
DbIniFunctions.SetIniString("Data/Interface/MyMod/Settings.ini", "Strings", "MyString", "My String", true)
DbIniFunctions.SetIniInt("Data/Interface/MyMod/Settings.ini", "Main", "MyInt", 42, true)
Endfunction
You can then use this function to create your ini file and write all the inis in one go.
requires skse and papyrusUtil


Parameters

  1. stringinputFilePath

  2. stringoutputFilePath

  3. stringfunctionName

  4. boolonlyInisWithDefaults=true


Examples

Auto-Generated Example

string myString__inputFilePath
string myString__outputFilePath
string myString__functionName
bool myBool__onlyInisWithDefaults

DbIniFunctions.WriteForceSetIniFunction(myString__inputFilePath, myString__outputFilePath, myString__functionName, myBool__onlyInisWithDefaults)
Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.