Skip to content
Beta: this is a preview of the new SplitScreen.Me. Data may be reset before launch.

Grim Dawn · handler “Grim Dawn”

Version 14

Release notes

Minor fixes and cleanning

Released
Size
2.5 KB
Downloads
2,518
Check
Verified
SHA-256
d8363620bc0a9b57afd1d2a5017f7571ae2d91fadbeabe7fcff10f2443c14651
Download v14 (.nc)All versions

Files 1

PathSize
handler.js8.4 KB

handler.js

Plain text
Hub.Handler.Version = 14; // Released at https://hub.splitscreen.me/ on Sun Jul 30 2023 09:55:06 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "K8M5mDtTcKu4ofMYn";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

var answers1 = ["No", "Yes"];
var answers2 = ["No", "Yes"];
Game.AddOption("x64 version?", "Select yes if you want to use the game's x64 exe instead.", "X64", answers1);
Game.AddOption("Launch all instances under your Steam account?", "Only use if you want to unlock Steam achievements, connect the instances via LAN.", "Steam", answers2);

Game.ExecutableContext = ["resources"];
Game.KillMutex = ["GrimDawn"];
Game.FileSymlinkExclusions = ["steam_api.dll", "steam_api64.dll", "steam_appid.txt", "winmm.dll", "xinput1_3.dll"];
Game.FileSymlinkCopyInstead = ["Grim Dawn.exe"];
Game.UseNucleusEnvironment = false;
Game.UseGoldberg = true;
Game.UseSteamStubDRMPatcher = true;
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.ExecutableName = "Grim Dawn.exe";
Game.SteamID = "219990";
Game.GUID = "Grim Dawn";
Game.GameName = "Grim Dawn";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.LauncherTitle = "";
Game.HideTaskbar = false;
Game.StartArguments = "";
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "Grim Dawn";
Game.SetForegroundWindowElsewhere = true;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.XInputPlusDll = ["xinput1_3.dll"];
Game.Hook.CustomDllEnabled = false;
Game.UserProfileConfigPath = "Documents\\My Games\\Grim Dawn\\Settings";
Game.UserProfileSavePath = "Documents\\My Games\\Grim Dawn\\save";
Game.Description =
  "After all the instances have launched, resized and positioned correctly, press the END key once to lock the input for all instances to have their own working cursor, you need to left click each mouse to make the emulated cursors appear after locking the input. Press the END key again to unlock the input when you finish playing. You can also use CTRL+Q to close Nucleus and all its instances when the input is unlocked. Vertical Split-screen for 2 players works best, use a different character per instance.";
Game.PauseBetweenStarts = 25;

//USS deprecated options:

Game.HookSetCursorPos = false;
Game.HookGetCursorPos = false;
Game.HookGetKeyState = false;
Game.HookGetAsyncKeyState = false;
Game.HookGetKeyboardState = false;
Game.HookFilterRawInput = false;
Game.HookFilterMouseMessages = false;
Game.HookUseLegacyInput = false;
Game.HookDontUpdateLegacyInMouseMsg = false;
Game.HookMouseVisibility = false;

Game.SendNormalMouseInput = false;
Game.SendNormalKeyboardInput = false;
Game.SendScrollWheel = false;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.HookReRegisterRawInput = false;
Game.HookReRegisterRawInputMouse = false;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = false;

//ProtoInput:

Game.SupportsMultipleKeyboardsAndMice = true;

Game.ProtoInput.InjectStartup = false;
Game.ProtoInput.InjectRuntime_RemoteLoadMethod = false;
Game.ProtoInput.InjectRuntime_EasyHookMethod = true;
Game.ProtoInput.InjectRuntime_EasyHookStealthMethod = false;

Game.LockInputAtStart = false;
Game.LockInputSuspendsExplorer = true;
Game.ProtoInput.FreezeExternalInputWhenInputNotLocked = true;
Game.LockInputToggleKey = 0x23;

Game.ProtoInput.RenameHandlesHook = false;
Game.ProtoInput.RenameHandles = [];
Game.ProtoInput.RenameNamedPipes = [];

Game.ProtoInput.RegisterRawInputHook = true;
Game.ProtoInput.GetRawInputDataHook = true;
Game.ProtoInput.MessageFilterHook = true;
Game.ProtoInput.GetCursorPosHook = true;
Game.ProtoInput.SetCursorPosHook = true;
Game.ProtoInput.GetKeyStateHook = true;
Game.ProtoInput.GetAsyncKeyStateHook = true;
Game.ProtoInput.GetKeyboardStateHook = true;
Game.ProtoInput.CursorVisibilityHook = true;
Game.ProtoInput.ClipCursorHook = true;
Game.ProtoInput.FocusHooks = true;
Game.ProtoInput.DrawFakeCursor = true;

