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:
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
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).
Tell us what's wrongGive feedback
By engine: more common in Source games.
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).
Tell us what's wrongGive feedback