Nucleus handler tools โ€บ Docs โ€บ Game โ€บ AddOption

Game.AddOption

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

Game.AddOption(
  name: string,
  desc: string,
  key: string,
  value: any,
  defaultValue: any
): void
Game.AddOption(
  name: string,
  desc: string,
  key: string,
  value: any
): void
AI-writtenAI-written. Based on: Nucleus GenericGameInfo.cs (opens in a new tab); GenericGameHandler.cs (opens in a new tab).

Adds a user-selectable option to the game profile. Read it back in Game.Play with Context.Options["key"].

AI-writtenAI-written. Based on: Nucleus GenericGameInfo.cs (opens in a new tab) (AddOption); GameOption.cs (opens in a new tab); PlayerOptionsControl.cs (opens in a new tab); GameProfile.cs (opens in a new tab).
  • name: Title of the option shown to the player in Nucleus' options list.
  • desc: Description shown under the title.
  • key: Name the handler reads the chosen value with: Context.Options[key].
  • value: Default value or choices: an array of choices shows a drop-down (first item preselected); an empty array shows a text box.
  • defaultValue: Stored on the option, but no Nucleus code reads it; a drop-down starts on the first item of value.
AI-writtenAI-written. Based on: Nucleus GenericGameInfo.cs (opens in a new tab) (AddOption); GameProfile.cs (opens in a new tab) (LoadGameProfile, saved answers come back as text); Verified Hub handlers, counted 2026-11-17 (opens in a new tab).

In practice

Adds a question Nucleus asks before the session (usually a list to pick from), at the top level of the handler. The answer is in Context.Options["<key>"] inside Game.Play, as text when it comes from a saved profile. Handlers ask things like a resolution, an FPS cap or which instances get sound.

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

By engine: rarer in Unity games.

AI-writtenAI-written. Based on: Nucleus GenericGameInfo.cs (opens in a new tab) (AddOption); GameProfile.cs (opens in a new tab) (LoadGameProfile, saved answers come back as text); Verified Hub handlers, counted 2026-11-17 (opens in a new tab).

Example

Game.AddOption(
  "Limit the frame rate?",
  "Some games run too fast without it.",
  "fps",
  ["60", "120", "Unlimited"]
);
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