Skip to main content

Machine

A state machine, created by Felix.new. It holds a list of States, is in at most one of them at a time (plus that state's parents, see State.Parent), and moves between them when you Machine:Send a trigger that one of the current state's Transitions listens for.

C is the type of the machine's Machine.Context. It defaults to any.

Fields starting with an underscore (_Queue, _Transitioning, …) are internal and may change between versions.

Properties​

Current​

This item is read only and cannot be modified. Read Only
Machine.Current: State?

The state the machine is in, or nil when it isn't running. In a hierarchical machine this is the innermost active state; use Machine:Is to also match its parents.

Previous​

This item is read only and cannot be modified. Read Only
Machine.Previous: State?

The state the machine was in before the last transition, or nil right after Machine:Start.

Active​

This item is read only and cannot be modified. Read Only
Machine.Active: boolean

Whether the machine is running: true between Machine:Start and Machine:Stop.

Context​

Machine.Context: C

A table shared by every callback, for data like health, ammo or a target. It's the same table passed as Context in Felix.Details, or an empty table if none was passed.

Clock​

This item is read only and cannot be modified. Read Only
Machine.Clock: number

Machine time in seconds: the sum of every dt passed to Machine:Update. State.Duration, Scope:Delay, Machine:Buffer windows and Machine:GetTimeInState all use it.

AnyTransitions​

Machine.AnyTransitions: {Transition}

Transitions that can fire from any state, for interrupts like getting stunned or dying. They're checked after the current state's own transitions and its parents', so a state can handle a trigger its own way. Their From must be "*", and their Except lists states they don't fire from.

table.insert(fighter.AnyTransitions, Felix.Transition.new({
	From = "*",
	Target = "Dead",
	Triggers = { "Die" },
	Priority = math.huge,
	Except = { "Dead" },
}))

ID​

This item is read only and cannot be modified. Read Only
Machine.ID: any

The id passed to Felix.new. Used in error messages.

Default​

This item is read only and cannot be modified. Read Only
Machine.Default: string

The name of the state entered by Machine:Start.

StateChanged​

This item is read only and cannot be modified. Read Only
Machine.StateChanged: Signal

Fires with (newState, oldState, ...) whenever Machine.Current changes: after a state's OnEnter runs, and after OnExit when the machine stops. ... is the event data passed to Machine:Send. newState is nil on Machine:Stop, and oldState is nil on Machine:Start; neither has event data.

A Machine:Send made from a handler is queued like one made from any other callback.

Handlers run on their own thread. If a handler yields, the machine may have moved on by the time it resumes, so use the newState argument rather than reading Machine.Current after a yield.

local connection = machine.StateChanged:Connect(function(newState, oldState, ...)
	print(oldState and oldState.Name, "->", newState and newState.Name, ...)
end)

connection:Disconnect()

Rejected​

This item is read only and cannot be modified. Read Only
Machine.Rejected: Signal

Fires with (trigger, reason, ...) when a Machine:Send doesn't transition. reason is a Felix.RejectReason. Triggers retried by Machine:Buffer don't fire it.

fighter.Rejected:Connect(function(trigger, reason)
	warn(`{trigger} rejected: {reason}`) --> Parry rejected: Resisted
end)

Functions​

Send​

Machine:Send(
trigger: string,--

The trigger name

...: any--

Event data, passed after the machine to the Conditions, the old state's OnExit, the Effects and the new state's OnEnter

) → boolean--

true if the machine transitioned

Sends a trigger. The machine looks for a transition listening for trigger in the current state's Transitions (in the order they were inserted), then in each parent's, then in Machine.AnyTransitions. The first one whose Priority meets the current State.Resistance and whose Conditions all pass fires. If none does, nothing happens, Machine.Rejected fires, and Send returns false.

A Send made from inside a callback is queued and runs after the current transition has fully finished, so it returns false. Errors thrown by callbacks are rethrown from Send.

If a callback yields (for example with task.wait()), the transition isn't finished until it resumes, so every Send in the meantime is queued. That's rarely what you want in combat: use Scope:Delay to wait instead. Set CatchYields (or DebugMode) in Felix.Details to turn a yield into an error, which stops the callback where it yielded.

player:Send("Hit", 25, "Zombie")

Buffer​

Machine:Buffer(
trigger: string,
window: number,--

How long to keep retrying, in machine time

...: any--

Event data, passed as with Machine:Send

) → boolean--

true if it transitioned right away

Like Machine:Send, but if the trigger can't fire now it's kept for window seconds and retried after every transition and every Machine:Update, until it fires or expires. For input buffering: an attack pressed just before the current one ends still comes out.

Buffering a trigger that's already buffered replaces it, so mashing a button buffers one press.

UserInputService.InputBegan:Connect(function(input)
	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		fighter:Buffer("Attack", 0.2)
	end
end)

ClearBuffer​

Machine:ClearBuffer(
trigger: string?--

Only clear this trigger. Clears everything when omitted.

) → ()

Drops buffered triggers. Machine:Stop clears the buffer too.

CanSend​

Machine:CanSend(
trigger: string,
...: any--

Event data, passed to the Conditions

) → (
boolean,--

Whether Machine:Send would transition right now

RejectReason?--

Why not, when it wouldn't

)

Checks a trigger without sending it, for UI and AI ("can I dodge right now?"). It runs the Conditions, so keep them free of side effects.

local canDodge, reason = fighter:CanSend("Dodge")

Update​

Machine:Update(
dt: number--

Seconds since the last Update

) → ()

Advances machine time by dt, then, in order: fires due Scope:Delay timers, moves on from states whose State.Duration ran out, calls each active state's State.OnUpdate, and retries buffered triggers. Call it every frame:

RunService.Heartbeat:Connect(function(dt)
	fighter:Update(dt)
end)

Nothing time-based happens without it. Machines that don't use time don't need it.

Errors

TypeDescription
"Can't Update during a transition."Called from inside a callback

Start​

Machine:Start() → ()

Enters the default state (and its parents, and its State.Initial children). Calling it on a running machine exits the current state and starts over.

Before entering anything, Start checks the machine's setup, so typos fail at setup instead of mid-game: state names are unique, the default state exists, every transition's Target names one of the machine's states and its From matches the state it's in, and every Parent, Initial, Next and Except names a real state.

Errors

TypeDescription
"Default State not Defined."The default state isn't one of the machine's states
"... has a Transition to ..., which Doesn't Exist."A transition targets a state the machine doesn't have
"Can't Start during a transition."Called from inside a callback

Stop​

Machine:Stop() → ()

Exits the current state (and its parents) and stops the machine, cleaning up every Scope and clearing buffered triggers. Triggers sent while stopped are ignored. Call Machine:Start to run it again.

Called from inside a callback, it waits until the current transition finishes, then discards any queued triggers.

Destroy​

Machine:Destroy() → ()

Stops the machine and releases its states and details. Like Machine:Stop, it waits for the current transition to finish when called from inside a callback.

ForceState​

Machine:ForceState(
name: string,--

The state to move to

elapsed: number?--

How long the machine has already been in it. Defaults to 0.

) → ()

Moves straight to a state, skipping Conditions, Effects and State.Resistance (exits and enters still run). If the machine is already in that state, only its time is changed. For applying a server's Machine:Snapshot on a client, or resetting a fighter at round start. Scope:Delay timers aren't shifted by elapsed.

-- Client: snap to the server's state when prediction was wrong
remote.OnClientEvent:Connect(function(snapshot)
	if snapshot.State and not fighter:Is(snapshot.State) then
		fighter:ForceState(snapshot.State, snapshot.Time)
	end
end)

Errors

TypeDescription
"Isn't Active."The machine isn't running
"Can't ForceState during a transition."Called from inside a callback

Snapshot​

Machine:Snapshot() → Snapshot

The current state's name and how long the machine has been in it, as plain data to send to clients. Apply it with Machine:ForceState. Machine.Context isn't included.

Is​

Machine:Is(name: string) → boolean--

Whether the machine is in name, or in a child of it

if fighter:Is("Attacking") then -- true in Attacking's children too

IsAny​

Machine:IsAny(names: {string}) → boolean--

Whether Machine:Is is true for any of names

GetTag​

Machine:GetTag(tag: string) → any--

The tag's value in the innermost active state that sets it, or nil

Reads State.Tags. A child's value overrides its parent's.

HasTag​

Machine:HasTag(tag: string) → boolean--

Whether Machine:GetTag is truthy

Lets damage, movement and UI code ask about the state instead of checking state names:

if not target:HasTag("Invulnerable") then
	target:Send("Hit", damage)
end

GetScope​

Machine:GetScope(
name: string?--

An active state. Defaults to the state whose callback is running, or Machine.Current.

) → Scope

The Scope for the current stay in a state: everything added to it is cleaned up when the machine leaves that state. Inside OnEnter, OnExit, OnUpdate and Scope:Delay callbacks, machine:GetScope() is the scope of the state the callback belongs to.

Errors

TypeDescription
"... isn't active."The state isn't active (for example, from inside an Effect, between states)

GetTimeInState​

Machine:GetTimeInState(
name: string?--

An active state. Defaults to Machine.Current.

) → number--

Machine time since the state was entered, or 0 if it isn't active

-- A Condition: only cancel into a dodge after the attack's first 0.2s
function(machine)
	return machine:GetTimeInState() >= 0.2
end

GetHistory​

Machine:GetHistory() → {string}--

State names, oldest first, ending with Machine.Current

The names of the last states the machine was in. Keeps Felix.Details HistorySize entries (8 by default). Cleared by Machine:Start, which is also when a changed HistorySize takes effect. Returns a new table each call.

-- Back to whatever stance we were in before getting hit
local history = fighter:GetHistory()
local before = history[#history - 1]

Refresh​

Machine:Refresh() → ()

Rebuilds the machine's lookup tables. Inserting transitions or states after Machine:Start is picked up automatically; call this after replacing or removing them, or after changing a transition's Triggers.

GetStates​

Machine:GetStates() → {State}?--

The machine's states, or nil if it has none or was destroyed

Show raw api
{
    "functions": [
        {
            "name": "Send",
            "desc": "Sends a trigger. The machine looks for a transition listening for `trigger` in the current state's\n`Transitions` (in the order they were inserted), then in each parent's, then in [Machine.AnyTransitions].\nThe first one whose `Priority` meets the current [State.Resistance] and whose Conditions all pass fires.\nIf none does, nothing happens, [Machine.Rejected] fires, and `Send` returns `false`.\n\nA `Send` made from inside a callback is queued and runs after the current transition has fully finished,\nso it returns `false`. Errors thrown by callbacks are rethrown from `Send`.\n\nIf a callback yields (for example with `task.wait()`), the transition isn't finished until it resumes, so\nevery `Send` in the meantime is queued. That's rarely what you want in combat: use [Scope:Delay] to wait\ninstead. Set `CatchYields` (or `DebugMode`) in [Felix.Details] to turn a yield into an error, which stops the\ncallback where it yielded.\n\n```lua\nplayer:Send(\"Hit\", 25, \"Zombie\")\n```",
            "params": [
                {
                    "name": "trigger",
                    "desc": "The trigger name",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "Event data, passed after the machine to the Conditions, the old state's `OnExit`, the Effects and the new state's `OnEnter`",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "`true` if the machine transitioned",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1021,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Buffer",
            "desc": "Like [Machine:Send], but if the trigger can't fire now it's kept for `window` seconds and retried after every\ntransition and every [Machine:Update], until it fires or expires. For input buffering: an attack pressed just\nbefore the current one ends still comes out.\n\nBuffering a trigger that's already buffered replaces it, so mashing a button buffers one press.\n\n```lua\nUserInputService.InputBegan:Connect(function(input)\n\tif input.UserInputType == Enum.UserInputType.MouseButton1 then\n\t\tfighter:Buffer(\"Attack\", 0.2)\n\tend\nend)\n```",
            "params": [
                {
                    "name": "trigger",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "window",
                    "desc": "How long to keep retrying, in machine time",
                    "lua_type": "number"
                },
                {
                    "name": "...",
                    "desc": "Event data, passed as with [Machine:Send]",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "`true` if it transitioned right away",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1057,
                "path": "src/init.luau"
            }
        },
        {
            "name": "ClearBuffer",
            "desc": "Drops buffered triggers. [Machine:Stop] clears the buffer too.",
            "params": [
                {
                    "name": "trigger",
                    "desc": "Only clear this trigger. Clears everything when omitted.",
                    "lua_type": "string?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1084,
                "path": "src/init.luau"
            }
        },
        {
            "name": "CanSend",
            "desc": "Checks a trigger without sending it, for UI and AI (\"can I dodge right now?\"). It runs the Conditions, so keep\nthem free of side effects.\n\n```lua\nlocal canDodge, reason = fighter:CanSend(\"Dodge\")\n```",
            "params": [
                {
                    "name": "trigger",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "...",
                    "desc": "Event data, passed to the Conditions",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "Whether [Machine:Send] would transition right now",
                    "lua_type": "boolean"
                },
                {
                    "desc": "Why not, when it wouldn't",
                    "lua_type": "RejectReason?"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1113,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Update",
            "desc": "Advances machine time by `dt`, then, in order: fires due [Scope:Delay] timers, moves on from states whose\n[State.Duration] ran out, calls each active state's [State.OnUpdate], and retries buffered triggers.\nCall it every frame:\n\n```lua\nRunService.Heartbeat:Connect(function(dt)\n\tfighter:Update(dt)\nend)\n```\n\nNothing time-based happens without it. Machines that don't use time don't need it.",
            "params": [
                {
                    "name": "dt",
                    "desc": "Seconds since the last Update",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "errors": [
                {
                    "lua_type": "\"Can't Update during a transition.\"",
                    "desc": "Called from inside a callback"
                }
            ],
            "source": {
                "line": 1141,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Start",
            "desc": "Enters the default state (and its parents, and its [State.Initial] children). Calling it on a running machine\nexits the current state and starts over.\n\nBefore entering anything, `Start` checks the machine's setup, so typos fail at setup instead of mid-game: state\nnames are unique, the default state exists, every transition's `Target` names one of the machine's states and\nits `From` matches the state it's in, and every `Parent`, `Initial`, `Next` and `Except` names a real state.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "errors": [
                {
                    "lua_type": "\"Default State not Defined.\"",
                    "desc": "The default state isn't one of the machine's states"
                },
                {
                    "lua_type": "\"... has a Transition to ..., which Doesn't Exist.\"",
                    "desc": "A transition targets a state the machine doesn't have"
                },
                {
                    "lua_type": "\"Can't Start during a transition.\"",
                    "desc": "Called from inside a callback"
                }
            ],
            "source": {
                "line": 1169,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Stop",
            "desc": "Exits the current state (and its parents) and stops the machine, cleaning up every [Scope] and clearing\nbuffered triggers. Triggers sent while stopped are ignored. Call [Machine:Start] to run it again.\n\nCalled from inside a callback, it waits until the current transition finishes, then discards any queued triggers.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1200,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Destroy",
            "desc": "Stops the machine and releases its states and details. Like [Machine:Stop], it waits for the current\ntransition to finish when called from inside a callback.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1230,
                "path": "src/init.luau"
            }
        },
        {
            "name": "ForceState",
            "desc": "Moves straight to a state, skipping Conditions, Effects and [State.Resistance] (exits and enters still run).\nIf the machine is already in that state, only its time is changed. For applying a server's [Machine:Snapshot]\non a client, or resetting a fighter at round start. [Scope:Delay] timers aren't shifted by `elapsed`.\n\n```lua\n-- Client: snap to the server's state when prediction was wrong\nremote.OnClientEvent:Connect(function(snapshot)\n\tif snapshot.State and not fighter:Is(snapshot.State) then\n\t\tfighter:ForceState(snapshot.State, snapshot.Time)\n\tend\nend)\n```",
            "params": [
                {
                    "name": "name",
                    "desc": "The state to move to",
                    "lua_type": "string"
                },
                {
                    "name": "elapsed",
                    "desc": "How long the machine has already been in it. Defaults to `0`.",
                    "lua_type": "number?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "errors": [
                {
                    "lua_type": "\"Isn't Active.\"",
                    "desc": "The machine isn't running"
                },
                {
                    "lua_type": "\"Can't ForceState during a transition.\"",
                    "desc": "Called from inside a callback"
                }
            ],
            "source": {
                "line": 1273,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Snapshot",
            "desc": "The current state's name and how long the machine has been in it, as plain data to send to clients.\nApply it with [Machine:ForceState]. [Machine.Context] isn't included.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Snapshot"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1297,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Is",
            "desc": "```lua\nif fighter:Is(\"Attacking\") then -- true in Attacking's children too\n```",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "Whether the machine is in `name`, or in a child of it",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1315,
                "path": "src/init.luau"
            }
        },
        {
            "name": "IsAny",
            "desc": "",
            "params": [
                {
                    "name": "names",
                    "desc": "",
                    "lua_type": "{ string }"
                }
            ],
            "returns": [
                {
                    "desc": "Whether [Machine:Is] is true for any of `names`",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1330,
                "path": "src/init.luau"
            }
        },
        {
            "name": "GetTag",
            "desc": "Reads [State.Tags]. A child's value overrides its parent's.",
            "params": [
                {
                    "name": "tag",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "The tag's value in the innermost active state that sets it, or `nil`",
                    "lua_type": "any"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1342,
                "path": "src/init.luau"
            }
        },
        {
            "name": "HasTag",
            "desc": "Lets damage, movement and UI code ask about the state instead of checking state names:\n\n```lua\nif not target:HasTag(\"Invulnerable\") then\n\ttarget:Send(\"Hit\", damage)\nend\n```",
            "params": [
                {
                    "name": "tag",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "Whether [Machine:GetTag] is truthy",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1370,
                "path": "src/init.luau"
            }
        },
        {
            "name": "GetScope",
            "desc": "The [Scope] for the current stay in a state: everything added to it is cleaned up when the machine leaves\nthat state. Inside `OnEnter`, `OnExit`, `OnUpdate` and [Scope:Delay] callbacks, `machine:GetScope()` is the\nscope of the state the callback belongs to.",
            "params": [
                {
                    "name": "name",
                    "desc": "An active state. Defaults to the state whose callback is running, or [Machine.Current].",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Scope"
                }
            ],
            "function_type": "method",
            "errors": [
                {
                    "lua_type": "\"... isn't active.\"",
                    "desc": "The state isn't active (for example, from inside an Effect, between states)"
                }
            ],
            "source": {
                "line": 1386,
                "path": "src/init.luau"
            }
        },
        {
            "name": "GetTimeInState",
            "desc": "```lua\n-- A Condition: only cancel into a dodge after the attack's first 0.2s\nfunction(machine)\n\treturn machine:GetTimeInState() >= 0.2\nend\n```",
            "params": [
                {
                    "name": "name",
                    "desc": "An active state. Defaults to [Machine.Current].",
                    "lua_type": "string?"
                }
            ],
            "returns": [
                {
                    "desc": "Machine time since the state was entered, or `0` if it isn't active",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1414,
                "path": "src/init.luau"
            }
        },
        {
            "name": "GetHistory",
            "desc": "The names of the last states the machine was in. Keeps [Felix.Details] `HistorySize` entries (8 by default).\nCleared by [Machine:Start], which is also when a changed `HistorySize` takes effect. Returns a new table each call.\n\n```lua\n-- Back to whatever stance we were in before getting hit\nlocal history = fighter:GetHistory()\nlocal before = history[#history - 1]\n```",
            "params": [],
            "returns": [
                {
                    "desc": "State names, oldest first, ending with [Machine.Current]",
                    "lua_type": "{ string }"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1434,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Refresh",
            "desc": "Rebuilds the machine's lookup tables. Inserting transitions or states after [Machine:Start] is picked up\nautomatically; call this after replacing or removing them, or after changing a transition's `Triggers`.",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 1458,
                "path": "src/init.luau"
            }
        },
        {
            "name": "GetStates",
            "desc": "",
            "params": [],
            "returns": [
                {
                    "desc": "The machine's states, or `nil` if it has none or was destroyed",
                    "lua_type": "{ State }?"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 1469,
                "path": "src/init.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "Current",
            "desc": "The state the machine is in, or `nil` when it isn't running. In a hierarchical machine this is the innermost\nactive state; use [Machine:Is] to also match its parents.",
            "lua_type": "State?",
            "readonly": true,
            "source": {
                "line": 55,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Previous",
            "desc": "The state the machine was in before the last transition, or `nil` right after [Machine:Start].",
            "lua_type": "State?",
            "readonly": true,
            "source": {
                "line": 62,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Active",
            "desc": "Whether the machine is running: `true` between [Machine:Start] and [Machine:Stop].",
            "lua_type": "boolean",
            "readonly": true,
            "source": {
                "line": 69,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Context",
            "desc": "A table shared by every callback, for data like health, ammo or a target. It's the same table passed as\n`Context` in [Felix.Details], or an empty table if none was passed.",
            "lua_type": "C",
            "source": {
                "line": 76,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Clock",
            "desc": "Machine time in seconds: the sum of every `dt` passed to [Machine:Update]. [State.Duration], [Scope:Delay],\n[Machine:Buffer] windows and [Machine:GetTimeInState] all use it.",
            "lua_type": "number",
            "readonly": true,
            "source": {
                "line": 84,
                "path": "src/init.luau"
            }
        },
        {
            "name": "AnyTransitions",
            "desc": "Transitions that can fire from any state, for interrupts like getting stunned or dying. They're checked after\nthe current state's own transitions and its parents', so a state can handle a trigger its own way.\nTheir `From` must be `\"*\"`, and their `Except` lists states they don't fire from.\n\n```lua\ntable.insert(fighter.AnyTransitions, Felix.Transition.new({\n\tFrom = \"*\",\n\tTarget = \"Dead\",\n\tTriggers = { \"Die\" },\n\tPriority = math.huge,\n\tExcept = { \"Dead\" },\n}))\n```",
            "lua_type": "{ Transition }",
            "source": {
                "line": 102,
                "path": "src/init.luau"
            }
        },
        {
            "name": "ID",
            "desc": "The `id` passed to [Felix.new]. Used in error messages.",
            "lua_type": "any",
            "readonly": true,
            "source": {
                "line": 109,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Default",
            "desc": "The name of the state entered by [Machine:Start].",
            "lua_type": "string",
            "readonly": true,
            "source": {
                "line": 116,
                "path": "src/init.luau"
            }
        },
        {
            "name": "StateChanged",
            "desc": "Fires with `(newState, oldState, ...)` whenever [Machine.Current] changes: after a state's `OnEnter` runs,\nand after `OnExit` when the machine stops. `...` is the event data passed to [Machine:Send].\n`newState` is `nil` on [Machine:Stop], and `oldState` is `nil` on [Machine:Start]; neither has event data.\n\nA [Machine:Send] made from a handler is queued like one made from any other callback.\n\nHandlers run on their own thread. If a handler yields, the machine may have moved on by the time it resumes,\nso use the `newState` argument rather than reading [Machine.Current] after a yield.\n\n```lua\nlocal connection = machine.StateChanged:Connect(function(newState, oldState, ...)\n\tprint(oldState and oldState.Name, \"->\", newState and newState.Name, ...)\nend)\n\nconnection:Disconnect()\n```",
            "lua_type": "Signal",
            "readonly": true,
            "source": {
                "line": 138,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Rejected",
            "desc": "Fires with `(trigger, reason, ...)` when a [Machine:Send] doesn't transition. `reason` is a [Felix.RejectReason].\nTriggers retried by [Machine:Buffer] don't fire it.\n\n```lua\nfighter.Rejected:Connect(function(trigger, reason)\n\twarn(`{trigger} rejected: {reason}`) --> Parry rejected: Resisted\nend)\n```",
            "lua_type": "Signal",
            "readonly": true,
            "source": {
                "line": 152,
                "path": "src/init.luau"
            }
        }
    ],
    "types": [],
    "name": "Machine",
    "desc": "A state machine, created by [Felix.new]. It holds a list of [State]s, is in at most one of them at a time\n(plus that state's parents, see [State.Parent]), and moves between them when you [Machine:Send] a trigger\nthat one of the current state's [Transition]s listens for.\n\n`C` is the type of the machine's [Machine.Context]. It defaults to `any`.\n\nFields starting with an underscore (`_Queue`, `_Transitioning`, …) are internal and may change between versions.",
    "source": {
        "line": 47,
        "path": "src/init.luau"
    }
}