SetPlayerNameplateVisibleFor

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

setPlayerNameplateVisibleFor

AVAILABLE FROM UPDATE 0.1.3
This function is available in G1R:MP 0.1.3 and later. The contract below includes the compatibility guarantees introduced in that update.

Overrides a target player's overhead whole-label visibility for one observer only.

Syntax

bool setPlayerNameplateVisibleFor(int observerId, int targetId, bool visible)

Parameters

Name Type Required Description
observerId int yes The connected human player who will see the label.
targetId int yes The different connected human player whose overhead label is controlled.
visible bool yes Strict boolean: false hides the entire label, including ID and speaking suffix; true permits it under normal rendering rules.

Returns

Returns true when the server accepts the change or an identical owned no-op; false for invalid arguments/endpoints, ownership conflicts, unavailable service or exhausted limits. Acceptance is not a client-render acknowledgement.

Examples

Change only observer A's view of target B:

local accepted = setPlayerNameplateVisibleFor(observerId, targetId, false)
if not accepted then
    outputDebugString("Nameplate override rejected")
end

Notes

  • Available only in server-side resource scripts.
  • The ordered pair is observer -> target; the reverse pair is independent. Both IDs must be distinct, connected session IDs, not persistent character IDs or NPC IDs.
  • Each field resolves independently: explicit pair override, then the target's current global field, then the native default. Getters expose server policy, not whether pixels are currently rendered.
  • No built-in acquaintance database or gamemode permission policy is assumed. See Observer nameplates for resource ownership, limits, persistence and privacy boundaries.
  • A pair field is exclusively owned by the resource that first sets it. Another resource cannot overwrite or reset that field; other fields remain independent. An absent reset and an identical owned write are successful no-ops.
  • Pair overrides survive leaving the synchronization range, but are cleared for both endpoints on disconnect and for their owning resource on stop. State is replayed reliably when the target becomes relevant again; no database persistence is automatic.
  • Limits default to 250,000 active pairs globally and per resource, with a per-resource mutation token bucket of 4,096/s and an 8,192 burst. New/changed non-reset writes consume tokens; resets and cleanup do not. See the guide for configuration keys.
  • Only actual Lua booleans are accepted; numbers, strings, nil and missing arguments return false. Voice audio routing is not changed.
  • PascalCase alias: SetPlayerNameplateVisibleFor.