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 10

Release notes

steam achievements UI option

Released
Size
1.9 KB
Downloads
714
Check
Verified
SHA-256
9a89808fb60ccd59d94fb0974d1bbe8e4ca6b65dcc304244e97eaff971957784
Download v10 (.nc)All versions

Files 1

PathSize
handler.js6.2 KB

handler.js

Plain text
Hub.Handler.Version = 10; // Released at https://hub.splitscreen.me/ on Thu Jun 17 2021 08:24:37 GMT+0000 (UTC).
Hub.Handler.Id = "K8M5mDtTcKu4ofMYn";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

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

Game.ExecutableContext = ["resources"];
Game.KillMutex = ["GrimDawn"];
Game.FileSymlinkExclusions = ["steam_api.dll", "steam_api64.dll", "steam_appid.txt", "winmm.dll"];
Game.NeedsSteamEmulation = 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.FakeFocus = false;
Game.HookFocus = true;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.Hook.CustomDllEnabled = false;
Game.XInputPlusDll = ["xinput1_3.dll"];
Game.UserProfileConfigPath = "Documents\\My Games\\Grim Dawn\\Settings";
Game.UserProfileSavePath = "Documents\\My Games\\Grim Dawn\\save";
Game.Description =
  "Press the END key in your keyboard to unlock the main cursor and the input when you finish playing. You can also use CTRL+Q to close Nucleus and all its instances. Vertical Split-screen for 2 players works best, use a different character per instance. If you have performance issues with gamepads try setting to false the Game.UpdateFakeMouseWithInternalInput line in the script, gamepad cursors will be invisible without that option though.";
Game.PauseBetweenStarts = 25;

Game.SupportsMultipleKeyboardsAndMice = true;

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

Game.SendNormalMouseInput = true;
Game.SendNormalKeyboardInput = true;
Game.SendScrollWheel = true;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.HookReRegisterRawInput = false;
Game.HookReRegisterRawInputMouse = false;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = true;
Game.DrawFakeMouseCursorForControllers = true;
Game.UpdateFakeMouseWithInternalInput = true;
Game.LockInputAtStart = true;
Game.LockInputToggleKey = 0x23;

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 (Player.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.PlayerID + 1),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller2", Context.PlayerID + 1),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller3", Context.PlayerID + 1),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller4", Context.PlayerID + 1)
      ]);
    }
  }

  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);
  }
};