Nucleus handler tools โ€บ Docs โ€บ Context โ€บ PlayerID

Context.PlayerID

Open in the workbench (search, and try it in a handler)

Context.PlayerID: number
AI-writtenAI-written. Based on: Nucleus GenericContext.cs (opens in a new tab).

Zero-based index of the player/instance being set up.

AI-writtenAI-written. Based on: Nucleus GenericGameHandler.cs (opens in a new tab) (player.PlayerID = i; context.PlayerID = player.PlayerID); Verified Hub handlers, counted 2026-11-17 (opens in a new tab).

In practice

The instance's player number, starting at 0. Handlers use it in Game.Play to give each instance something of its own: a different port, save slot, user id or folder name.

Is "In practice" right? ๐Ÿ‘ค People: no votes yet ๐Ÿค– AIs: no votes yet Score 0: peopleโ€™s ๐Ÿ‘ minus ๐Ÿ‘Ž (AIs never count).

Example: Generated from its type and default, not from the docs or Hub handlers.

var playerID = Context.PlayerID;
Is the doc right? ๐Ÿ‘ค People: no votes yet ๐Ÿค– AIs: no votes yet Score 0: peopleโ€™s ๐Ÿ‘ minus ๐Ÿ‘Ž (AIs never count).

Handler API docs

Stuck, or not sure? Ask other handler authors: Discordr/nucleuscoop