ST Custom Toggle Variable - ironmonk108/monks-module-wiki GitHub Wiki

Custom Toggle, Variable Method

Runs different action threads depending on the value of the variable using the modulo operator. This method uses variables; you can also use trigger history, see Custom Toggle, History Method

Setup Required

Actions

  • Check Variable
    • Variable name: anything you want.
    • Value % 2 == 0
    • Go to: should match the second landing.
  • Landing
    • Name needs to match the Go To field from the check.

The Chat Messages are for informative purposes only.

Click here to view Tile Template JSON Data

Copy & paste this into Notepad and save it as a .JSON file. Then import it using MATT's Tile Templates.

{
    "texture": {
        "scaleX": 1,
        "scaleY": 1,
        "src": null,
        "tint": "#ffffff",
        "offsetX": 0,
        "offsetY": 0,
        "rotation": 0,
        "anchorX": 0.5,
        "anchorY": 0.5,
        "fit": "fill",
        "alphaThreshold": 0.75
    },
    "width": 100,
    "height": 100,
    "rotation": 0,
    "elevation": 0,
    "alpha": 1,
    "occlusion": {
        "mode": 1,
        "alpha": 0
    },
    "video": {
        "loop": true,
        "autoplay": true,
        "volume": 0
    },
    "flags": {
        "monks-active-tiles": {
            "active": true,
            "record": false,
            "restriction": "all",
            "controlled": "all",
            "trigger": [
                "enter"
            ],
            "allowpaused": false,
            "usealpha": false,
            "pointer": false,
            "pertoken": false,
            "minrequired": 0,
            "chance": 100,
            "fileindex": 0,
            "actions": [
                {
                    "action": "anchor",
                    "data": {
                        "tag": "Even",
                        "stop": false
                    },
                    "id": "ZtJ4x31t59rcIRWr"
                },
                {
                    "action": "setvariable",
                    "data": {
                        "entity": {
                            "id": "tile",
                            "name": "This Tile"
                        },
                        "name": "goblins",
                        "value": "+ 1"
                    },
                    "id": "shGqyb1DCMbizwTF"
                },
                {
                    "action": "checkvariable",
                    "data": {
                        "entity": {
                            "id": "tile",
                            "name": "This Tile"
                        },
                        "type": "all",
                        "name": "goblins",
                        "value": "% 2 == 0",
                        "fail": "Odd"
                    },
                    "id": "39Vj74Li44L3uQ6r"
                },
                {
                    "action": "chatmessage",
                    "data": {
                        "flavor": "",
                        "text": "Even",
                        "entity": "",
                        "incharacter": false,
                        "chatbubble": false,
                        "language": "",
                        "showto": "everyone"
                    },
                    "id": "ZM3dRyNp3l9QdSmo"
                },
                {
                    "action": "anchor",
                    "data": {
                        "tag": "Odd",
                        "stop": true
                    },
                    "id": "h0LHZhzEJi6vE5kt"
                },
                {
                    "action": "chatmessage",
                    "data": {
                        "flavor": "",
                        "text": "Odd",
                        "entity": "",
                        "incharacter": false,
                        "chatbubble": false,
                        "language": "",
                        "showto": "everyone"
                    },
                    "id": "K7oppchZcXSFEWdc"
                }
            ],
            "files": [],
            "vision": false,
            "cooldown": null,
            "name": "Custom_Toggle_Variable_v13.02"
        },
        "tagger": {}
    },
    "hidden": false,
    "locked": false,
    "sort": 150000,
    "restrictions": {
        "light": false,
        "weather": false
    },
    "name": "Custom_Toggle_Variable_v13.02",
    "visible": true,
    "img": null,
    "thumbnail": "modules/monks-active-tiles/img/cube.svg",
    "folder": "qEhdNdIhbYVCtLRF"
}

Page Last Updated

  • Foundry 13.351
  • MATT 13.05
⚠️ **GitHub.com Fallback** ⚠️