# Custom Settings feature

**URL:** <https://narrat.discourse.group/t/custom-settings-feature/34>\
**Category:** Engine Development\
**Created:** [17 June 2023 15:39 UTC](https://narrat.discourse.group/t/custom-settings-feature/34 "2023-06-17T15:39:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Narrat-Admin](https://yyz2.discourse-cdn.com/free1/user_avatar/narrat.discourse.group/narrat-admin/32/429_2.png) [@Narrat-Admin](https://narrat.discourse.group/u/Narrat-Admin)\
**Post date:** [17 June 2023 15:39 UTC](https://narrat.discourse.group/t/custom-settings-feature/34/1 "2023-06-17T15:39:00Z")

</div>

# Custom Settings

I am planning a new feature for custom settings. This will give games the ability to specify custom settings in their config, which will then be exposed to the player and editable ingame.  
Game scripts can then access those settings

## Example

Imagine you want a custom setting to disable spider content for people with arachnophobia. In `config.yaml`:

```yaml
settings:
  customSettings:
    arachnophobia:
      type: boolean
      defaultValue: false
      name: 'Disable Arachnophobia'
      description: 'Turning this on will censor spider imagery and descriptions in the game'

```

Adding those custom settings to the game’s config will make them appear in the System menu, alongside existing default settings.

## Available settings types

- `number`: A floating number. Props: `defaultValue`, `minValue`, `maxValue` which are used to setup a number slider
- `integer`: Same as the previous one, but the number will be rounded
- `boolean`: A boolean. Props: `defaultValue`
- `string`: A string. Props: `defaultValue`

All settings need to specify the `type` property, as well as `name` and `description`

## Usage in scripts

To use custom settings in script, new commands `get_custom_setting` and `set_custom_setting` will be available:

```auto
main:
  set $data.noSpiders (get_custom_setting arachnophobia)

change_setting:
  set_custom_setting arachnophobia false

```

## Default Settings

The default settings currently planned to be available for players are:

- `textSpeed`: [number] The speed at which the text animates (which also controls auto play delay when not animating)
- `animateText`: [boolean] Toggle text animation
- `fontSize`: [number] Base size of the body font (if your CSS uses `rem` units, changing this font size should generally change all fonts in the game).
