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

Deathtrap · handler “Deathtrap”

Version 2

Release notes

keyboard support and other improvements.

Released
Size
1.8 KB
Downloads
169
Check
Verified
SHA-256
dc88b65548178ebd61b52d516a8a4bba980e0f9e29c2992ad638fb600679af57
Download v2 (.nc)All versions

Files 1

PathSize
handler.js6.5 KB

handler.js

Plain text
Hub.Handler.Version = 2; // Released at https://hub.splitscreen.me/ on Tue Apr 13 2021 02:21:28 GMT+0000 (UTC).
Hub.Handler.Id = "NbnpH7Gy58pFLWiTi";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

var answers1 = ["DeathTrap_x86.exe", "DeathTrap_x64.exe"];
Game.AddOption("Select Exe.", "Select the game's .exe you want to use.", "Exe", answers1);

Game.ExecutableContext = ["Terrains"];
Game.DirSymlinkExclusions = ["Cfg\\Resolutions"];
Game.FileSymlinkExclusions = [
  "steam_api.dll",
  "steam_api64.dll",
  "steam_interfaces.txt",
  "steam_appid.txt",
  "winmm.dll",
  "CustomNonFullscreen.cfg",
  "DeathTrap.exe",
  "DeathTrap_x64.exe",
  "DeathTrap_x86.exe"
];
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.SupportsKeyboard = true;
Game.ExecutableName = "DeathTrap.exe";
Game.SteamID = "310510";
Game.GUID = "DeathTrap";
Game.GameName = "DeathTrap";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.UseGoldberg = true;
Game.LauncherTitle = "";
Game.HideTaskbar = false;
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "DeathTrap";
Game.FakeFocus = true;
Game.KeyboardPlayerSkipFakeFocus = true;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.Hook.CustomDllEnabled = false;
Game.DocumentsSavePath = "NeocoreGames\\DeathTrap\\SaveGame";
Game.Description =
  "Set your custom resolution in the video settings of your main game first to avoid stretching, close the game via in-game menus then launch via Nucleus. You need to create custom resolutions in your AMD/Nvidia/Intel panel (For example: 960x1080, 960x540, 1920x540 etc.) so the game can see and use them. Create a public multiplayer game in one instance and join in the others.";
Game.PauseBetweenStarts = 40;

Game.Play = function() {
  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\NeoCore Games\\DeathTrap\\Options", "WindowStyle", 0, Nucleus.RegType.DWord);

  var interfaces = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\steam_interfaces.txt";
  var lines = [
    "SteamClient016",
    "SteamGameServer012",
    "SteamGameServerStats001",
    "SteamUser017",
    "SteamFriends014",
    "SteamUtils007",
    "SteamMatchMaking009",
    "SteamMatchMakingServers002",
    "STEAMUSERSTATS_INTERFACE_VERSION011",
    "STEAMAPPS_INTERFACE_VERSION006",
    "SteamNetworking005",
    "STEAMREMOTESTORAGE_INTERFACE_VERSION012",
    "STEAMSCREENSHOTS_INTERFACE_VERSION002",
    "STEAMHTTP_INTERFACE_VERSION002",
    "STEAMUNIFIEDMESSAGES_INTERFACE_VERSION001",
    "STEAMUGC_INTERFACE_VERSION003",
    "STEAMAPPLIST_INTERFACE_VERSION001",
    "STEAMMUSIC_INTERFACE_VERSION001",
    "STEAMMUSICREMOTE_INTERFACE_VERSION001",
    "STEAMHTMLSURFACE_INTERFACE_VERSION_002",
    "STEAMCONTROLLER_INTERFACE_VERSION"
  ];

  Context.WriteTextFile(interfaces, lines);

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

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

  var custom = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Cfg\\Resolutions\\CustomNonFullscreen.cfg";
  var lines = ["CustomResolution00=" + Context.Width + "x" + Context.Height];

  Context.WriteTextFile(custom, lines);

  if (Player.IsKeyboardPlayer) {
    Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\NeoCore Games\\DeathTrap", "ControllerEnabled", 0, Nucleus.RegType.DWord);

    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\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 {
    Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\NeoCore Games\\DeathTrap", "ControllerEnabled", 1, Nucleus.RegType.DWord);

    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\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)
    ]);
  }

  var exe = Context.Options["Exe"];

  if (exe == "DeathTrap_x86.exe") {
    System.IO.File.Copy(System.IO.Path.Combine(Context.RootInstallFolder, "DeathTrap_x86.exe"), System.IO.Path.Combine(Context.RootFolder, "DeathTrap.exe"), true);

    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\winmm.dll");
    var savePkgOrigin = System.IO.Path.Combine(Context.NucleusFolder, "utils\\Steam Stub DRM Patcher\\x86\\winmm.dll");
    System.IO.File.Copy(savePkgOrigin, savePath, true);

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

  if (exe == "DeathTrap_x64.exe") {
    System.IO.File.Copy(System.IO.Path.Combine(Context.RootInstallFolder, "DeathTrap_x64.exe"), System.IO.Path.Combine(Context.RootFolder, "DeathTrap.exe"), true);

    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\winmm.dll");
    var savePkgOrigin = System.IO.Path.Combine(Context.NucleusFolder, "utils\\Steam Stub DRM Patcher\\x64\\winmm.dll");
    System.IO.File.Copy(savePkgOrigin, savePath, true);

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