StageVariants

v1.1.0·Updated 2025-09-03

Helper mod to create visual stage variants

About this mod Author’s original text

Onyx-StageVariants

  • Helper to create visual stage variants
  • does nothing on its own, use with CoolStages
  • Allows you to replace spritesheets, recolor layers and more

Import line:

StageVariants = mods["0n_x-StageVariants"].setup()

Functions

StageVariants.create(namespace, identifier, stage, name, subname, [weight]) -> Stage Variant

Creates a stage variant. It won't change anything for now, but it will be added to the variants that can be rolled and is visible in the imgui window

Parameters:

| Parameter | Type | Description |

| ------------- | -------- | --------------- |

| namespace | string | The namespace of your mod |

| identifier | string | The identifier of the variant (namespace + identifier need to be unique) |

| stage | Stage object | The stage you want to add your variant to |

| name | string | the name of your variant (will show up in imgui) |

| subname | string | the subname of your variant (will replace the subname when entering the stage) |

| weight | string | the default weight of your stage (5 by default) |

StageVariants.swap_tileset(stage_variant, original_tileset, replacement_tileset) -> nil

Adds a tileset swap to the variant. Once entering a stage with this variant the original tileset will be automatically replcaed by the replacement tileset.

If you want to create a replacement tileset, you need to look at the original tileset and put the tiles of your new tileset in the same position as in the original tileset. for example if you want to replace a bottom right corner piece, your replacement tile needs to be in the same x and y position in the new tilemap

Parameters:

| Parameter | Type | Description |

| ------------- | -------- | --------------- |

| stage_variant | Stage Variant | the variant that you got by calling create or find |

| original_tileset | sprite id | can be obtained by doing gm.sprite_find("ror-") |

| replacement_tileset| sprite id | the id of the tileset you want to use as a replacement (look at Resources.sprite_load in the toolkit) |

StageVariants.recolor_layer(stage_variant, layer_name, color) -> nil

Like swap_tileset, adds a recolored layer to the variant. Uncomment "GetLayerNames" in main.lua to print the names of all layers of your current stage. Layers get printed in the same order as they appear in provedit (Settings -> Background)

Parameters:

| Parameter | Type | Description |

| ------------- | -------- | --------------- |

| stage_variant | Stage Variant | the variant that you got by calling create or find |

| layer_name | string | the name of the layer you want to recolor |

| color| Color | The new color you want to use for the layer |

StageVariants.swap_sprite(stage_variant, original_sprite, replacement_sprite) -> nil

Like swap_tileset, adds a sprite swap to the variant, but for a single sprite. Tilesets get drawn differently and therefore need a different method to be replaced

Parameters:

| Parameter | Type | Description |

| ------------- | -------- | --------------- |

| stage_variant | Stage Variant | the variant that you got by calling create or find |

| original_sprite | sprite id | can be obtained by doing gm.constants.. (get sprite names with undertale mod tool) |

| replacement_sprite| sprite id | the id of the sprite you want to use as a replacement (look at Resources.sprite_load in the toolkit for custom sprites) |

StageVariants.find(namespace, identifier) -> Stage Variant

Returns a variant with the given namespace and identifier. Returns nil if it doesn't exist.

Parameters:

| Parameter | Type | Description |

| ------------- | -------- | --------------- |

| namespace | string | the namespace of the Stage Variant you want to get |

| identifier | string | the identifier of the Stage Variant you want to get |

StageVariants.find_all(namespace, identifier) -> {Stage Variant}

Returns a table with all stage variants

Parameters:

| Parameter | Type | Description |

| ------------- | -------- | --------------- |

| namespace | string | the namespace of the Stage Va

Install & use Install: follow the bundled instructions

  1. Unzip the archive from playbuff and read the bundled readme / instructions first.
  2. Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
  3. For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
  4. Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.

Install locations vary a lot between mods — the bundled readme is the most reliable guide. If the mod depends on a loader such as ReturnOfModding, install it first as the readme describes.

Dependencies

Install these first, or the mod will not work:

ReturnOfModding-ReturnOfModdingRoRRModdingToolkit-RoRR_Modding_ToolkitSmoothSpatula-TomlHelper

File & checksum

Filename
StageVariants-1.1.0.zip
File size
31.9 KiB