Papyrus Integration - Exit-9B/MCM-Helper Wiki

Scripts can be informed when the value of a control changes by doing one of the following:


Your config script (from Creating a Config Script) can implement events in order to respond to user actions. For instance, the OnSettingChange event is dispatched whenever the user changes a setting. The control must have the id property in order to receive this event.

The following events are provided by the config script.

; Event raised when an MCM setting is changed.
Event OnSettingChange(string a_ID)

; Event raised when a new page is selected, including the initial empty page. (Added in v1.3.0 - version code 11)
Event OnPageSelect(string a_page)

; Event raised when a config menu is opened.
Event OnConfigOpen()

; Event raised when a config menu is closed.
Event OnConfigClose()


Scriptname MyMod_ConfigMenu extends MCM_ConfigBase

GlobalVariable Property SliderValue  Auto
GlobalVariable Property ToggleValue  Auto

Event OnConfigInit()

Event OnSettingChange(string a_ID)
    if a_ID == "fSliderValue:Main"
    elseif a_ID == "bToggleValue:Main"

Control Action

You can also add a Papyrus action to a control to pass its value to a specified function whenever it is changed.

Use the {value} keyword to substitute the value of a control in a Papyrus function call. Note that the data type of the parameter will match the value type of the control. See Setting Types, Storage, and Persistence for the data types.

When passing a constant value to a function, the desired data type can be specified by prefixing {i}/{b}/{f}/{s} to the value. This casts the value to an int, bool, float or string, respectively.
e.g. "{i}42"

Action types:

  "action": {
    "type": "CallFunction",
    "form": "MCM_Demo.esp|800",
    "scriptName": "MCM_DemoScript",
    "function": "OnSliderValueChanged",
    "params": ["{value}"]
  "text": "Demo Button",
  "type": "text",
  "help": "Displays a messagebox via a CallGlobalFunction action.",
  "action": {
    "type": "CallGlobalFunction",
    "script": "Debug",
    "function": "MessageBox",
    "params": ["Hello world!"]