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

Nuclear Throne · handler “NuclearThroneTogether”

Version 1

Release notes

Requires the mod "Nuclear Throne Together". Authors and Contributors of this script: Zensuu and Talos91 from the Split Screen Dreams Discord.

Released
Size
1.7 KB
Downloads
151
Check
Verified
SHA-256
d517484655df699b62cee81547f4867a94fdc07007e63bdcd9c1f6eab0ae6c1b
Download v1 (.nc)All versions

Files 1

PathSize
handler.js4.4 KB

handler.js

Plain text
Hub.Handler.Version = 1; // Released at https://hub.splitscreen.me/ on Sat Dec 19 2020 19:19:01 GMT+0000 (UTC).
Hub.Handler.Id = "ohB2xPzMWjHp89cMj";
Hub.Maintainer.Name = "Zensuu";
Hub.Maintainer.Id = "sshRgms8c4xET4sCy";

var answers1 = ["No", "Yes"];
Game.AddOption("Do you have a startup.txt file for mods?", "Only select yes if you already have it in your game files.", "Startup", answers1);

Game.FileSymlinkExclusions = ["steam_appid.txt"];
Game.FileSymlinkCopyInstead = ["startup.txt"];
Game.NeedsSteamEmulation = false;
Game.CreateSteamAppIdByExe = true;
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.GameName = "Nuclear Throne Together";
Game.SteamID = "242680";
Game.GUID = "NuclearThroneTogether";
Game.ExecutableName = "NuclearThroneTogether.exe";
Game.SupportsKeyboard = true;
Game.LauncherTitle = "";
Game.MaxPlayersOneMonitor = 4;
Game.MaxPlayers = 4;
Game.HideTaskbar = true;
Game.NotTopMost = true;
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "Nuclear Throne Together";
Game.Hook.DInputEnabled = false;
Game.Hook.DInputForceDisable = true;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.XInputPlusDll = ["xinput1_3.dll"];
Game.Hook.CustomDllEnabled = false;
Game.SetWindowHook = true;
Game.RefreshWindowAfterStart = true;
Game.UserProfileSavePath = "AppData\\Local\\nuclearthrone";
Game.Description =
  'Requires the mod "Nuclear Throne Together". Using the mouse, enable gamepad in control settings for gamepad controlled instances. To host or join a LAN game go to COOP and set "USE STEAM" to "NO". Host a lan game with one instance and join with the others using the localhost ip (127.0.0.1). The mod already allows for 4 player local co-op but with this script everyone can have their own screen and use multiple monitors. To load mods or to adjust the aspect ratio to the window size in co-op when you are at the campfire screen press T and each player writes /sideload to enable loading mods/external content then any of players writes /load startup to load their startup.txt, alt-tab between instances to use the keyboard. Remove the 60 fps line in your startup.txt if you get freezes when starting a co-op game.';
Game.PauseBetweenStarts = 20;

Game.Play = function() {
  var username = System.Environment.UserName;

  if (System.IO.File.Exists("C:\\Users\\" + username + "\\AppData\\Local\\nuclearthrone\\NuclearThroneTogether.ini")) {
    //Context.BackupFile("C:\\Users\\"+username+"\\AppData\\Local\\nuclearthrone\\NuclearThroneTogether.ini", true);

    var VideoConfig = "C:\\Users\\" + username + "\\AppData\\Local\\nuclearthrone\\NuclearThroneTogether.ini";
    Context.ModifySaveFile(VideoConfig, VideoConfig, Nucleus.SaveType.INI, [new Nucleus.IniSaveInfo("Visual", "BorderlessFullscreen", '"0"')]);
  } else {
  }

  var startup = Context.Options["Startup"];

  if (startup == "Yes") {
    if (Context.AspectRatioDecimal > 1.8) {
      var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\startup.txt";
      var dict = ["1|/gml game_set_size(852, 240)"];
      Context.ReplaceLinesInTextFile(txtPath, dict);
    } else if (Context.AspectRatioDecimal < 1.2) {
      var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\startup.txt";
      var dict = ["1|/gml game_set_size(320, 360)"];
      Context.ReplaceLinesInTextFile(txtPath, dict);
    } else {
      var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\startup.txt";
      var dict = ["1|/gml game_set_size(426, 240)"];
      Context.ReplaceLinesInTextFile(txtPath, dict);
    }
  }

  if (startup == "No") {
    if (Context.AspectRatioDecimal > 1.8) {
      var startup = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\startup.txt";
      var lines = ["/gml game_set_size(852, 240)"];

      Context.WriteTextFile(startup, lines);
    } else if (Context.AspectRatioDecimal < 1.2) {
      var startup = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\startup.txt";
      var lines = ["/gml game_set_size(320, 360)"];

      Context.WriteTextFile(startup, lines);
    } else {
      var startup = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\startup.txt";
      var lines = [
        "/gml game_set_size(426, 240)"
        //"/gml q=60 room_speed=q current_time_scale=30/q",// 60 fps freezes the game in LAN.
      ];

      Context.WriteTextFile(startup, lines);
    }
  }
};