Nucleus handler tools โบ Docs โบ Game โบ Play
Game.Play
Open in the workbench (search, and try it in a handler)
Game.Play: () => void
Called once per instance (player), in player order. By default it runs after Nucleus has set up the instance (Goldberg, XInput DLLs, ...) and before the game starts, and Context.StartArguments is read after it. Game.GamePlayBeforeGameSetup runs it before that setup; Game.GamePlayAfterLaunch runs it after the game has started (then Context.StartArguments has no effect). If both are true it never runs. Context, Player, PlayerList, Handler and ProtoInput are available inside it. An error thrown here ends the whole session.
In practice
Where nearly every handler does each instance's own setup: read Context.Width/Height and Context.Nickname, write configs with Context.ModifySaveFile or Context.ReplaceLinesInTextFile, copy files, and set Context.StartArguments.
Example
Game.Play = function () {
Context.StartArguments =
"-windowed -width " +
Context.Width +
" -height " +
Context.Height;
};