SetMonsterName

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

setMonsterName

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.

Changes the validated overhead display name of a resource-owned monster.

Syntax

bool setMonsterName(string monsterId, string name)

Parameters

Name Type Required Description
monsterId string yes The opaque decimal monster identifier returned by spawnMonster or getMonsters.
name string yes A 3-16 character display name using letters, numbers, single spaces, underscores or hyphens.

Returns

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

Examples

Name an elite encounter:

if setMonsterName(monsterId, "Mine Guardian") then
    outputDebugString("Monster named")
end

Notes

  • Available only in server-side resource scripts.
  • Only the resource that created the monster may rename it.
  • The validated name is exposed as getMonsterData(monsterId).name and replayed during relevance entry and late join.
  • When accepted, the server emits onMonsterNameChange(monsterId, previousName, name, sourceResource).