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

Star Wars: Republic Commando · handler “Star Wars: Republic Commando”

Version 1 (current)

Release notes

Release

Released
Size
7.1 MB
Downloads
1,328
Check
Verified
SHA-256
18e5887719af80f1a00d2a2d5cc36963aecb6e1e9952aefc753ed2c3444aa12a
Download v1 (.nc)All versions

Files 18

PathSize
SWRepublicCommando/joystick.ini10 KB
SWRepublicCommando/Maps/DM_Canyon.ctm1.7 MB
SWRepublicCommando/Maps/DM_Detention.ctm3.9 MB
SWRepublicCommando/Maps/DM_Engine.ctm4.0 MB
SWRepublicCommando/Maps/DM_Hangar.ctm3.7 MB
SWRepublicCommando/Maps/DM_HangingGarden.ctm2.6 MB
SWRepublicCommando/Maps/DM_POW.ctm4.6 MB
SWRepublicCommando/Maps/DM_POWSmall.ctm1.4 MB
SWRepublicCommando/Maps/DM_Siege.ctm1.5 MB
SWRepublicCommando/Maps/DM_Trando.ctm3.8 MB
SWRepublicCommando/Maps/DM_Underpass.ctm2.2 MB
SWRepublicCommando/Maps/DM_ZeroG.ctm1011 KB
SWRepublicCommando/ModMPGame.dll108 KB
SWRepublicCommando/ModMPGame.ini932 B
SWRepublicCommando/ModMPGame.u59 KB
SWRepublicCommando/README.pdf56 KB
SWRepublicCommando/Republic Commando controls.png38 KB
handler.js17 KB

handler.js

Plain text
Hub.Handler.Version = 1; // Released at https://hub.splitscreen.me/ on Mon Feb 27 2023 01:56:52 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "HNgneEonpYELprGtN";
Hub.Maintainer.Name = "birden";
Hub.Maintainer.Id = "rRycxSn253ZCjQy5C";

var answers1 = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"];
Game.AddOption("Choose the number of bots to be added.", "6-8 recommended, the bigger the amount of bots the laggier it gets for players that aren't the host.", "Bots", answers1);

Game.ExecutableContext = ["Mod.dll"];
Game.DirSymlinkExclusions = ["GameData\\Maps", "GameData\\Save", "GameData\\System"];
Game.FileSymlinkExclusions = [
  "steam_appid.txt",
  "ModMPGame.ini",
  "ModMPGame.dll",
  "ModMPGame.u",
  "dinput.dll",
  "dinput8.dll",
  "xinput1_3.dll",
  "xinput1_4.dll",
  "XInputPlus.ini",
  "DM_Canyon.ctm",
  "DM_Detention.ctm",
  "DM_Engine.ctm",
  "DM_Hangar.ctm",
  "DM_HangingGarden.ctm",
  "DM_POW.ctm",
  "DM_POWSmall.ctm",
  "DM_Siege.ctm",
  "DM_Trando.ctm",
  "DM_Underpass.ctm",
  "DM_ZeroG.ctm"
];
Game.FileSymlinkCopyInstead = ["System.ini", "user.ini", "GameSpyMgr.dll", "Mod.dll", "Mod.int", "Mod.u", "OpenGLDrv.dll", "UCC.exe", "UnrealEd.ini"];
Game.NeedsSteamEmulation = false;
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = true;
Game.ExecutableName = "CT.exe";
Game.SteamID = "6000";
Game.GUID = "Star Wars Republic Commando";
Game.GameName = "STAR WARS Republic Commando";
Game.MaxPlayers = 8;
Game.MaxPlayersOneMonitor = 8;
Game.BinariesFolder = "GameData\\System";
Game.LauncherTitle = "";
Game.HideTaskbar = false;
Game.StartArguments = "-windowed";
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "Star Wars Republic Commando";
Game.ResetWindows = true;
Game.RefreshWindowAfterStart = true;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.Hook.CustomDllEnabled = false;
Game.XInputPlusDll = ["xinput1_4.dll", "Dinput.dll", "Dinput8.dll"];
Game.Description =
  "IMPORTANT: This requires the Star Wars Republic Commando Fix to be installed in your main game files: https://github.com/SWRC-Modding/CT/releases. Use your mouse cursor to navigate the menus in all instances as there is no gamepad support in menus, make sure to select the auto generated game profile for the gamepads to work correctly. Connect the instances via multiplayer LAN. Press back on gamepad once if your character stops after firing. If you use keyboards and mice after all the instances have launched, resized and positioned correctly, press the END key once to lock the input for all instances to have their own working cursor and keyboard. You need to left click each mouse to make the emulated cursors appear after locking the input. Press the END key again to unlock the input when you finish playing. You can also use CTRL+Q to close Nucleus and all its instances when the input is unlocked. Press the escape key or start in-game if the emulated cursor shows in the center after locking the input. The Nucleus game profiles get saved to the instances folders inside Nucleus content folder in GameData\\Save, so be careful about deleting the content folder.";
