GetINIFloat

From GECK
Jump to: navigation, search


A function added by the Lutana NVSE plugin, now part of the JIP NVSE Plugin.

Description

Returns the value of an INI key found in a file (relative to "Data\Config") as a float.

Syntax

[help]
(float) GetINIFloat keystring:string filename:string 

Example

GetINIFloat "GamePlay:fMeleeDamageMultiplier" "MyFolder\MyFile.ini"

Will return the value from the INI file located in "Data\Config\MyFolder\MyFile.ini"

Below is the appropriate INI format that should be in MyFile.ini:

[GamePlay]
fMeleeDamageMultiplier=3

In this case GetINIFloat would have returned a 3

Notes

  • INI files are read from and written to in the Data\config\ folder (as in MCM's INI functions). Format Example
  • If no filename is specified, the name of the mod the function is called from is used. Subdirectories can be defined in the path, e.g. "subDir\nameOfFile"
  • It is likely that if you include a subdirectory, you will go over the parser limit. If this occurs, the script will compile but will not work in-game. This can be solved by passing a string variable instead.
  • Writing to an INI file that does not exist will create it along with any non-existent subdirectories in its path.
  • A keystring is a string containing both the section and key in the format: "Section:Key" ('\' and '/' may also be used as the delimiter.)

See Also