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

Grid 2 · handler “GRID 2”

Version 13

Release notes

Fixed LAN connection for latest Nucleus version

Released
Size
4.2 KB
Downloads
17
Check
Verified
SHA-256
615905402c4735770fbbdf1a6554350cde9cd0496bb46cfc46fba5c1bd49fc63
Download v13 (.nc)All versions

Files 2

PathSize
handler.js9.9 KB
handler/user_config.cfg5.2 KB

handler.js

Plain text
Hub.Handler.Version = 13; // Released at https://hub.splitscreen.me/ on Tue Oct 22 2024 11:31:32 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "3zcxvWqWQqnJCKCWA";
Hub.Maintainer.Name = "Perserveruz";
Hub.Maintainer.Id = "nFAYvHKj75jAFRAgt";

var answers = ["Yes", "No"];
var answers1 = ["-", "0", "1", "2", "3", "4", "5", "6", "7", "8"];
var answers2 = ["No", "Yes"];
var answers3 = ["No", "720p", "1080p"];
Game.AddOption("Apply 720p or 1080p resolution and fullscreen for low-end PC (no splitscreen)", "", "resolution", answers3);
Game.AddOption("Will you use the game's native splitscreen?", "If yes launch only two horizontal instances, gamepads only.", "Native", answers2);
Game.AddOption("Enable music only in the first instance?", "", "Mus", answers);
Game.AddOption("PC-ID", "If you are playing with other PCs in LAN, be sure to have different IDs", "id", answers1);
Game.KillMutex = ["Insane2"];
Game.FileSymlinkExclusions = ["steam_api.dll", "steam_appid.txt", "steam_interfaces.txt"];
Game.PartialMutexSearch = true;
Game.HandlerInterval = 100;
Game.UseGoldberg = true;
Game.GoldbergNoLocalSave = true;
Game.PlayerSteamIDs = [
  "76561199023125438",
  "76561199023125438",
  "76561199023125438",
  "76561199023125438",
  "76561199023125438",
  "76561199023125438",
  "76561199023125438",
  "76561199023125438",
  "76561199023125438",
  "76561199023125438"
];
Game.UseNucleusEnvironment = true;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.KeepSymLinkOnExit = true;
Game.SupportsKeyboard = true;
Game.ExecutableName = "i2.exe";
Game.SteamID = "35320";
Game.GUID = "Insane2";
Game.GameName = "Insane2";
Game.MaxPlayers = 8;
Game.MaxPlayersOneMonitor = 8;
Game.BinariesFolder = "";
Game.HideTaskbar = false;
Game.Hook.ForceFocus = false;
Game.Hook.ForceFocusWindowName = "Insane2 Steam release build 60 (41cde98) (Mar 17 2012 06:15:59)";
Game.HasDynamicWindowTitle = true;
Game.Hook.DInputEnabled = false;
Game.Hook.DInputForceDisable = true;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.Hook.CustomDllEnabled = false;
Game.XInputPlusDll = ["xinput1_3.dll"];
Game.FakeFocus = true;
Game.HookFocus = false;
Game.UserProfileSavePath = "AppData\\Roaming\\Goldberg SteamEmu Saves\\35320";
Game.Description =
  "Create a multiplayer server in one instance and change to join in the multiplayer option to connect to the server in the other instances. The game already has native splitscreen for 2 players max but with this you can play 4+. Each instance has its own save, you can access these saves in the app, after the first launch click game options/open user profile save path in the UI.";
Game.PauseBetweenStarts = 25;