Game.KeepSymLinkOnExit = true;
Game.PauseBetweenProcessGrab = 5;
Game.PauseBetweenStarts = 20;

//USS deprecated options:

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

Game.SendNormalMouseInput = false;
Game.SendNormalKeyboardInput = false;
Game.SendScrollWheel = false;
Game.ForwardRawKeyboardInput = false;
Game.ForwardRawMouseInput = false;
Game.HookReRegisterRawInput = false;
Game.HookReRegisterRawInputMouse = false;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = false;

//ProtoInput:

Game.SupportsMultipleKeyboardsAndMice = true;

Game.ProtoInput.InjectStartup = false;
Game.ProtoInput.InjectRuntime_RemoteLoadMethod = false;
Game.ProtoInput.InjectRuntime_EasyHookMethod = true;
Game.ProtoInput.InjectRuntime_EasyHookStealthMethod = false;

Game.LockInputAtStart = false;
Game.LockInputSuspendsExplorer = true;
Game.ProtoInput.FreezeExternalInputWhenInputNotLocked = false;
Game.LockInputToggleKey = 0x23;

Game.ProtoInput.RenameHandlesHook = false;
Game.ProtoInput.RenameHandles = [];
Game.ProtoInput.RenameNamedPipes = [];

Game.ProtoInput.RegisterRawInputHook = false;
Game.ProtoInput.GetRawInputDataHook = false;
Game.ProtoInput.MessageFilterHook = true;
Game.ProtoInput.GetCursorPosHook = false;
Game.ProtoInput.SetCursorPosHook = false;
Game.ProtoInput.GetKeyStateHook = false;
Game.ProtoInput.GetAsyncKeyStateHook = false;
Game.ProtoInput.GetKeyboardStateHook = false;
Game.ProtoInput.CursorVisibilityHook = false;
Game.ProtoInput.ClipCursorHook = true;
Game.ProtoInput.FocusHooks = true;
Game.ProtoInput.DrawFakeCursor = false;
Game.ProtoInput.ClipCursorHookCreatesFakeClip = false;
Game.ProtoInput.EnableToggleFakeCursorVisibilityShortcut = false;
Game.ProtoInput.DontShowCursorWhenImageUpdated = false;

Game.ProtoInput.RawInputFilter = false;
Game.ProtoInput.MouseMoveFilter = false;
Game.ProtoInput.MouseActivateFilter = false;
Game.ProtoInput.WindowActivateFilter = false;
Game.ProtoInput.WindowActvateAppFilter = false;
Game.ProtoInput.MouseWheelFilter = false;
Game.ProtoInput.MouseButtonFilter = false;
Game.ProtoInput.KeyboardButtonFilter = false;

Game.ProtoInput.SendMouseWheelMessages = true;
Game.ProtoInput.SendMouseButtonMessages = true;
Game.ProtoInput.SendMouseMovementMessages = true;
Game.ProtoInput.SendKeyboardButtonMessages = true;
Game.ProtoInput.XinputHook = false;
Game.ProtoInput.UseOpenXinput = false;
Game.ProtoInput.UseDinputRedirection = false;
Game.ProtoInput.DinputDeviceHook = false;
Game.ProtoInput.DinputHookAlsoHooksGetDeviceState = false;
Game.ProtoInput.MultipleProtoControllers = false;

Game.ProtoInput.EnableFocusMessageLoop = false;
//Game.ProtoInput.FocusLoopIntervalMilliseconds = 1;
//Game.ProtoInput.FocusLoop_WM_ACTIVATE = true;
//Game.ProtoInput.FocusLoop_WM_ACTIVATEAPP = true;
//Game.ProtoInput.FocusLoop_WM_NCACTIVATE = true;
//Game.ProtoInput.FocusLoop_WM_SETFOCUS = true;
//Game.ProtoInput.FocusLoop_WM_MOUSEACTIVATE = true;
Game.ProtoInput.BlockedMessages = [0x0008]; // Blocks WM_KILLFOCUS

