Skip to main content

Hideout

A Types.Sense that picks where an agent should reappear: the most interesting point of an Interest map that no player can see (Perception.SeenByAnyone) and that is not in a SafeAreas area. Writes it under Key, nil when every point is in view. States.Burrow reads it.

:AddSense(VluxyAI.Senses.Hideout.new(interest, { Key = "Hideout", Stray = 0.25 }))
-- in the brain
Burrow = VluxyAI.States.Burrow({ To = "Hideout", Then = "Dormant" }),

Functions​

new​

Hideout.new(
interest: Interest,
options: HideoutOptions?
) → Hideout

Types

​

interface HideoutOptions {
Key: string?--

The blackboard key written. Default "Hideout".

Every: number?--

Seconds between picks. Default 1.

Stray: number?--

Chance, 0 to 1, that a pick ignores how interesting a point is. Default 0.

Height: number?--

Studs above a point's floor that "seen" is judged at, about where the body will be. Default 3.

Accept: ((position: Vector3) → boolean)?--

Extra rule a point must pass, such as "far enough from where I am".

Random: Random?--

Default agent.Data.Random, else a new one.

Prefix: string?--

Prepended to the key. Default "".

}

Errors

TypeDescription
"unknown option"

Tick​

Hideout.Tick(
self: Hideout,
agent: Agent,
deltaTime: number
) → ()

Picks again every Every seconds and writes the point under Key.

Destroy​

Hideout.Destroy(self: Hideout) → ()

Nothing to release.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "",
            "params": [
                {
                    "name": "interest",
                    "desc": "",
                    "lua_type": "Interest"
                },
                {
                    "name": "options",
                    "desc": "",
                    "lua_type": "HideoutOptions?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Hideout"
                }
            ],
            "function_type": "static",
            "errors": [
                {
                    "lua_type": "\"unknown option\"",
                    "desc": ""
                }
            ],
            "source": {
                "line": 96,
                "path": "lib/Senses/Hideout.luau"
            }
        },
        {
            "name": "Tick",
            "desc": "Picks again every `Every` seconds and writes the point under `Key`.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Hideout"
                },
                {
                    "name": "agent",
                    "desc": "",
                    "lua_type": "Agent"
                },
                {
                    "name": "deltaTime",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 109,
                "path": "lib/Senses/Hideout.luau"
            }
        },
        {
            "name": "Destroy",
            "desc": "Nothing to release.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "Hideout"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 153,
                "path": "lib/Senses/Hideout.luau"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "HideoutOptions",
            "desc": "",
            "fields": [
                {
                    "name": "Key",
                    "lua_type": "string?",
                    "desc": "The blackboard key written. Default `\"Hideout\"`."
                },
                {
                    "name": "Every",
                    "lua_type": "number?",
                    "desc": "Seconds between picks. Default `1`."
                },
                {
                    "name": "Stray",
                    "lua_type": "number?",
                    "desc": "Chance, `0` to `1`, that a pick ignores how interesting a point is. Default `0`."
                },
                {
                    "name": "Height",
                    "lua_type": "number?",
                    "desc": "Studs above a point's floor that \"seen\" is judged at, about where the body will be. Default `3`."
                },
                {
                    "name": "Accept",
                    "lua_type": "((position: Vector3) -> boolean)?",
                    "desc": "Extra rule a point must pass, such as \"far enough from where I am\"."
                },
                {
                    "name": "Random",
                    "lua_type": "Random?",
                    "desc": "Default `agent.Data.Random`, else a new one."
                },
                {
                    "name": "Prefix",
                    "lua_type": "string?",
                    "desc": "Prepended to the key. Default `\"\"`."
                }
            ],
            "source": {
                "line": 43,
                "path": "lib/Senses/Hideout.luau"
            }
        }
    ],
    "name": "Hideout",
    "desc": "A [Types.Sense] that picks where an agent should reappear: the most interesting point of an\n[Interest] map that no player can see ([Perception.SeenByAnyone]) and that is not in a\n[SafeAreas] area. Writes it under `Key`, `nil` when every point is in view. [States.Burrow]\nreads it.\n\n```lua\n:AddSense(VluxyAI.Senses.Hideout.new(interest, { Key = \"Hideout\", Stray = 0.25 }))\n-- in the brain\nBurrow = VluxyAI.States.Burrow({ To = \"Hideout\", Then = \"Dormant\" }),\n```",
    "source": {
        "line": 88,
        "path": "lib/Senses/Hideout.luau"
    }
}