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

Heroes of Hammerwatch · handler “Heroes of Hammerwatch”

Version 2

Release notes

Saving fix

Released
Size
980 KB
Downloads
374
Check
Verified
SHA-256
5c8637409284952941212cc833590174817de41c44777f3ba79fb2f34dabd136
Download v2 (.nc)All versions

Files 3

PathSize
handler.js4.0 KB
HeroesofHammerwatch/Galaxy.dll2.5 MB
HeroesofHammerwatch/NemirtingasGalaxyEmu.json256 B

handler.js

Plain text
Hub.Handler.Version = 2; // Released at https://hub.splitscreen.me/ on Sat Aug 28 2021 03:46:56 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "CFMDxMdoua3zzBC8E";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

Game.ExecutableContext = ["res"];
Game.DirSymlinkExclusions = ["ngalaxye_settings"];
Game.DirExclusions = ["saves"];
Game.FileSymlinkExclusions = ["Galaxy.dll", "steam_api.dll", "xinput1_4.dll"];
Game.FileSymlinkCopyInstead = ["HWR.exe.cfg"];
Game.NeedsSteamEmulation = false;
Game.UseGoldberg = true;
Game.HandlerInterval = 100;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.SymlinkExe = false;
Game.ExecutableName = "HWR.exe";
Game.SteamID = "677120";
Game.GUID = "Heroes of Hammerwatch";
Game.GameName = "Heroes of Hammerwatch";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.LauncherTitle = "";
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "Heroes of Hammerwatch";
Game.HasDynamicWindowTitle = true;
Game.SupportsKeyboard = true;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.XInputPlusDll = ["xinput1_4.dll"];
Game.Hook.CustomDllEnabled = false;
Game.Description =
  "Create a public lobby in one instance and join in the others using server list, use a different character per instance. If you launch one instance with keyboard wait until an instance loses its borders before opening the next one, this way they will resize correctly. Your saves per instance are inside Nucleus content folder in the game instances folders, so be careful about not deleting them, you can also copy your main saves there.";
Game.KeepSymLinkOnExit = true;
Game.PauseBetweenStarts = 30;
Game.GamePlayBeforeGameSetup = true;

Game.Play = function() {
  var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\HWR.exe.cfg";
  var dict = [
    Context.FindLineNumberInTextFile(txtPath, "v_resolution", Nucleus.SearchType.StartsWith) + "|v_resolution " + Context.Width + "x" + Context.Height,
    Context.FindLineNumberInTextFile(txtPath, "v_fullscreen", Nucleus.SearchType.StartsWith) + "|v_fullscreen 0",
    Context.FindLineNumberInTextFile(txtPath, "v_forced_aspect_ratio", Nucleus.SearchType.StartsWith) + "|v_forced_aspect_ratio 0.000000"
  ];
  Context.ReplaceLinesInTextFile(txtPath, dict);

  if (Context.HasKeyboardPlayer == true) {
    Game.PromptBetweenInstances = true;
    Game.PauseBetweenStarts = 40;
    Game.PreventWindowDeactivation = true;
    Game.KeyboardPlayerSkipPreventWindowDeactivate = true;
  } else {
    Game.FakeFocus = true;
    Game.SetForegroundWindowElsewhere = true;
  }

  var id = Context.PlayerID + 6;

  var filePath = (Context.filePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\ngalaxye_settings");
  System.IO.Directory.CreateDirectory(filePath);

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

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\ngalaxye_settings\\NemirtingasGalaxyEmu.json");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "NemirtingasGalaxyEmu.json");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\ngalaxye_settings\\NemirtingasGalaxyEmu.json";
  var dict = [
    Context.FindLineNumberInTextFile(txtPath, '  "galaxyid":', Nucleus.SearchType.StartsWith) + '|  "galaxyid": 14549624462898294' + id + ",",
    Context.FindLineNumberInTextFile(txtPath, '  "username":', Nucleus.SearchType.StartsWith) + '|  "username": "' + Context.Nickname + '"'
  ];
  Context.ReplaceLinesInTextFile(txtPath, dict);

  if (!System.IO.File.Exists(Context.OrigRootFolder + "\\steam_api.dll")) {
    Game.UseGoldberg = false;
  } else {
  }
};