Roseinspectableuser
Based on game build 714014 | Last updated: 2026-03-03
Overview
Roseinspectableuser handles the behavior of entities using the Rose Glasses to inspect other entities or world points for hidden properties. It manages the cooldown state, creates and maintains a charlieresidue effect during inspection, and coordinates with roseinspectable components on targets to perform inspection. It also provides quips (dialogue) via the talker component and persists cooldown state across saves.
Usage example
local inst = CreateEntity()
inst:AddComponent("roseinspectableuser")
inst:AddTag("inspector")
inst:AddComponent("talker")
-- Begin inspecting a target
local target = some_entity
if inst.components.roseinspectableuser:TryToDoRoseInspectionOnTarget(target) then
-- Inspection started successfully; residue will be spawned
end
-- Later, to trigger immediate cooldown
inst.components.roseinspectableuser:GoOnCooldown()
Dependencies & tags
Components used: talker, roseinspectable (via target.components.roseinspectable), player_classified (optional), health (indirect, for talker), revivablecorpse, sleeper (via talker), Transform, Inspectable (via CLOSEINSPECTORUTIL).
Tags: Checks lunar_aligned, notroseinspectable on target (as invalid); adds no tags.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
inst | Entity | nil | The entity owning this component. |
cooldowntime | number | TUNING.SKILLS.WINONA.ROSEGLASSES_COOLDOWNTIME | Duration (in seconds) for cooldown after inspection. |
target | Entity | nil | The target entity currently being inspected. |
point | Vector | nil | The world point currently being inspected. |
residue | Entity | nil | The charlieresidue prefab instance spawned during inspection. |
quipcooldowntime | number | nil | Timestamp used to throttle quip (dialogue) output. |
cooldowntask | Task | nil | Scheduled task for ending the cooldown period. |
Main functions
SetCooldownTime(cooldowntime)
- Description: Updates the cooldown duration used by
GoOnCooldown. - Parameters:
cooldowntime(number) – new cooldown duration in seconds. - Returns: Nothing.
GoOnCooldown()
- Description: Starts the cooldown timer using the current
cooldowntime. Cancels any existing cooldown task first. - Parameters: None.
- Returns: Nothing.
OnCharlieResidueActivated(residue)
- Description: Triggered when the spawned
charlieresidueis activated (typically when the user releases the inspect key or the residue times out). Performs the actual inspection on thetargetorpoint, applying cooldown if needed. - Parameters:
residue(Entity) – the residue instance being activated. - Returns: Nothing.
- Error states: Returns early if
residuedoes not matchself.residue.
SetRoseInpectionOnTarget(target)
- Description: Begins inspecting a target entity. Spawns a residue linked to the target and sets up event listeners.
- Parameters:
target(Entity) – the entity to inspect. - Returns: Nothing.
SetRoseInpectionOnPoint(point)
- Description: Begins inspecting a world point (e.g., a tile or location). Spawns a residue at the point.
- Parameters:
point(Vector or point-like object) – world coordinates of the inspection target. - Returns: Nothing.
TryToDoRoseInspectionOnTarget(target)
- Description: Validates and attempts to start an inspection on a target. Returns success status and an optional quip key for failure reasons.
- Parameters:
target(Entity) – entity to inspect. - Returns:
success(boolean),quip_reason(string | nil) – quip key for failure (e.g.,"ROSEGLASSES_COOLDOWN"), ornilif successful. - Error states: Returns
falseif target is a residue, invalid (CLOSEINSPECTORUTIL.IsValidTarget), has invalid tags (lunar_aligned,notroseinspectable), lacksroseinspectable, or cannot spawn residue.
TryToDoRoseInspectionOnPoint(pt)
- Description: Begins inspection of a world point and returns success.
- Parameters:
pt(Vector) – point to inspect. - Returns:
true(always succeeds if called). - Error states: None identified.
DoRoseInspectionOnPoint()
- Description: Evaluates all configured
ROSEPOINT_CONFIGURATIONSat the currentself.pointand executes the first matching callback. Returns whether a cooldown should be applied. - Parameters: None.
- Returns:
will_cooldown(boolean) – whether the successful configuration induces a cooldown. - Error states: Returns
falseif no configuration matches or all matching configurations are on cooldown (and a quip is triggered).
DoQuip(reason, failed)
- Description: Triggers a line of dialogue via
talker.Saybased onreason. Throttles subsequent quips viaquipcooldowntime. - Parameters:
reason(string) – localization key for the dialogue line (e.g.,"ANNOUNCE_ROSEGLASSES","ROSEGLASSES_COOLDOWN").failed(boolean) – iftrue, triggers a failure quip and ignores throttle.
- Returns: Nothing.
ApplyCooldown(duration)
- Description: Starts a task to end the cooldown after
durationseconds and notifiesplayer_classified.roseglasses_cooldownon the client. - Parameters:
duration(number) – cooldown duration in seconds. - Returns: Nothing.
OnCooldown()
- Description: Called when the cooldown timer ends. Resets
cooldowntaskand notifiesplayer_classified.roseglasses_cooldown. - Parameters: None.
- Returns: Nothing.
IsInCooldown()
- Description: Checks whether the component is currently in a cooldown state.
- Parameters: None.
- Returns:
trueifcooldowntaskis notnil; otherwisefalse.
ForceDecayResidue()
- Description: Immediately destroys the currently spawned
residue, if any, and cleans up listeners. - Parameters: None.
- Returns: Nothing.
SpawnResidue()
- Description: Destroys any existing residue, spawns a new
charlieresidue, positions it attargetorpoint, and sets uponremovelisteners. - Parameters: None.
- Returns: Nothing.
OnSave()
- Description: Serializes remaining cooldown time for save/load.
- Parameters: None.
- Returns:
data(table) – containscooldown(number) if active. - Error states: Returns an empty table if no cooldown is active.
OnLoad(data)
- Description: Restores cooldown state from save data.
- Parameters:
data(table) – saved component data. - Returns: Nothing.
LongUpdate(dt)
- Description: Handles cooldown refinement across frame updates (e.g., for pause/sync), re-scheduling the task with updated remaining time.
- Parameters:
dt(number) – delta time since last update. - Returns: Nothing.
GetDebugString()
- Description: Returns a string for debug display showing the current
target/pointand remaining cooldown time. - Parameters: None.
- Returns:
debug_str(string) – e.g.,"Target: mytarget, Cooldown: 2.3".
Events & listeners
- Listens to:
"onremove"onself.residue– triggersself.residue._onresidueremovedto clearself.residue."onremove"onself.inst– handled via residue'sFXOwnerlifecycle."onremove"inSetRoseInpectionOnTarget– registered directly onself.residuefor cleanup."onremove"inOnRemoveFromEntity– cancels and clearscooldowntask.
- Pushes:
"silentcloseinspect"– fired when quip is throttled."ROSEGLASSES_COOLDOWN"quip viatalker.Say– not a game event but triggers dialogue.