Skip to main content

StateLabel

Debug billboard for an agent: name, current state, navigator status and chosen blackboard keys. Make one after building the agent and destroy it with the agent.

local label = VluxyAI.Debug.StateLabel.new(agent, { Keys = { "SeenTarget", "IsWatched" } })

Functions​

new​

StateLabel.new(
agent: Agent,
) → StateLabel

Types

​

interface StateLabelOptions {
Keys: {string}?--

Blackboard keys to show under the state. Default none.

Offset: Vector3?--

World offset of the billboard from the root. Default (0, 4, 0).

Interval: number?--

Seconds between value refreshes. Default 0.25.

TextSize: number?--

Default 14.

}

Errors

TypeDescription
stringThe agent is headless.

Refresh​

StateLabel.Refresh(self: StateLabel) → ()

Redraws the text now.

Destroy​

StateLabel.Destroy(self: StateLabel) → ()
Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "",
            "params": [
                {
                    "name": "agent",
                    "desc": "",
                    "lua_type": "Agent"
                },
                {
                    "name": "options",
                    "desc": "",
                    "lua_type": "StateLabelOptions?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "StateLabel"
                }
            ],
            "function_type": "static",
            "errors": [
                {
                    "lua_type": "string",
                    "desc": "The agent is headless."
                }
            ],
            "source": {
                "line": 99,
                "path": "lib/Debug/StateLabel.luau"
            }
        },
        {
            "name": "Refresh",
            "desc": "Redraws the text now.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "StateLabel"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 167,
                "path": "lib/Debug/StateLabel.luau"
            }
        },
        {
            "name": "Destroy",
            "desc": "",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "StateLabel"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 184,
                "path": "lib/Debug/StateLabel.luau"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "StateLabelOptions",
            "desc": "",
            "fields": [
                {
                    "name": "Keys",
                    "lua_type": "{ string }?",
                    "desc": "Blackboard keys to show under the state. Default none."
                },
                {
                    "name": "Offset",
                    "lua_type": "Vector3?",
                    "desc": "World offset of the billboard from the root. Default `(0, 4, 0)`."
                },
                {
                    "name": "Interval",
                    "lua_type": "number?",
                    "desc": "Seconds between value refreshes. Default `0.25`."
                },
                {
                    "name": "TextSize",
                    "lua_type": "number?",
                    "desc": "Default `14`."
                }
            ],
            "source": {
                "line": 39,
                "path": "lib/Debug/StateLabel.luau"
            }
        }
    ],
    "name": "StateLabel",
    "desc": "Debug billboard for an agent: name, current state, navigator status and chosen blackboard\nkeys. Make one after building the agent and destroy it with the agent.\n\n```lua\nlocal label = VluxyAI.Debug.StateLabel.new(agent, { Keys = { \"SeenTarget\", \"IsWatched\" } })\n```",
    "source": {
        "line": 91,
        "path": "lib/Debug/StateLabel.luau"
    }
}