Skip to main content

Named Replica

Based on game build 714014 | Last updated: 2026-03-03

Overview

Named Replica is a lightweight component that handles the replication of entity name and author metadata between server and clients in multiplayer sessions. It creates networked variables (net_string) for _name and _author_netid, and sets up local listeners on non-master clients to synchronize inst.name and inst.name_author_netid when changes occur. The component is intended for server-authoritative updates only.

Usage example

local inst = CreateEntity()
inst:AddComponent("named_replica")
-- Server-side only
inst.components.named_replica:SetName("Legendary Artifact", "Player123")

Dependencies & tags

Components used: None identified
Tags: None identified

Properties

PropertyTypeDefault ValueDescription
inst.replica.named._namenet_string(created in constructor)Networked string for the entity's display name.
inst.replica.named._author_netidnet_string(created in constructor)Networked string for the entity's author netid.
inst.namestringSTRINGS.NAMES[UPPERCASE_PREFAB]Local cached name, synced from replica.
inst.name_author_netidstring or nilnilLocal cached author netid, synced from replica.

Main functions

SetName(name, author)

  • Description: Sets the entity's name and author netid on the server. Values are replicated to all clients.
  • Parameters:
    name (string) — The display name to assign.
    author (string) — The netid of the entity's author (e.g., player who placed or created it).
  • Returns: Nothing.
  • Error states: Only executes on the master simulation (TheWorld.ismastersim). Client calls have no effect.

Events & listeners

  • Listens to:
    namedirty — Triggers OnNameDirty() to update inst.name from the replica name on non-master clients.
    authordirty — Triggers OnAuthorDirty() to update inst.name_author_netid from the replica author on non-master clients.
  • Pushes: None.