Game.Play = function() {
  var filePath = Context.EnvironmentPlayer + "\\Documents";
  System.IO.Directory.CreateDirectory(filePath);

  var filePath = Context.EnvironmentPlayer + "\\Documents\\My Games";
  System.IO.Directory.CreateDirectory(filePath);

  var filePath = Context.EnvironmentPlayer + "\\Documents\\My Games\\insane2";
  System.IO.Directory.CreateDirectory(filePath);

  if (!System.IO.File.Exists(Context.EnvironmentPlayer + "\\Documents\\My Games\\insane2\\user_config.cfg")) {
    var savePath = Context.EnvironmentPlayer + "\\Documents\\My Games\\insane2\\user_config.cfg";
    var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "user_config.cfg");
    System.IO.File.Copy(savePkgOrigin, savePath, true);
  }

  var resolution = Context.Options["resolution"];
  if (resolution == "No") {
    var txtPath = Context.EnvironmentPlayer + "\\Documents\\My Games\\insane2\\user_config.cfg";
    var dict = [
      Context.FindLineNumberInTextFile(txtPath, "seta r_fullscreen", Nucleus.SearchType.StartsWith) + '|seta r_fullscreen "0"',
      Context.FindLineNumberInTextFile(txtPath, "seta r_height", Nucleus.SearchType.StartsWith) + '|seta r_height "' + Context.Height + '"',
      Context.FindLineNumberInTextFile(txtPath, "seta r_width", Nucleus.SearchType.StartsWith) + '|seta r_width "' + Context.Width + '"'
    ];
    Context.ReplaceLinesInTextFile(txtPath, dict);
  }

  if (resolution == "720p") {
    Game.DontResize = true;
    Game.DontReposition = true;
    Game.DontRemoveBorders = true;
    var txtPath = Context.EnvironmentPlayer + "\\Documents\\My Games\\insane2\\user_config.cfg";
    var dict = [
      Context.FindLineNumberInTextFile(txtPath, "seta r_fullscreen", Nucleus.SearchType.StartsWith) + '|seta r_fullscreen "1"',
      Context.FindLineNumberInTextFile(txtPath, "seta r_height", Nucleus.SearchType.StartsWith) + '|seta r_height "720"',
      Context.FindLineNumberInTextFile(txtPath, "seta r_width", Nucleus.SearchType.StartsWith) + '|seta r_width "1280"'
    ];
    Context.ReplaceLinesInTextFile(txtPath, dict);

    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\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 (resolution == "1080p") {
    Game.DontResize = true;
    Game.DontReposition = true;
    Game.DontRemoveBorders = true;
    var txtPath = Context.EnvironmentPlayer + "\\Documents\\My Games\\insane2\\user_config.cfg";
    var dict = [
      Context.FindLineNumberInTextFile(txtPath, "seta r_fullscreen", Nucleus.SearchType.StartsWith) + '|seta r_fullscreen "1"',
      Context.FindLineNumberInTextFile(txtPath, "seta r_height", Nucleus.SearchType.StartsWith) + '|seta r_height "1080"',
      Context.FindLineNumberInTextFile(txtPath, "seta r_width", Nucleus.SearchType.StartsWith) + '|seta r_width "1920"'
    ];
    Context.ReplaceLinesInTextFile(txtPath, dict);

    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\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")
    ]);
  }
  var Mus = Context.Options["Mus"];
  if (Mus == "Yes") {
    if (Context.PlayerID == 0) {
      var txtPath = Context.EnvironmentPlayer + "\\Documents\\My Games\\insane2\\user_config.cfg";
      var dict = [Context.FindLineNumberInTextFile(txtPath, "seta s_musicVolume", Nucleus.SearchType.StartsWith) + '|seta s_musicVolume "0.75"'];
      Context.ReplaceLinesInTextFile(txtPath, dict);
    } else {
      var txtPath = Context.EnvironmentPlayer + "\\Documents\\My Games\\insane2\\user_config.cfg";
      var dict = [Context.FindLineNumberInTextFile(txtPath, "seta s_musicVolume", Nucleus.SearchType.StartsWith) + '|seta s_musicVolume "0.00"'];
      Context.ReplaceLinesInTextFile(txtPath, dict);
    }
  }
  var Mus = Context.Options["Mus"];
  if (Mus == "No") {
    var txtPath = Context.EnvironmentPlayer + "\\Documents\\My Games\\insane2\\user_config.cfg";
    var dict = [Context.FindLineNumberInTextFile(txtPath, "seta s_musicVolume", Nucleus.SearchType.StartsWith) + '|seta s_musicVolume "0.75"'];
    Context.ReplaceLinesInTextFile(txtPath, dict);
  }

  var interfaces = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\steam_interfaces.txt";
  var lines = [
    "SteamClient010",
    "SteamGameServer010",
    "SteamGameServerStats001",
    "SteamUser016",
    "SteamFriends009",
    "SteamUtils005",
    "SteamMatchMaking008",
    "SteamMatchMakingServers002",
    "STEAMUSERSTATS_INTERFACE_VERSION010",
    "STEAMAPPS_INTERFACE_VERSION004",
    "SteamNetworking005",
    "STEAMREMOTESTORAGE_INTERFACE_VERSION004",
    "SteamMasterServerUpdater001"
  ];

  Context.WriteTextFile(interfaces, lines);

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

  var native = Context.Options["Native"];
  if (native == "Yes") {
    if (Context.PlayerID == 0) {
      var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\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) + "\\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") {
  }

  var id = Context.Options["id"];
  Game.PlayerSteamIDs = [
    "765611990231254" + id + "" + Context.PlayerID + "",
    "765611990231254" + id + "" + Context.PlayerID + "",
    "765611990231254" + id + "" + Context.PlayerID + "",
    "765611990231254" + id + "" + Context.PlayerID + "",
    "765611990231254" + id + "" + Context.PlayerID + "",
    "765611990231254" + id + "" + Context.PlayerID + "",
    "765611990231254" + id + "" + Context.PlayerID + "",
    "765611990231254" + id + "" + Context.PlayerID + "",
    "765611990231254" + id + "" + Context.PlayerID + "",
    "765611990231254" + id + "" + Context.PlayerID + ""
  ];
};