SetMonsterIdVisible

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

setMonsterIdVisible

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

Shows or hides the numeric identifier in a resource-owned monster's nameplate.

Syntax

bool setMonsterIdVisible(string monsterId, bool visible)

Parameters

Name Type Required Description
monsterId string yes The opaque decimal monster identifier returned by spawnMonster or getMonsters.
visible bool yes True to show the numeric monster ID or false to hide it.

Returns

Returns true when the visibility change is accepted and replicated; otherwise returns false.

Examples

Keep a monster's display name but hide its technical identifier:

setMonsterName(monsterId, "Cave Guardian")
setMonsterIdVisible(monsterId, false)

Notes

  • Available only in server-side resource scripts.
  • Only the resource that created the monster may change this field.
  • The state is exposed as getMonsterData(monsterId).nameplateIdVisible and replayed during relevance entry and late join.
  • When the value changes, the server emits onMonsterIdVisibilityChange(monsterId, previousVisible, visible, sourceResource). Repeating the current value remains a successful no-op and does not emit the event.
  • setMonsterNameplateIdVisible is a compatibility alias for this function; use setMonsterIdVisible in new resources.