Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofpackage pursuitKit.package·originates fromworld 0a0b119f-a…

awareness

One meter per observer, 0 (unaware) to 1 (certain), with two thresholds.

byzero-proxy @ DESKTOP-DB3UJOJ·posted 11d ago
What it does

awareness

One meter per observer, 0 (unaware) to 1 (certain), with two thresholds.

Each tick the host says how fast each observer that can currently see the suspect is filling (from
perception.fillRate); everyone else drains. Crossing a threshold is a moment, returned as an event:

  local Awareness = require("~.modules.awareness")
  local aw = Awareness.new(cfg)                         -- the kit config (reads cfg.observers[kind])
  local events = aw:tick(dt, { { id = "w1", kind = "guard", rate = 0.6 }, ... })
  -- events: { type = "suspicious" | "alert" | "calm", id, kind, onAlert? }
  aw:value("w1")   aw:stage("w1")   -- 0..1 and "unaware" | "suspicious" | "alert"
  aw:max()         -- highest value, and whose (the HUD's meter)
  aw:forget("w1")  -- the observer left the world
  aw:set("w1", "guard", 1)   -- a host-forced value (a radio call that tells a guard for certain)
  aw:snapshot()    -- { { id, kind, value, stage } } sorted by value, for UI

An observer stays "alert" until it has drained below its suspicious threshold again ("calm"), so a pursuer that
loses sight for a moment does not forget whom it was chasing.

The interface is documented in the header of init.luau; this file repeats it for the asset browser.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

pursuitKit.modules.awareness — one meter per observer, 0 (unaware) to 1 (certain), with two thresholds. Each tick the host says how fast each observer that can currently see the suspect is filling (from perception.fillRate); everyone else drains. Crossing a threshold is a moment, returned as an event: local Awareness = require("~.modules.awareness") local aw = Awareness.new(cfg) -- the kit config (reads cfg.observers[kind]) local events = aw:tick(dt, { { id = "w1", kind = "guard", rate = 0.6 }, ... }) -- events: { type = "suspicious" | "alert" | "calm", id, kind, onAlert? } aw:value("w1") aw:stage("w1") -- 0..1 and "unaware" | "suspicious" | "alert" aw:max() -- highest value, and whose (the HUD's meter) aw:forget("w1") -- the observer left the world aw:set("w1", "guard", 1) -- a host-forced value (a radio call that tells a guard for certain) aw:snapshot() -- { { id, kind, value, stage } } sorted by value, for UI An observer stays "alert" until it has drained below its suspicious threshold again ("calm"), so a pursuer that loses sight for a moment does not forget whom it was chasing.

new(cfg: any) → any

A new tracker reading thresholds and drain from cfg.observers.

argtypedescription
cfgany

entry(self: any, id: string, kind: string) → any

argtypedescription
selfany
idstring
kindstring

restage(self: any, e: any, events: { any }) → void

argtypedescription
selfany
eany
events{ any }

tick(dt: number, seeing: { any }) → void

Advance every meter. `seeing` lists the observers that can see the suspect now with their fill rates; observers not listed drain. Returns the threshold events of this tick.

argtypedescription
dtnumber
seeing{ any }

set(id: string, kind: string, value: number) → void

Force one observer's meter (told by radio, a scripted moment). Returns the threshold events it caused.

argtypedescription
idstring
kindstring
valuenumber

value(id: string) → number

argtypedescription
idstring

stage(id: string) → string

argtypedescription
idstring

max( ) → void

The highest meter and its observer's id (0, nil when nobody has noticed anything).

anyAlertPursuer( ) → boolean

Whether any observer of a kind that can pursue is alert.

forget(id: string) → void

argtypedescription
idstring

reset( ) → void

Empty every meter (the incident is over).

snapshot( ) → void

Every observer that has noticed anything, highest first: { { id, kind, value, stage } }.

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.