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

A Hat in Time · handler “A Hat in Time”

Version 2

Release notes

gamepads fixes and improvements.

Released
Size
1.5 KB
Downloads
433
Check
Verified
SHA-256
711f2a3d2562a9e263186cb29856677ceff6d1c491589df1a2b18f6d1e25a758
Download v2 (.nc)All versions

Files 1

PathSize
handler.js4.0 KB

handler.js

Plain text
Hub.Handler.Version = 2; // Released at https://hub.splitscreen.me/ on Tue Feb 16 2021 01:45:48 GMT+0000 (UTC).
Hub.Handler.Id = "srBcT7kc54AWvKo2p";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

var answers1 = ["Yes", "No"];
Game.AddOption("Will you use the game's native splitscreen?", "If yes only launch two horizontal instances, you need 3 or 4 gamepads.", "Native", answers1);

Game.ExecutableContext = ["APEX_ClothingGPUCHECKED_x64.dll"];
Game.DirSymlinkExclusions = ["Binaries\\Win64", "Binaries\\Win32", "HatinTimeGame\\Config"];
Game.FileSymlinkExclusions = ["steam_api64.dll", "steam_api.dll", "steam_appid.txt", "dinput8.dll", "xinput1_3.dll"];
Game.FileSymlinkCopyInstead = ["HatinTimeEngine.ini", "HatinTimeGame.ini", "HatinTimeInput.ini", "HatinTimeOnline.ini", "HatinTimeSystemSettings.ini", "HatinTimeUI.ini"];
Game.GameName = "A Hat in Time";
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.SupportsKeyboard = false;
Game.ExecutableName = "HatinTimeGame.exe";
Game.SteamID = "253230";
Game.GUID = "A Hat in Time";
Game.MaxPlayers = 50;
Game.MaxPlayersOneMonitor = 16;
Game.BinariesFolder = "Binaries\\Win64";
Game.NeedsSteamEmulation = false;
Game.UseGoldberg = true;
Game.LauncherTitle = "";
Game.Hook.ForceFocus = false;
Game.Hook.ForceFocusWindowName = "A Hat in Time";
Game.PreventWindowDeactivation = false;
Game.HookFocus = true;
Game.Hook.DInputEnabled = false;
Game.UseDInputBlocker = true;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.XInputPlusDll = ["xinput1_3.dll"];
Game.Hook.CustomDllEnabled = false;
Game.Description =
  "If you select yes to use the game's native splitscreen in the Player Options UI you can play with 3 or 4 players in only two instances of the game for better performance, the first two gamepads will control the first instance and the other two gamepads the second, press start in-game to add a local player in each instance, if you want to have only one player per instance select No in the UI option. Use a different save slot per instance. To connect the instances enable online mode in the game and write the same lobby name in all. When an instance opens press a button in your respective gamepad and get past the title screen.";
Game.KeepSymLinkOnExit = true;
Game.PauseBetweenStarts = 50;

Game.Play = function() {
  Context.StartArguments = "-windowed -AlwaysFocus -nosplash " + " -ResX= " + Context.Width + " -ResY= " + Context.Height;

  var filePath = (Context.filePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Binaries\\Win64\\steam_settings\\mods");
  System.IO.Directory.CreateDirectory(filePath);

  if (Context.NumControllers < 5) {
    Game.Hook.XInputReroute = false;
  } else {
    Game.Hook.CustomDllEnabled = true;
  }

  var native = Context.Options["Native"];

  if (native == "Yes") {
    if (Context.PlayerID == 0) {
      var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Binaries\\Win64\\XinputPlus.ini";
      Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller1", "1"),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller2", "2"),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller3", "0"),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller4", "0")
      ]);
    }
    if (Context.PlayerID == 1) {
      var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Binaries\\Win64\\XinputPlus.ini";
      Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller1", "3"),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller2", "4"),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller3", "0"),
        new Nucleus.IniSaveInfo("ControllerNumber", "Controller4", "0")
      ]);
    }
  }
  if (native == "No") {
  }
};