Functions

All functions (except ImGui functions) are part of the global "game" table.
Example: "game.print("text")"

A "definitions.lua" file can be found in the "Data" directory, after the game was started at least once. The file contains definitions for most imgui, imutil and game functions that can be used for reference. The definition file is embedded into the executable and is not overwritten, so if you upgrade the executable file you have to delete the file and start the game once to get the most recent.

Time Functions
Random Functions
Hook Functions
Audio
General Functions
Stat Functions
Config Functions
Mod Config Functions
Resource Functions
Game File Functions
Character Functions
Location Functions
Place Functions
Item Functions
Inventory Functions
Interaction Functions
Dialog Functions
Generic Functions
FileTag Functions

Other

print(Type > String)

Prints the given string if the Config > "lua_debug_print" Type Boolean is true.

addAdditionalFile(Extension Type > String, File Type > String, Path(Optional) Type > String)

This should be called during the "onPreLoadFiles" hook.
The file Type > String is treated like the contents of a file with the given extension. New lines can be specified with "\n". For some extensions a path must be specified, for example ".idata".

sendNotification(Type > String)

Sends a notification to the UI that is displayed for around 5 seconds.

isFileDataLoaded(Extension Type > String, Identifier Type > String)

Returns true if a FileData with the given extension and identifier is loaded, otherwise returns false.

refreshUI()

Refreshes the UI.

isCheatingEnabled()

Returns true if cheating is enabled.

isDebuggingEnabled()

Returns true if debugging is enabled.

isDebugEnabled()

Same as "game.isDebuggingEnabled()".

isModEnabled(Identifier Type > String)

Returns if the mod is enabled.

checkRequirement(String Type > String)

Tries to evaluate the string as lua code that returns a bool.

gameOver(Reason(Optional) Type > String)

Triggers a game over. The given reason will be displayed, if no reason is given a default text is displayed.

getDifficulty()

Returns the general difficulty value. The default is 1.0.

getText(TextFileData Identifier Type > String)

Returns the text of the given TextFileData.

closeWindow(Name Type > String)

Closes the windows that have the given name.

getFeatureOptions(Identifier Type > String)

Returns all options for the given FeatureFileData identifier.

getOutfitOptions(Identifier Type > String)

Returns all options for the given OutfitFileData identifier.

visitLocation(Key Type > String)

Visit the given LocationData.

visitPlace(Key Type > String)

Visit the given PlaceData. Also visits the location this place is in.

visitCharacter(Key Type > String)

Visit the given CharacterData. Also visits the place this character attends and the location the place is in.

visitItem(Key Type > String)

Visit the given ItemData.

goBackLocation()

Goes back a location.

getVisitLocation()

Returns the location that is currently visited.
Returns an empty string if non is visited.

getVisitPlace()

Returns the place that is currently visited.
Returns an empty string if non is visited.

getVisitCharacter()

Returns the character that is currently visited.
Returns an empty string if non is visited.

getVisitItem()

Returns the item that is currently visited.
Returns an empty string if non is visited.

leaveLocation()

Leaves the current LocationData.

leavePlace()

Leaves the current PlaceData.

leaveCharacter()

Leaves the current CharacterData.

leaveItem()

Leaves the current ItemData.