Donut Team is a labor of love, built and maintained by a small group of passionate developers. We invest our own time and resources to offer our tools, mods, and web services completely free of charge.

We don't run ads, and we will never sell your data - period.

If you've enjoyed anything we've created, please consider supporting our work with a one-time or monthly donation via our Ko-fi page . Every contribution helps us continue building great experiences for the community.

Dismiss
  • Modding Tools
  • Lucas' Simpsons Hit & Run Mod Launcher
  • Hacks
  • Mod Requirable Hacks
  • Custom Files
  • Lua Functions
  • Mod Functions

GetSettings

Available since Version 1.19.

Returns the values of all of the settings of the a mod as a table.

Syntax

GetSettings( [mod_name] )

Arguments

  • mod_name (string): The mod you want to get setting values from.
    • Optional, defaults to the mod that called the function.

Return Values

  • (table<string, boolean | integer | number | string>): A key/value table of all the setting values for the given mod or nil if the mod is not loaded.

Examples

-- Get settings of the current mod
local Settings = GetSettings()

-- Get settings of another mod
local Settings = GetSettings("AnotherMod")

Notes

When returning the value of MultipleChoice type settings this function returns them 1 based instead of 0 based like the older GetSetting function.

-- To demonstrate, here's an example.
-- For this example, let's assume that the Difficulty setting is on the first Option.

-- Difficulty would be 0
local Difficulty = GetSetting("Difficulty")
​
-- Settings.Difficulty would be 1
local Settings = GetSettings()

Version History

Version 1.23.10

Fixed an issue where the GetSetting and GetSettings functions read the low 32-bits of the 64-bit signed integer setting values as unsigned and casted that to a 64-bit signed integer to give it to Lua. This caused negative integer setting values to wrap as if they were 32-bit unsigned values.