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

Hollow Knight · handler “Hollow Knight Multiplayer Mod”

Version 4

Release notes

modding api update

Released
Size
4.8 MB
Downloads
266
Check
Verified
SHA-256
c6857e496142930446a7f4d7028600f8ac2eeb168e4fff24ced85a59aeb2dd20
Download v4 (.nc)All versions

Files 5

PathSize
handler.js6.0 KB
HollowKnight/P2/Assembly-CSharp.dll3.7 MB
HollowKnight/P3/Assembly-CSharp.dll3.7 MB
HollowKnight/P4/Assembly-CSharp.dll3.7 MB
HollowKnight/P5/Assembly-CSharp.dll3.7 MB

handler.js

Plain text
Hub.Handler.Version = 4; // Released at https://hub.splitscreen.me/ on Mon Oct 25 2021 20:03:22 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "sWgnoTqjmk8M49QML";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

var answers1 = ["Yes", "No"];
Game.AddOption("Letterboxing/Pillarboxing fix?", "Removes the black bars in split-screen.", "Pillar", answers1);

Game.DirSymlinkExclusions = ["hollow_knight_Data\\Plugins\\x86_64", "hollow_knight_Data\\Managed\\Mods\\Disabled"];
Game.FileSymlinkExclusions = ["steam_appid.txt", "Assembly-CSharp.dll", "Assembly-CSharp.xml", "MMHOOK_Assembly-CSharp.dll", "dinput8.dll", "xinput1_3.dll", "xinput1_4.dll"];
Game.FileSymlinkCopyInstead = ["HKMP.dll", "ModCommon.dll", "CustomKnight.dll"];
Game.GameName = "Hollow Knight";
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.ExecutableName = "hollow_knight.exe";
Game.SteamID = "367520";
Game.GUID = "Hollow Knight";
Game.MaxPlayers = 5;
Game.MaxPlayersOneMonitor = 5;
Game.UseGoldberg = false;
Game.CreateSteamAppIdByExe = true;
Game.LauncherTitle = "";
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "Hollow Knight";
Game.FakeFocus = true;
Game.FakeFocusInterval = 20000;
Game.SendFakeFocusMsg = true;
Game.Hook.DInputEnabled = false;
Game.UseDInputBlocker = true;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.XInputPlusDll = ["xinput1_3.dll", "xinput1_4.dll"];
Game.Hook.CustomDllEnabled = false;
Game.SupportsKeyboard = true;
Game.BlockRawInput = false;
Game.UserProfileSavePath = "AppData\\LocalLow\\Team Cherry\\Hollow Knight";
Game.Description =
  "IMPORTANT: This script only works with the Hollow Knight Multiplayer mod by Extremelyd1, make sure you install the the HKMP.dll mod using the Scarab Mod Installer in your main game files first. Use a different save slot per instance. To connect the instances press start in the first instance and write the port number in the second field under join server (e.g. 26950) then click start hosting to start the server, only start a server in one instance, to connect all instances to the server under join server write localhost, then the same port number as the server, write your nickname and click connect using the mouse cursor, do the same in the other instances, alt-tab between instances to use the keyboard.";
Game.KeepSymLinkOnExit = false;
Game.PauseBetweenStarts = 40;

Game.Play = function() {
  var Args = (Context.Args = " -screen-fullscreen 0 -popupwindow " + " -screen-width " + Context.Width + " -screen-height " + Context.Height);

  Context.StartArguments = Args;

  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Team Cherry\\Hollow Knight", "Screenmanager Is Fullscreen mode_h3981298716", 0, Nucleus.RegType.DWord);

  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Team Cherry\\Hollow Knight", "Screenmanager Resolution Height_h2627697771", Context.Height, Nucleus.RegType.DWord);

  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Team Cherry\\Hollow Knight", "Screenmanager Resolution Width_h182942802", Context.Width, Nucleus.RegType.DWord);

  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Team Cherry\\Hollow Knight", "NativeInput_h1840871570", 1, Nucleus.RegType.DWord);

  var filePath = (Context.filePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\hollow_knight_Data\\Managed\\Mods\\Disabled");
  System.IO.Directory.CreateDirectory(filePath);

  System.IO.File.Copy(
    System.IO.Path.Combine(Context.RootInstallFolder, "hollow_knight_Data\\Managed\\Assembly-CSharp.xml"),
    System.IO.Path.Combine(Context.RootFolder, "hollow_knight_Data\\Managed\\Assembly-CSharp.xml"),
    true
  );

  System.IO.File.Copy(
    System.IO.Path.Combine(Context.RootInstallFolder, "hollow_knight_Data\\Managed\\MMHOOK_Assembly-CSharp.dll"),
    System.IO.Path.Combine(Context.RootFolder, "hollow_knight_Data\\Managed\\MMHOOK_Assembly-CSharp.dll"),
    true
  );

  if (Context.PlayerID == 0) {
    System.IO.File.Copy(
      System.IO.Path.Combine(Context.RootInstallFolder, "hollow_knight_Data\\Managed\\Assembly-CSharp.dll"),
      System.IO.Path.Combine(Context.RootFolder, "hollow_knight_Data\\Managed\\Assembly-CSharp.dll"),
      true
    );
  }

  if (Context.PlayerID == 1) {
    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\hollow_knight_Data\\Managed\\Assembly-CSharp.dll");
    var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "P2\\Assembly-CSharp.dll");
    System.IO.File.Copy(savePkgOrigin, savePath, true);
  }

  if (Context.PlayerID == 2) {
    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\hollow_knight_Data\\Managed\\Assembly-CSharp.dll");
    var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "P3\\Assembly-CSharp.dll");
    System.IO.File.Copy(savePkgOrigin, savePath, true);
  }

  if (Context.PlayerID == 3) {
    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\hollow_knight_Data\\Managed\\Assembly-CSharp.dll");
    var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "P4\\Assembly-CSharp.dll");
    System.IO.File.Copy(savePkgOrigin, savePath, true);
  }

  if (Context.PlayerID == 4) {
    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\hollow_knight_Data\\Managed\\Assembly-CSharp.dll");
    var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "P5\\Assembly-CSharp.dll");
    System.IO.File.Copy(savePkgOrigin, savePath, true);
  }

  var pillar = Context.Options["Pillar"];

  if (pillar == "Yes") {
    //remove pillar boxing
    Context.PatchFileFindAll(
      System.IO.Path.Combine(Context.RootFolder, "hollow_knight_Data\\Managed\\Assembly-CSharp.dll"),
      System.IO.Path.Combine(Context.RootFolder, "hollow_knight_Data\\Managed\\Assembly-CSharp.dll"),
      [0x39, 0x8e, 0xe3, 0x3f],
      Context.ConvertToBytes(Context.AspectRatioDecimal)
    );
  }

  if (pillar == "No") {
  }
};