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

Context.WriteTextFile

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

Context.WriteTextFile(
  path: string,
  ...lines: string
): boolean

NemirtingasEpicEmu.json edition from a handler example:

AI-writtenAI-written. Based on: Nucleus GenericContext.cs (opens in a new tab) (WriteTextFile).
  • path: Full path of the file to write; an existing file is deleted first, so its old content is lost.
  • lines: The text: one or more lines, as separate arguments or an array; each becomes a line, with no line break after the last.

Category: Nemirtingas Epic Emulator

AI-writtenAI-written. Based on: Nucleus GenericContext.cs (opens in a new tab) (WriteTextFile); Verified Hub handlers, counted 2026-11-17 (opens in a new tab).

In practice

Deletes the file if it exists and writes the lines, one per line (no line break after the last). Handlers call it in Game.Play to write a small config, an autoexec or a Steam emulator's user name file for each instance.

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

By engine: more common in Source games.

AI-writtenAI-written. Based on: Nucleus GenericContext.cs (opens in a new tab) (WriteTextFile); Verified Hub handlers, counted 2026-11-17 (opens in a new tab).

Example

Context.WriteTextFile(
  Context.GetFolder(Nucleus.Folder.InstancedGameFolder) +
  "\\autoexec.cfg",
  ["name " + Context.Nickname, "fullscreen 0"]
);
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