Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ModuleRemoveSavedVariable

From RoR Wiki
Revision as of 19:47, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Module functions
Version: WAR 1.4.8

Removes a saved variable from a UI module at run time.

ModuleRemoveSavedVariable(moduleName, variableName)

Arguments

moduleName
string – The module's name, as in the name field of ModulesGetData.
variableName
string – Name of the saved variable, exactly as it was registered.

Returns

Nothing.

Details

  • If the module has no saved variable with that name, the does not have a saved variable error is logged.
  • As with ModuleAddSavedVariable, the change is accepted only while the module is initialized or being initialized. Otherwise the is not loaded error is logged; its wording does not match the check.
  • The function needs at least two arguments and only reads the last two.
  • The stock UI never calls ModuleRemoveSavedVariable.

Errors

These are written to the UI log; the call returns normally.

  • Error in function call 'ModuleRemoveSavedVariable': %s is not a valid UiMod name.
  • Error in function call 'ModuleRemoveSavedVariable': %s is not loaded. You may not modify the SavedVariables on a Module that is initialized.
  • Error in function call 'ModuleRemoveSavedVariable': %s does not have a saved variable named '%s'.

Example

A minimal example built from the signature above:

ModuleRemoveSavedVariable( "MyAddon", "MyAddon.Settings" )

See also