Game.Play = function() {
  var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\System\\XInputPlus.ini";
  Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
    new Nucleus.IniSaveInfo("X2DInput", "EnableX2Dinput", true),
    new Nucleus.IniSaveInfo("X2DInput", "LT", "Button11"),
    new Nucleus.IniSaveInfo("X2DInput", "RT", "Button12")
  ]);

  if (Context.IsKeyboardPlayer) {
    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\System\\System.ini";
    Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
      new Nucleus.IniSaveInfo("WinDrv.WindowsClient", "StartupFullscreen", false),
      new Nucleus.IniSaveInfo("WinDrv.WindowsClient", "UseJoystick", false)
    ]);
  } else {
    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\System\\System.ini";
    Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
      new Nucleus.IniSaveInfo("WinDrv.WindowsClient", "StartupFullscreen", false),
      new Nucleus.IniSaveInfo("WinDrv.WindowsClient", "UseJoystick", true)
    ]);
  }

  var filePath = (Context.filePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Save\\Profile_" + Context.Nickname);
  System.IO.Directory.CreateDirectory(filePath);

  if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Save\\Profile_" + Context.Nickname + "\\User.ini")) {
    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Save\\Profile_" + Context.Nickname + "\\User.ini");
    var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "joystick.ini");
    System.IO.File.Copy(savePkgOrigin, savePath, true);
  }

  var bots = Context.Options["Bots"];

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\System\\ModMPGame.dll");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "ModMPGame.dll");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\System\\ModMPGame.u");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "ModMPGame.u");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

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

  var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\System\\ModMPGame.ini";
  Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
    new Nucleus.IniSaveInfo("ModMPGame.BotSupport", "bBotsCountAsPlayers", false),
    new Nucleus.IniSaveInfo("ModMPGame.BotSupport", "NumBots", bots)
  ]);

  var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\System\\System.ini";
  var dict = [Context.FindLineNumberInTextFile(txtPath, ";ServerActors+=IpServer.UdpServerQuery", Nucleus.SearchType.StartsWith) + "|ServerActors+=ModMPGame.AdminControl"];
  Context.ReplaceLinesInTextFile(txtPath, dict);

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Maps\\DM_Canyon.ctm");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Maps\\DM_Canyon.ctm");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Maps\\DM_Detention.ctm");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Maps\\DM_Detention.ctm");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Maps\\DM_Engine.ctm");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Maps\\DM_Engine.ctm");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Maps\\DM_Hangar.ctm");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Maps\\DM_Hangar.ctm");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Maps\\DM_HangingGarden.ctm");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Maps\\DM_HangingGarden.ctm");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Maps\\DM_POW.ctm");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Maps\\DM_POW.ctm");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Maps\\DM_POWSmall.ctm");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Maps\\DM_POWSmall.ctm");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Maps\\DM_Siege.ctm");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Maps\\DM_Siege.ctm");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Maps\\DM_Trando.ctm");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Maps\\DM_Trando.ctm");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Maps\\DM_Underpass.ctm");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Maps\\DM_Underpass.ctm");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\GameData\\Maps\\DM_ZeroG.ctm");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Maps\\DM_ZeroG.ctm");
  System.IO.File.Copy(savePkgOrigin, savePath, true);

  Game.ProtoInput.OnInputLocked = function() {
    for (var i = 0; i < PlayerList.Count; i++) {
      var player = PlayerList[i];

      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetCursorPosHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.SetCursorPosHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyStateHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetAsyncKeyStateHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyboardStateHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.CursorVisibilityStateHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetRawInputDataHookID);
      ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.RegisterRawInputHookID);
      //ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.MessageFilterHookID);

      //Avoid the mouse move filter unless absolutely necessary as it can massively affect performance if the game gets primary input from mouse move messages
      //ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseMoveFilterID);

      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.RawInputFilterID);
      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseActivateFilterID);
      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateFilterID);
      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateAppFilterID);
      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseWheelFilterID);
      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseButtonFilterID);
      ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.KeyboardButtonFilterID);

      ProtoInput.SetDrawFakeCursor(player.ProtoInputInstanceHandle, true);
    }
  };

  Game.ProtoInput.OnInputUnlocked = function() {
    for (var i = 0; i < PlayerList.Count; i++) {
      var player = PlayerList[i];

      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetCursorPosHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.SetCursorPosHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyStateHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetAsyncKeyStateHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetKeyboardStateHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.CursorVisibilityStateHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetRawInputDataHookID);
      ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.RegisterRawInputHookID);
      //ProtoInput.UninstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.MessageFilterHookID);

      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.RawInputFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseMoveFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseActivateFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.WindowActivateAppFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseWheelFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseButtonFilterID);
      ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.KeyboardButtonFilterID);

      ProtoInput.SetDrawFakeCursor(player.ProtoInputInstanceHandle, false);
    }
  };
};