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

TerraTech · handler “TerraTech”

Version 2

Release notes

mkb UI option

Released
Size
1.6 KB
Downloads
256
Check
Verified
SHA-256
de35e07eb02cb02520a348a5d0095eacd16bb5ee8c660e572e9f5a926cb47c68
Download v2 (.nc)All versions

Files 1

PathSize
handler.js4.5 KB

handler.js

Plain text
Hub.Handler.Version = 2; // Released at https://hub.splitscreen.me/ on Sun Apr 04 2021 08:10:42 GMT+0000 (UTC).
Hub.Handler.Id = "pwXokSsMgsTvLWRmr";
Hub.Maintainer.Name = "Talos91";
Hub.Maintainer.Id = "eeL7HAz8zJovChWw4";

var answers1 = ["Default", "Enable", "Disable"];
Game.AddOption("Enable multiple keyboards and mice support?", "Launch, then close Nucleus and open it again for the mkb support to enable.", "MKB", answers1);

Game.DirSymlinkExclusions = ["TerraTechWin64_Data\\Plugins"];
Game.FileSymlinkExclusions = ["steam_api64.dll", "steam_appid.txt", "xinput9_1_0.dll"];
Game.GameName = "TerraTech";
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = false;
Game.SupportsKeyboard = true;
Game.ExecutableName = "TerraTechWin64.exe";
Game.SteamID = "285920";
Game.GUID = "TerraTech";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.NeedsSteamEmulation = false;
Game.UseGoldberg = true;
Game.LauncherTitle = "";
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "TerraTech";
Game.FakeFocus = true;
Game.Hook.DInputEnabled = false;
Game.Hook.DInputForceDisable = true;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.XInputPlusDll = ["xinput1_3.dll", "xinput1_4.dll", "xinput9_1_0.dll"];
Game.Hook.CustomDllEnabled = false;
Game.BlockRawInput = false;
Game.DocumentsSavePath = "My Games\\TerraTech";
Game.Description =
  "When the game launcher opens quickly tick windowed and click play for windows to resize correctly. Use the mouse cursor to start a co-op game and to join. If you enable the mkb support press the END key to unlock the input when you finish playing. You can also use CTRL+Q to close Nucleus and all its instances.";
Game.PauseBetweenProcessGrab = 8;
Game.PauseBetweenStarts = 40;

Game.SupportsMultipleKeyboardsAndMice = false;

Game.HookSetCursorPos = true;
Game.HookGetCursorPos = true;
Game.HookGetKeyState = false;
Game.HookGetAsyncKeyState = false;
Game.HookGetKeyboardState = false;
Game.HookFilterRawInput = true;
Game.HookFilterMouseMessages = false;
Game.HookUseLegacyInput = false;
Game.HookDontUpdateLegacyInMouseMsg = false;
Game.HookMouseVisibility = false;

Game.SendNormalMouseInput = true;
Game.SendNormalKeyboardInput = true;
Game.SendScrollWheel = true;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.HookReRegisterRawInput = true;
Game.HookReRegisterRawInputMouse = true;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = true;
Game.LockInputAtStart = true;
Game.LockInputToggleKey = 0x23;

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\\Payload\\TerraTech", "Screenmanager Fullscreen mode_h3630240806", 3, Nucleus.RegType.DWord);

  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Payload\\TerraTech", "Screenmanager Resolution Height_h2627697771", Context.Height, Nucleus.RegType.DWord);

  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Payload\\TerraTech", "Screenmanager Resolution Width_h182942802", Context.Width, Nucleus.RegType.DWord);

  Context.EditRegKey("HKEY_CURRENT_USER", "SOFTWARE\\Payload\\TerraTech", "Screenmanager Resolution Use Native_h1405027254", 0, Nucleus.RegType.DWord);

  if (Context.HasKeyboardPlayer !== true) {
    Game.SupportsMultipleKeyboardsAndMice = false;
  }

  var mkb = Context.Options["MKB"];

  if (mkb == "Default") {
  }

  if (mkb == "Enable") {
    var txtPath = Context.NucleusFolder + "\\scripts\\TerraTech.js";
    var dict = [
      Context.FindLineNumberInTextFile(txtPath, "Game.SupportsMultipleKeyboardsAndMice", Nucleus.SearchType.StartsWith) + "|Game.SupportsMultipleKeyboardsAndMice = true;",
      Context.FindLineNumberInTextFile(txtPath, "Game.SupportsKeyboard", Nucleus.SearchType.StartsWith) + "|Game.SupportsKeyboard = false;"
    ];
    Context.ReplaceLinesInTextFile(txtPath, dict);
  }

  if (mkb == "Disable") {
    var txtPath = Context.NucleusFolder + "\\scripts\\TerraTech.js";
    var dict = [
      Context.FindLineNumberInTextFile(txtPath, "Game.SupportsMultipleKeyboardsAndMice", Nucleus.SearchType.StartsWith) + "|Game.SupportsMultipleKeyboardsAndMice = false;",
      Context.FindLineNumberInTextFile(txtPath, "Game.SupportsKeyboard", Nucleus.SearchType.StartsWith) + "|Game.SupportsKeyboard = true;"
    ];
    Context.ReplaceLinesInTextFile(txtPath, dict);
  }
};