Game.ProtoInput.RawInputFilter = true;
Game.ProtoInput.MouseMoveFilter = false;
Game.ProtoInput.MouseActivateFilter = true;
Game.ProtoInput.WindowActivateFilter = false;
Game.ProtoInput.WindowActvateAppFilter = false;
Game.ProtoInput.MouseWheelFilter = true;
Game.ProtoInput.MouseButtonFilter = true;
Game.ProtoInput.KeyboardButtonFilter = true;

Game.ProtoInput.SendMouseWheelMessages = true;
Game.ProtoInput.SendMouseButtonMessages = true;
Game.ProtoInput.SendMouseMovementMessages = true;
Game.ProtoInput.SendKeyboardButtonMessages = true;
Game.ProtoInput.XinputHook = false;
Game.ProtoInput.UseOpenXinput = false;
Game.ProtoInput.UseDinputRedirection = false;
Game.ProtoInput.DinputDeviceHook = false;
Game.ProtoInput.DinputHookAlsoHooksGetDeviceState = false;

Game.ProtoInput.EnableFocusMessageLoop = false;
//Game.ProtoInput.FocusLoopIntervalMilliseconds = 40000;
//Game.ProtoInput.FocusLoop_WM_ACTIVATE = true;
//Game.ProtoInput.FocusLoop_WM_ACTIVATEAPP = true;
//Game.ProtoInput.FocusLoop_WM_NCACTIVATE = true;
//Game.ProtoInput.FocusLoop_WM_SETFOCUS = true;
//Game.ProtoInput.FocusLoop_WM_MOUSEACTIVATE = true;
Game.ProtoInput.BlockedMessages = [0x0008]; //Blocks WM_KILLFOCUS

Game.Play = function() {
  var txtPath = Context.GetFolder(Nucleus.Folder.Documents) + "\\My Games\\Grim Dawn\\Settings\\options.txt";
  var dict = [
    Context.FindLineNumberInTextFile(txtPath, "inactiveUpdateRate", Nucleus.SearchType.StartsWith) + "|inactiveUpdateRate        = 1",
    Context.FindLineNumberInTextFile(txtPath, "cloudSaving", Nucleus.SearchType.StartsWith) + "|cloudSaving               = false",
    Context.FindLineNumberInTextFile(txtPath, "gamepadSupport", Nucleus.SearchType.StartsWith) + "|gamepadSupport            = true",
    Context.FindLineNumberInTextFile(txtPath, "resolution", Nucleus.SearchType.StartsWith) + "|resolution                = " + Context.Width + " " + Context.Height,
    Context.FindLineNumberInTextFile(txtPath, "screenMode", Nucleus.SearchType.StartsWith) + "|screenMode                = 2"
  ];
  Context.ReplaceLinesInTextFile(txtPath, dict);

  var x64 = Context.Options["X64"];
  var steam = Context.Options["Steam"];

  if (x64 == "Yes") {
    Context.StartArguments = "/x64";

    Game.PauseBetweenProcessGrab = 30;

    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\x64\\XInputPlus.ini");
    var savePkgOrigin = System.IO.Path.Combine(Context.NucleusFolder, "utils\\XInputPlus\\XInputPlus.ini");
    System.IO.File.Copy(savePkgOrigin, savePath, true);

    System.IO.File.Copy(Context.NucleusFolder + "\\utils\\XInputPlus\\x64\\xinput1_3.dl_", Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\x64\\xinput1_3.dll", true);

    if (Context.IsKeyboardPlayer) {
      var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\x64\\XinputPlus.ini";
      Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller1", "0"),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller2", "0"),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller3", "0"),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller4", "0")
      ]);
    } else {
      var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\x64\\XInputPlus.ini";
      Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller1", Context.GamepadId),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller2", Context.GamepadId),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller3", Context.GamepadId),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller4", Context.GamepadId)
      ]);
    }
  }

  if (x64 == "No") {
  }

  if (steam == "No") {
  }

  if (steam == "Yes") {
    var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "steam_api.dll");
    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\steam_api.dll");
    System.IO.File.Copy(savePkgOrigin, savePath, true);

    var savePkgOrigin = System.IO.Path.Combine(Context.RootInstallFolder, "x64\\steam_api64.dll");
    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\x64\\steam_api64.dll");
    System.IO.File.Copy(savePkgOrigin, savePath, true);
  }
};