OnNpcIdVisibilityChange: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document the NPC ID visibility event planned for G1R:MP update 0.1.2
 
Document Lua events available or improved from G1R:MP 0.1.2
 
Line 1: Line 1:
= onNpcIdVisibilityChange =
= onNpcIdVisibilityChange =
<div style="background:#0b0b0b; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#f1f1f1; padding:0.85rem 1rem; margin:0.75rem 0 1rem;">
<div style="background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;">
<div style="color:#ff5a5a; font-weight:bold; letter-spacing:0.04em;">COMING IN UPDATE 0.1.2</div>
<div style="color:#111111; font-weight:bold; letter-spacing:0.04em;">AVAILABLE FROM UPDATE 0.1.2</div>
<div style="color:#f1f1f1; margin-top:0.25rem;">This event is documented in advance and is not yet available in the current public release.</div>
<div style="color:#111111; margin-top:0.25rem;">This event is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.</div>
</div>
</div>



Latest revision as of 18:41, 3 September 2026

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.