Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Runtime Docs Version 2.0.77

# LuaSettings - Runtime Docs

## Class LuaSettings

Object containing the three different types of mod settings: startup settings, global runtime settings and per-player runtime settings. An instance of LuaSettings is available through the global object named `settings`.

## Members

get_player_settings(player) | → LuaCustomTable[string → ModSetting] | Gets the current per-player settings for the given player, indexed by prototype name. [...]
Gets the current per-player settings for the given player, indexed by prototype name. [...]
startup | :: R LuaCustomTable[string → ModSetting] | The startup mod settings, indexed by prototype name.
The startup mod settings, indexed by prototype name.
global | :: R LuaCustomTable[string → ModSetting] | The current global mod settings, indexed by prototype name. [...]
The current global mod settings, indexed by prototype name. [...]
player_default | :: R LuaCustomTable[string → ModSetting] | The default player mod settings for this map, indexed by prototype name. [...]
The default player mod settings for this map, indexed by prototype name. [...]
object_name | :: R string | The class name of this object. [...]
The class name of this object. [...]

## Methods

### get_player_settings(player) → LuaCustomTable[string → ModSetting]

Gets the current per-player settings for the given player, indexed by prototype name. Returns the same structure as LuaPlayer::mod_settings. This table becomes invalid if its associated player does.

Even though this attribute is a getter, individual settings can be changed by overwriting their ModSetting table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.

#### Parameters

player | :: PlayerIdentification |

#### Example

    -- Change the value of the "active_lifestyle" setting
    settings.get_player_settings(player_index)["active_lifestyle"] = {value = true}

## Attributes

### startup :: Read LuaCustomTable[string → ModSetting]

The startup mod settings, indexed by prototype name.

### global :: Read LuaCustomTable[string → ModSetting]

The current global mod settings, indexed by prototype name.

Even though this attribute is marked as read-only, individual settings can be changed by overwriting their ModSetting table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.

### player_default :: Read LuaCustomTable[string → ModSetting]

The default player mod settings for this map, indexed by prototype name. Changing these settings only affects the default settings for future players joining the game.

Individual settings can be changed by overwriting their ModSetting table. Mods can only change their own settings. Using the in-game console, all player settings can be changed.

### object_name :: Read string

The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.