Skip to content

Custom Spinner Trigger

JaThePlayer edited this page Dec 21, 2025 · 1 revision

Spinner Triggers

There are multiple triggers in Frost Helper affecting Custom Spinners:

  • The Change Spinners Trigger allows dynamically changing the properties of Custom Spinners.

  • The Shatter Custom Spinners Trigger allows shattering Custom Spinners.

All of these triggers are known as Spinner Triggers and follow simillar rules.

Make sure to understand Session Expressions first.

Basic Usage

Leave Filter and Cache Filter empty to affect all spinners in the room at once.

Additional Session Expression Commands

Inside this trigger, additional Session Expression Commands can be used (Keep in mind the expression is evaluated for each spinner separately.)

  • $directory - string - The directory the spinner currently takes its sprites from.
  • $origDirectory - string - Like $directory, but takes into account only the directory set in the map editor, ignoring the effects of the Change Spinners Trigger.
  • $attachGroup - int - The Attach Group setting of the spinner.
  • $playerDist - float - The distance of the spinner from the player.
  • $animFrame - int - For animated spinners, their current animation frame.
  • $playerCollides - bool - Whether the player is currently colliding with the spinner, even if it is uncollidable.

Filter

A session expression, which gets evaluated each time the trigger is activated, for each spinner separately.

  • $origDirectory=="danger/spinners/Spooooky/AssetPack/vanillaish>_whitepure" - Only targets spinners which were set to danger/spinners/Spooooky/AssetPack/vanillaish>_whitepure in the map editor.

  • $playerDist < 32 - Only targets spinners close to the player, could be used to play an animation when the player approaches a spinner. (Keep in mind that you'll need to regularly activate this trigger, with something like a Loop Activator, for this behavior to work.)

Performance, Cache Filter

If you're activating these triggers frequently, they might become laggy in rooms with lots of spinners, especially if a filter is used.

In such cases, it's best to move as much work as possible to the Cache Filter - it only gets executed once for each spinner on room load, and only spinners that matched the Cache Filter will later be considered by the trigger and the Filter.

For example, if you're using a Filter like $origDirectory=="someDirectory" && $playerDist < 32 to change the sprite of spinners close to the player, it is wasteful to perform the $origDirectory=="someDirectory" check each time - its result can never change for any given spinner.

Instead, using Cache Filter: $origDirectory=="someDirectory" and Filter: $playerDist < 32 will be more lag-friendly.

Chaining Triggers

Spinner Triggers support adding a node, which can point at another Spinner Trigger.

That second trigger will get activated for each spinner changed by the current trigger, optionally after a delay set by the Next Trigger Delay property.

Examples

Shatter-when-dashed-into Spinners:

Note

This mechanic is implemented into Frost Helper directly (set Dash Through to Shatter), this is just an example of implementing gameplay mechanics via these triggers.

  1. The spinner has to have the Dash Through property set to PassThrough, to not kill the player when dashing into it.
  2. The On Player Dashing Activator, with Only when Just Dashed disabled, will activate a Shatter Spinners trigger each frame the player is dashing.
  3. The Shatter Spinners trigger, with Cache Filter: $directory=="danger/spinners/Spooooky/AssetPack/vines>_red" and Filter: $playerCollides will shatter the spinners that the player is colliding with.
Copyable setup
{
    {
        _editorLayer = 0,
        _fromLayer = "triggers",
        _id = 3558,
        _name = "FrostHelper/ShatterSpinnersTrigger",
        _type = "trigger",
        cacheFilter = "$directory==\"danger/spinners/Spooooky/AssetPack/vines>_red\"",
        filter = "$playerCollides",
        height = 24,
        width = 32,
        x = 384,
        y = 256
    },
    {
        _editorLayer = 0,
        _fromLayer = "triggers",
        _id = 3559,
        _name = "FrostHelper/OnPlayerDashingActivator",
        _type = "trigger",
        activationMode = "AllOrdered",
        delay = "0",
        hasToBeInside = false,
        height = 24,
        nodes = {
            {
                x = 392,
                y = 264
            }
        },
        once = false,
        onlyWhenJustDashed = false,
        width = 32,
        x = 328,
        y = 256
    }
}

Spinner:

{
    {
        _editorLayer = 0,
        _fromLayer = "entities",
        _id = 3560,
        _name = "FrostHelper/IceSpinner",
        attachGroup = -1,
        attachToSolid = false,
        bloomAlpha = 0,
        bloomRadius = 0,
        borderColor = "000000",
        collidable = true,
        dashThrough = "PassThrough",
        debrisCount = 8,
        depth = -8500,
        destroyColor = "b0eaff",
        directory = "danger/spinners/Spooooky/AssetPack/vines>_red",
        drawOutline = true,
        hitbox = "C,6,0,0;R,16,4,-8,-3",
        imageScale = 1,
        onHoldable = "PassThrough",
        rainbow = false,
        scale = 1,
        singleFGImage = false,
        tint = "ffffff",
        x = 184,
        y = 240
    }
}

Turn spinners around player rainbow:

  1. Loop Activator with Loop Time: 0 updates the mechanic each frame, points at Change Spinners trigger #1.
  2. Change Spinners trigger #1 uses Filter: $playerDist < 32 and New Rainbow: True, and has a node pointing at Change Spinners trigger #2 and has Next Trigger Delay: 0.01 to delay activating #2 until next frame.
  3. Change Spinners trigger #2 uses Filter: $playerDist >= 32, and has New Rainbow: False.
Copyable setup
{
    {
        _editorLayer = 0,
        _fromLayer = "triggers",
        _id = 3566,
        _name = "FrostHelper/LoopActivator",
        activateAfterDeath = false,
        activationMode = "AllOrdered",
        delay = "0",
        height = 16,
        loopTime = 0,
        nodes = {
            {
                x = 464,
                y = 240
            }
        },
        requireActivation = false,
        width = 32,
        x = 448,
        y = 208
    },
    {
        _editorLayer = 0,
        _fromLayer = "triggers",
        _id = 3555,
        _name = "FrostHelper/ChangeSpinnersTrigger",
        _type = "trigger",
        animationBehavior = "LeaveUnchanged",
        cacheFilter = "$origDirectory==\"danger/spinners/Spooooky/AssetPack/vanillaish>_whitepure\"",
        filter = "$playerDist < 32",
        height = 16,
        newBorderColor = "",
        newCollidable = "LeaveUnchanged",
        newDashThrough = "LeaveUnchanged",
        newDepth = "",
        newDirectory = "",
        newOnHoldable = "LeaveUnchanged",
        newRainbow = "True",
        newTint = "",
        nextTriggerDelay = 0.01,
        nodes = {
            {
                x = 464,
                y = 264
            }
        },
        oncePerSpinner = false,
        width = 32,
        x = 448,
        y = 232
    },
    {
        _editorLayer = 0,
        _fromLayer = "triggers",
        _id = 3565,
        _name = "FrostHelper/ChangeSpinnersTrigger",
        _type = "trigger",
        animationBehavior = "LeaveUnchanged",
        cacheFilter = "",
        filter = "$playerDist >= 32",
        height = 16,
        newBorderColor = "",
        newCollidable = "LeaveUnchanged",
        newDashThrough = "LeaveUnchanged",
        newDepth = "",
        newDirectory = "",
        newOnHoldable = "LeaveUnchanged",
        newRainbow = "False",
        newTint = "",
        nextTriggerDelay = 0,
        nodes = {

        },
        oncePerSpinner = false,
        width = 32,
        x = 448,
        y = 256
    }
}

Spinner:

{
    {
        _editorLayer = 0,
        _fromLayer = "entities",
        _id = 3563,
        _name = "FrostHelper/IceSpinner",
        attachGroup = -1,
        attachToSolid = false,
        bloomAlpha = 0,
        bloomRadius = 0,
        borderColor = "000000",
        collidable = true,
        dashThrough = "PassThrough",
        debrisCount = 8,
        depth = -8500,
        destroyColor = "b0eaff",
        directory = "danger/spinners/Spooooky/AssetPack/vanillaish>_whitepure",
        drawOutline = true,
        hitbox = "C,6,0,0;R,16,4,-8,-3",
        imageScale = 1,
        onHoldable = "PassThrough",
        rainbow = false,
        scale = 1,
        singleFGImage = false,
        tint = "ffffff",
        x = 160,
        y = 264
    }
}

Clone this wiki locally