OnNpcIdVisibilityChange

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 18:41, 3 September 2026 by QCherry (talk | contribs) (Document Lua events available or improved from G1R:MP 0.1.2)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

onNpcIdVisibilityChange

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

Triggered after a resource shows or hides the numeric identifier in a scripted NPC's nameplate.

Availability

This event is available in server-side scripts.

Callback signature

onNpcIdVisibilityChange(npcId, previousVisible, visible, sourceResource)

Parameters

Name Type Description
npcId int The affected NPC identifier.
previousVisible bool Whether the numeric identifier was previously visible.
visible bool Whether the numeric identifier is now visible.
sourceResource string The resource that requested the change.

Examples

Handle the event:

addEventHandler("onNpcIdVisibilityChange", root, function(npcId, previousVisible, visible, sourceResource)
    outputDebugString("NPC " .. npcId .. " numeric ID visible=" .. tostring(visible))
end)

Notes

  • The NPC display name remains visible; only the appended numeric identifier changes.
  • The authoritative setting is replayed during relevance entry and late join.