ax.recognition¶
Source: gamemode/modules/recognition/libraries/sh_recognition.lua
Recognition system for tracking character familiarity, aliases, and name display.
Documented functions: 6
Functions¶
ax.recognition:GetAlias(char, targetID)ax.recognition:GetDisplayDescription(char, targetID)ax.recognition:GetRecord(char, targetID)ax.recognition:GetTier(score)ax.recognition:IsGloballyRecognized(targetChar)ax.recognition:NormalizeFamiliarity(familiarity)
ax.recognition:GetAlias(char, targetID)¶
Resolve the display name that char uses for the character with ID targetID.
Returns the stored alias at ACQUAINTED or above, otherwise "Unknown".
Globally recognised faction members always show their real name.
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
char |
table |
The perceiver's character instance |
targetID |
number |
The target character's ID |
Returns
string: Display name or fallback string
ax.recognition:GetDisplayDescription(char, targetID)¶
Resolve the description that char should see for the character with ID targetID.
Returns nil for strangers (description hidden). Returns the real description at SEEN or above.
Globally recognised faction members always show their real description.
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
char |
table |
The perceiver's character instance |
targetID |
number |
The target character's ID |
Returns
string|nil: Description string, or nil when the perceiver shouldn't see one yet
ax.recognition:GetRecord(char, targetID)¶
Retrieve the familiarity record that char holds for targetID.
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
char |
table |
The perceiver's character instance |
targetID |
number |
The target character's ID |
Returns
table|nil: Record{ score, alias, lastSeen }, or nil if none exists
ax.recognition:GetTier(score)¶
Derive the familiarity tier for a given raw score.
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
score |
number |
Raw familiarity score (0–200+) |
Returns
number: Tier integer (0 = STRANGER … 4 = TRUSTED)
ax.recognition:IsGloballyRecognized(targetChar)¶
Check whether a character's faction grants global recognition.
When a faction sets isGloballyRecognized = true, all of its members are treated
as at least ACQUAINTED by every perceiver, regardless of individual score.
The optional globalFamiliarityFloor field on the faction sets which tier is the
minimum; it defaults to ACQUAINTED (2) when omitted.
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
targetChar |
table |
The target character instance |
Returns
boolean: True when the target's faction is globally recognised
ax.recognition:NormalizeFamiliarity(familiarity)¶
Normalize a familiarity table to canonical string keys and sanitized records.
This prevents JSON/network round-trips from collapsing mixed numeric/string keys
(e.g. 123 and "123") into duplicate object keys, which can silently discard
aliases after reconnects.
Realm: shared
Parameters
| Name | Type | Description |
|---|---|---|
familiarity |
table |
Familiarity map keyed by target character ID |
Returns
boolean: True when the table was modified in-place