Nucleus handler tools › Docs › Context
Context
Open in the workbench (search, and try it in a handler)
One player's instance, inside Game.Play: launch arguments, folders and files to edit.
Context.Arch· string — Architecture of the game executable ("x86" or "x64").Context.AspectRatio· string — Player's aspect ratio (e.g. 16:9).Context.AspectRatioDecimal· number — Player's aspect ratio in decimal (e.g. 1777777).Context.BackupFile— Copies a file to <name>_NUCLEUS_BACKUP<ext> next to it; when the session ends Nucleus deletes the original and moves the backup back.…Context.BackupFiles· string[] — Copied from Game.BackupFiles for the current instance.Context.BackupFolders· string[] — Copied from Game.BackupFolders for the current instance.Context.BinariesFolder· string — In which folder the game exe is located? Relative path to where Nucleus should start the game's working folder to.Context.BlockRawInput· boolean — Disable raw input devices in game | default: false.Context.ChangeExe· boolean — Will rename the game's executable to "<exe name> - Player X", x being the instance/player #.Context.ChangeXmlAttributeValue— Opens the XML file path (environment variables like %APPDATA% are expanded), sets attribute attributeName to attributeValue on every node…Context.ChangeXmlNodeInnerTextValue— Edit an XML element (previously only nodes and attributes).Context.ChangeXmlNodeValueContext.CMDBatchAfter· string[] — When using CMDLaunch (or UseForceBindIP), specify command lines to run AFTER the game launches in same cmd session, syntax is instance and…Context.CMDBatchBefore· string[] — When using CMDLaunch (or UseForceBindIP), specify command lines to run BEFORE the game launches in same cmd session, syntax is instance and…Context.CMDBatchClose· string[] — Copied from Game.CMDBatchClose for the current instance.Context.CMDLaunch· boolean — Launch a game using command prompt.Context.CMDOptions· string[] — Specify command line options if game is launched using command prompt | requires CMDLaunch to be true, each element is for a different…Context.CMDStartArgsInside· boolean — Game.CMDBatchClose ["cmd1", "cmd2"]; //Run command lines upon exiting Nucleus.Context.ConvertToBytesContext.ConvertToIntContext.ConvertToStringContext.CopyCustomUtils· string[] — Copy a file or folder you specify between the quotes to each instance folder, if the file/folder is located in Nucleus folderutilsUser.…Context.CopyFiles· string[] — Copy files from the game directory to the instanced folder.Context.CopyFolder— Copies the folder source with all its files and subfolders into destination (both full paths), creating the destination folders. Files that…Context.CopyScriptFolder— Copies the handler's folder (Game.Folder) to the given destination.Context.CreatedDate— Change the creation date of a file.Context.CreateRegKey— Create a registry key for current user, baseKey can either be "HKEY_LOCAL_MACHINE" or "HKEY_CURRENT_USER".Context.CustomUserGeneralValues· string[] — Answers to Game.CustomUserGeneralPrompts.Context.CustomUserInstanceValues· string[] — Answers to Game.CustomUserInstancePrompts for the current instance.Context.CustomUserPlayerValues· string[] — Answers to Game.CustomUserPlayerPrompts for the current player.Context.Debug· boolean — Writes a detailed debug log while the handler runs.Context.DeleteRegKey— Delete a registry key for current user, baseKey can either be "HKEY_LOCAL_MACHINE" or "HKEY_CURRENT_USER".Context.DeleteRegKeyValuesContext.DocumentsConfigPath· string — Relative path from user profile to game's config path | requires Game.DocumentsConfigPath be set.Context.DocumentsPlayer· string — Path to current players Nucleus documents environment.Context.DocumentsRoot· string — Path to Nucleus documents environment root folder.Context.DocumentsSavePath· string — Relative path from user profile to game's save path | requires Game.DocumentsSavePath be set.Context.DPIHandling· Nucleus.DPIHandling | number | boolean — <summary "DPIHandling" is deprecated since v2.3.3, keep it for old handlers using it but has no effect.Context.EditRegKey— Edit a registry key for current user, baseKey can either be "HKEY_LOCAL_MACHINE" or "HKEY_CURRENT_USER".Context.EditRegKeyNoBackup— Edit a registry key for current user without Nucleus creating a backup of the registry or before it creates one. Must be placed before any…Context.EditTextFileContext.EditZipFileContext.EnvironmentPlayer· string — Path to current players Nucleus environment.Context.EnvironmentRoot· string — Path to Nucleus environment root folder.Context.EpicLang· string — Can be use to edit NemirtingasEpicEmu.jsonContext.ExecutableContext· string[] — Array with the name of other files found in the executable's folder (so we don't confuse different games with similar file names). Example:…Context.ExecutableName· string — The name of the game executable with the extension. This will be used by Nucleus to add games, to run the game and as process to follow for…Context.ExePath· string — Full path of the executable being launched for this instance.Context.ExtractZipContext.FakeFocus· boolean — Enable or disable the sending of focus messages to each game window at a regular interval | default: false.Context.FakeFocusInstances· string — If you only want specific instances to have fake focus messages sent to, specify them in a comma seperated string.Context.FindFilePartialNameContext.FindFiles— Return a string array of filenames (and their paths) found that match a pattern you specify.Context.FindLineNumberInTextFile— Returns a line number (int), utilizes a newly created enum SearchType.Context.ForceWindowTitle· boolean — Forces the game window title to be whatever is specified in Game.Hook.ForceFocusWindowName (triggers once, after all instances have…Context.GameName· string — Title of the game that will be shown in Nucleus.Context.GamepadGuid· string — Get the raw gamepad guidContext.GamepadId· number — Useful to make sure that controllers are correctly assigned to the player they are meant to be assigned.Context.GetFileNameContext.GetFolder— Path to the Nucleus Co-op current instance root folder (Nucleus-CoopcontentGUIDInstance#).Context.GogLang· string — Can be use to edit NemirtingasGalaxyEmu.json from handlersContext.GoldbergNeedSteamInterface· boolean — Some older games require a steam_interfaces.txt file for Goldberg to work | Will first search orig game path and nucleus games path, if not…Context.GUID· string — The name of the folder that will be created inside the Nucleus content folder (just use letters not symbols). In this folder Nucleus will…Context.HandlerGUID· stringContext.HandlerInterval· number — The interval in milliseconds the Handler should be updated at. Set it to 0 to disable updating (will lose all functionality that depends on…Context.HandlersFolder· string — return "NucleusCo-ophandlers" path.Context.HasDynamicWindowTitle· boolean — Work-around for ForceFocusWindowName having to match 1:1 with game window title for resizing, positioning and focus | default: false.Context.HasKeyboardPlayer· boolean — True if any player in the session uses keyboard & mouse.Context.Height· number — Height in pixels of this instance's window.Context.HexEdit— Writes bytes at an address in a file.Context.HideCursor· boolean — Hide the mouse cursor in game instances.Context.HideDesktopContext.HideTaskbar· boolean — Most games hide the taskbar when placed on-top but for games that don't you can use this.Context.HideTaskBarContext.Hook· GameHook — Settings for Nucleus' custom xinput/x360ce hook DLL.Context.HookFocus· boolean — Enable or disable hooks to trick the game into thinking it has focus | default: false.Context.HookFocusInstances· string — Copied from Game.HookFocusInstances for the current instance.Context.HookInit· boolean — Enable or disable hooks of functions some games may try and use to prevent multiple instances from running | default: false.Context.HookInitDelay· boolean — Copied from Game.HookInitDelay for the current instance.Context.IdealProcessor· number — Sets the preferred processor for the game's threads, used when the system schedules threads, to determine which processor to run the thread…Context.IdInWindowTitle· boolean — Adds the process ID to the end of the window title.Context.InjectDinputToXinputTranslation· boolean — If you want to translate XInput to Dinput when using this restriction method + Game.Hook.XInputReroute = true;Context.InjectHookXinput· boolean — This method is the same used by Universal Split Screen (Hook Xinput for gamepads). It will make the instance redirect the controllers'…Context.IsFullscreen· booleanContext.IsKeyboardPlayer· boolean — True if current player is using keyboard, useful for logic that is needed for keyboard only player.Context.KeepAspectRatio· boolean — Should the game window try and keep it's aspect ratio when being resized? | default: false.Context.KeepEditedRegKeys· booleanContext.KeepSymLinkOnExit· boolean — Enable or disable symlink files from being deleted when Nucleus is closed | default: false.Context.KillMutex· string[] — Array of mutexes to kill before starting the next game process. A 'Mutex/Mutant' is a mutually exclusive flag, which basically tells the…Context.KillMutexDelay· number — # of seconds to wait before killing the mutex | Only works with killing not renaming | default: 0.Context.KillMutexType· string — Specify the type of mutex/handle to kill, for example "Mutant", "Event" or "Semaphore" | default: "Mutant".Context.KillProcessesMatchingProcessName— Kill processes matching a given process name during preperation.Context.KillProcessesMatchingWindowName— Kill processes matching a given window name during preperation.Context.LauncherExe· string — If the game needs to go through a launcher before opening Nucleus will use this exe to start the game and it will still use the…Context.LauncherFolder· stringContext.LauncherTitle· string — The name of the launcher's window title. Some games need to go through a launcher to open. This is needed or else the application will lose…Context.LocalIP· string — Local IP address of the computer.Context.Log— Writes a line to the Nucleus debug log (requires Game.Debug = true or debug logging enabled).Context.MaxPlayers· number — This is just the max players info that shows under the handler name in Nucleus UI. Usually we write the max number of players the game…Context.MaxPlayersOneMonitor· number — This is just info. It will not limit the players number.Context.ModifiedDate— Change the last modified date of a file.Context.ModifySaveFile— Edits keys in an INI/CFG file. Example: Context.ModifySaveFile(path, path, Nucleus.SaveType.INI, [new Nucleus.IniSaveInfo("Section", "Key",…Context.MonitorHeight· number — Height of the monitor this instance is on.Context.MonitorWidth· number — Width of the monitor this instance is on.Context.MoveFolderContext.NeedsSteamEmulation· boolean — If the game needs a fake Steam wrapper (SSE) to run multiple instances (this is not needed if you are using the new use Goldberg emulator…Context.NewSaveInfoContext.Nickname· string — Use this in a game handler to get the player's nicknameContext.NucleusDocumentsRoot· stringContext.NucleusEnvironmentRoot· stringContext.NucleusFolder· string — Path to the Nucleus Co-op root folder (Nucleus-Coop).Context.NucleusUserRoot· string — Path to current players Nucleus environment Windows User root folder.Context.NumberOfPlayers· number — Total number of players in this session.Context.NumControllers· number — Number of players in the session that are not keyboard players (IsKeyboardPlayer false). Nucleus only counts it in the first player's…Context.NumKeyboards· numberContext.Options· Record<string, any> — Values chosen by the user for options added with Game.AddOption.Context.OrigAspectRatio· string — Player monitor's aspect ratio (e.g. 16:9).Context.OrigAspectRatioDecimal· number — Player monitor's aspect ratio in decimal (e.g. 1.777777).Context.OrigRootFolder· string — The original game folder: the folder of the game executable the user picked, in lower case, with Game.BinariesFolder removed. Set per…Context.OrigSteamDllPath· string — If steam_interface.txt is required, provide full path here to the original steam_api(64).dll and Nucleus will create one if it can't find…Context.PatchFile— Patches bytes in a file (copy of the original). The file must be excluded from symlinking (e.g. via Game.FileSymlinkExclusions).Context.PatchFileFindAllContext.PatchFileFindPattern— Reads originalFile, replaces every occurrence of the hex byte pattern origPattern (spaces allowed) and writes the result to patchedFile,…Context.PlayerGameFilesBackupFolder· stringContext.PlayerID· number — Zero-based index of the player/instance being set up.Context.PlayersPerInstance· number — If using XInputPlus or X360ce and there are multiple players playing the same instance, set the # per instance here.Context.PlayerSteamID· string — Steam ID assigned to the current player.Context.PlayerSteamIDs· string[] — A list of steam IDs to be used instead of the pre-defined ones Nucleuses uses | IDs will be used in order they are placed, i.e. instance 1…Context.PostHookInstances· string — If you only want specific instances to have post launch hooks, specify them in a comma seperated string.Context.PosX· number — X position of this instance's window.Context.PosY· number — Y position of this instance's window.Context.PreventWindowDeactivation· boolean — Blocks the processing of all the windows messages that get sent when the window loses focus.Context.ProceedSymlinkContext.ProcessID· numberContext.ProcessorPriorityClass· string — Sets the overall priority category for the associated process. Can be "AboveNormal", "High" or "RealTime" | default: "Normal".Context.PromptBetweenInstances· boolean — Prompt the user with a messagebox to let the user decide when to open the next instance | default: false, PauseBetweenStarts STILL required.Context.RandomInt— Returns a random integer between min and max.Context.RandomString— Returns a random alphanumeric string of the given length.Context.RawHID· stringContext.ReadRegKey— Return the value of a provided key as a string.Context.RemoveLineInTextFile— Removes a given line number completely.Context.RenameNotKillMutex· boolean — Instead of killing the mutex or handle, rename it on startup to something else | Requires Game.KillMutex to contain the EXACT name of the…Context.ReplaceLinesInTextFile— Replace an entire line; for string array use the format: "lineNum|newValue", the | is required.Context.ReplacePartialLinesInTextFile— Partially replace a line; for string array use the format: "lineNum|Regex pattern|newValue", the | is required.Context.ResetWindows· boolean — After each new instance opens, resize, reposition and remove borders of the previous instance.Context.RootFolder· string — Root of the current instance's game folder (Nucleus-Coopcontent<GUID>Instance<N>).Context.RootInstallFolder· string — Path to the source game root folder.Context.RunAdditionalFiles— Specify additional files to run before launching game. By default will run each additional file once but can specify to run during specific…Context.SavePath· string — Not used but could be present in some handlersContext.SaveType· Nucleus.SaveType | number | boolean — Not used but could be present in some handlersContext.ScriptFolder· string — Path to the Nucleus Co-op handlers root folder (Nucleus-Coophandlers).Context.SearchSubFolderContext.SearchSubFoldersContext.SetProtoInputMultipleControllersContext.SetWindowHook· boolean — Prevent games from resizing their windows on their own | Hooks after all instances have been opened (see Game.SetWindowHookStart for an…Context.StartArguments· string — Set launch(start) arguments for the exe from within the Game.Play() functionContext.StartHookInstances· string — If you only want specific instances to have starting hooks, specify them in a comma seperated string.Context.StartProcess— Starts a process with arguments, optionally elevated.Context.SteamID· string — Here the SteamID of the game. You can find it on https://steamdb.info/ . Add only if the game is available on Steam.Context.SteamLang· string — The Steam language name for the game, for example english. Nucleus takes the game's own Steam language setting in Nucleus, else Nucleus's…Context.SupportsKeyboard· boolean — Enable/disable use of one keyboard/mouse player.Context.SymlinkExe· boolean — If SymlinkGame is enabled, if we should copy or symlink the game executable.Context.SymlinkFiles· string[] — Symlink individual files from the game directory to the instanced folder.Context.ToLowerCaseContext.ToUpperCaseContext.UseDevReorder· boolean — Set up Devreorder.Context.UseDInputBlocker· boolean — Setup wizark952's dinput blocker (block dinput for the game).Context.UseForceBindIP· boolean — Set up game instances with ForceBindIP; each instance having their own IP.Context.UseGoldberg· boolean — Use the built-in Goldberg features in Nucleus | default: false.Context.UseProcessor· string — Sets the processors on which the game's threads can run on (provide the # of the cores in a comma-seperated list in quotations) | default:…Context.User· UserInfoContext.UserName· string — Windows user name.Context.UserProfileConfigPath· string — Relative path from user profile to game's config path | requires Game.UserProfileConfigPath be set.Context.UserProfileConvertedToDocuments· booleanContext.UserProfileSavePath· string — Relative path from user profile to game's save path | requires Game.UserProfileSavePath be set.Context.UseX360ce· boolean — Before launching any games, Nucleus Co-op will open x360ce and let the user set up their controllers before continuing | close x360ce to…Context.UtilFolder· stringContext.Wait— Pauses the handler for the given number of milliseconds.Context.Width· number — Width in pixels of this instance's window.Context.WorkingFolder· string — Relative path to where Nucleus should start the game's working folder to. Example: The main executable is on the root directory…Context.WriteTextFile— NemirtingasEpicEmu.json edition from a handler example:Context.X360ceDll· string[] — If x360ce dll should be named something OTHER than xinput1_3.dll | requires Game.Usex360ce to be set to true.Context.x360ceGamepadGuid· string — Get the x360ce formatted gamepad guid.Context.XboxOneControllerFix· boolean — When using x360ce, this will set certain hooktype that may work for xbox one controllers if the normal method does not work.Context.XInputPlusDll· string[] — Set up XInputPlus | If multiple dlls required, use comma seperated strings.Context.XInputPlusOldDll· boolean — When using Game.XInputPlusDll, you can specify to use the previous version instead of latest (needed for some games).