Skip to main content

keylayer.swap

Overview

  • Replaces an active key layer with another key layer declared by the same mod, at the same stack position (e.g. switch preset A to preset B). Fails if 'from' is not active or the two key layers belong to different mods.

Metadata

FieldValue
DisplaySwap Mod Key Layer
Categorykeylayer
AccessScriptCheat
ScopeB1Standalone
TagsExperimental
Aliases—

Parameters

NameTypeRequiredDefaultDescription
fromstringyes—Active key layer id to replace
tostringyes—Key layer id of the same mod to put in its place

Returns

Returns a JSON object with the following fields:

FieldTypeRequiredDescription
layerstringyesKey layer now active at that position ('to')
activeboolyesWhether 'to' is on the active stack
active_countintyesNumber of active key layers of all mods
enabledboolyesPlayer toggle state of all key layers

Usage

await inzoi.cli.execute('keylayer.swap', {
from: '',
to: '',
});