RealRTCW · handler “RealRTCWCoop”
Version 2
Release notes
Unmuted music.
- Released
- Size
- 3.0 KB
- Downloads
- 146
- Check
- Verified
- SHA-256
- cae9f56b12646f1677e99587104376ed4abf55c851a8aab707caa9942f4b3e28
Files 1
| Path | Size |
|---|---|
| handler.js | 12 KB |
handler.js
Plain textHub.Handler.Version = 2; // Released at https://hub.splitscreen.me/ on Thu Nov 04 2021 00:43:12 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "3B7NDcs9ZgRj7XQMN";
Hub.Maintainer.Name = "Zensuu";
Hub.Maintainer.Id = "sshRgms8c4xET4sCy";
var answers1 = ["Script Default", "RealRTCW Default"];
Game.AddOption("Control Scheme", "Select the joypad control scheme you want to use.", "JoyCfg", answers1);
Game.FileSymlinkExclusions = ["steam_api.dll", "steam_api64.dll", "steam_appid.txt", "autoexec.cfg", "xinput.cfg", "xbox.cfg"];
Game.UseNucleusEnvironment = true;
Game.HandlerInterval = 100;
Game.ExecutableName = "RTCWCoop.x64.exe";
Game.SteamID = "1379630";
Game.GUID = "RealRTCW";
Game.GameName = "RealRTCW";
Game.LauncherTitle = "";
Game.MaxPlayersOneMonitor = 8;
Game.MaxPlayers = 8;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "Return to Castle Wolfenstein";
Game.HasDynamicWindowTitle = true;
Game.DontRemoveBorders = true;
Game.HideTaskbar = true;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.XInputPlusDll = ["xinput1_4.dll"];
Game.SupportsKeyboard = false;
Game.Hook.CustomDllEnabled = false;
Game.DocumentsConfigPath = "RealRTCWCoop\\coopmain";
Game.Description =
"Requires the RealRTCWCoop mod on a clean ROTW installtion. If you are using the MODDB version you must install RealRTCWCoop and not RealRTCW. Alt tab and use your mouse cursor to navigate the UI in all gamepad instances. Each keyboard player can only use their own keyboard and mouse. Host with one instance and join with the rest, but do not host or join with an instance until it has repositioned. Press END to lock input after all gamepad players have joined.";
Game.PromptBetweenInstances = true;
Game.PauseBetweenContextAndLaunch = 2;
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.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 = true;
Game.ProtoInput.MessageFilterHook = true;
Game.ProtoInput.GetCursorPosHook = true;
Game.ProtoInput.SetCursorPosHook = true;
Game.ProtoInput.GetKeyStateHook = true;
Game.ProtoInput.GetAsyncKeyStateHook = true;
Game.ProtoInput.GetKeyboardStateHook = true;
Game.ProtoInput.CursorVisibilityHook = true;
Game.ProtoInput.ClipCursorHook = false;
Game.ProtoInput.FocusHooks = true;
Game.ProtoInput.DrawFakeCursor = false;
Game.ProtoInput.ClipCursorHookCreatesFakeClip = false;
Game.ProtoInput.EnableToggleFakeCursorVisibilityShortcut = false;
Game.ProtoInput.DontShowCursorWhenImageUpdated = true;
Game.ProtoInput.RawInputFilter = false;
Game.ProtoInput.MouseMoveFilter = false;
Game.ProtoInput.MouseActivateFilter = false;
Game.ProtoInput.WindowActivateFilter = true;
Game.ProtoInput.WindowActvateAppFilter = true;
Game.ProtoInput.MouseWheelFilter = true;
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.EnableFocusMessageLoop = true;
Game.ProtoInput.FocusLoopIntervalMilliseconds = 5;
Game.ProtoInput.FocusLoop_WM_ACTIVATE = false;
Game.ProtoInput.FocusLoop_WM_ACTIVATEAPP = false;
Game.ProtoInput.FocusLoop_WM_NCACTIVATE = false;
Game.ProtoInput.FocusLoop_WM_SETFOCUS = false;
Game.ProtoInput.FocusLoop_WM_MOUSEACTIVATE = false;
Game.ProtoInput.WindowActivateFilter = false;
Game.ProtoInput.BlockedMessages = [0x0008];
Game.Play = function() {
if (Context.IsKeyboardPlayer) {
Game.ProtoInput.RegisterRawInputHook = true;
} else {
}
var mkbCfg = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\coopmain\\mkb.cfg";
var lines = [
"in_joystick 0",
"in_restart",
'set duck "+movedown; set crouchToggle vstr stand; echo ^3Crouching...^7"',
'set stand "-movedown; set crouchToggle vstr duck; echo ^2Standing...^7"',
'set crouchToggle "vstr duck"',
'bind c "vstr crouchToggle"'
];
Context.WriteTextFile(mkbCfg, lines);
var xinputCfg = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\coopmain\\xinput.cfg";
var lines = [
"in_joystick 1",
"in_restart",
'set duck "+movedown; set crouchToggle vstr stand; echo ^3Crouching...^7"',
'set stand "-movedown; set crouchToggle vstr duck; echo ^2Standing...^7"',
'set crouchToggle "vstr duck"',
'bind PAD0_B "weapprev"',
'bind PAD0_A "+moveup"',
'bind PAD0_X "+reload; +activate"',
'bind PAD0_Y "weapnext"',
'bind PAD0_BACK "notebook"',
'bind PAD0_START "togglemenu"',
'bind PAD0_LEFTSTICK_CLICK "vstr crouchToggle"',
'bind PAD0_RIGHTSTICK_CLICK "+zoom"',
'bind PAD0_LEFTSHOULDER "+sprint"',
'bind PAD0_RIGHTSHOULDER "+kick"',
'bind PAD0_DPAD_UP "+useitem"',
'bind PAD0_DPAD_DOWN "itemnext"',
'bind PAD0_DPAD_LEFT "+leanleft"',
'bind PAD0_DPAD_RIGHT "+leanright"',
'bind PAD0_LEFTSTICK_LEFT "+moveleft"',
'bind PAD0_LEFTSTICK_RIGHT "+moveright"',
'bind PAD0_LEFTSTICK_UP "+forward"',
'bind PAD0_LEFTSTICK_DOWN "+back"',
'bind PAD0_RIGHTSTICK_LEFT "+left"',
'bind PAD0_RIGHTSTICK_RIGHT "+right"',
'bind PAD0_RIGHTSTICK_UP "+lookup"',
'bind PAD0_RIGHTSTICK_DOWN "+lookdown"',
'bind PAD0_LEFTTRIGGER "weapalt"',
'bind PAD0_RIGHTTRIGGER "+attack"',
"in_joystickuseanalog 1",
'seta j_pitch "0.005"',
'seta j_yaw "-0.008"'
];
Context.WriteTextFile(xinputCfg, lines);
var realCfg = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\coopmain\\xbox.cfg";
var lines = [
"in_joystick 1",
"in_restart",
'bind PAD0_B "+movedown"',
'bind PAD0_A "+moveup"',
'bind PAD0_X "+reload"',
'bind PAD0_Y "+activate"',
'bind PAD0_BACK "notebook"',
'bind PAD0_START "togglemenu"',
'bind PAD0_LEFTSTICK_CLICK "+sprint"',
'bind PAD0_RIGHTSTICK_CLICK "+kick"',
'bind PAD0_LEFTSHOULDER "weapprev"',
'bind PAD0_RIGHTSHOULDER "weapnext"',
'bind PAD0_DPAD_UP "savegame quicksave"',
'bind PAD0_DPAD_DOWN "loadgame quicksave"',
'bind PAD0_DPAD_LEFT "itemprev"',
'bind PAD0_DPAD_RIGHT "+useitem"',
'bind PAD0_LEFTSTICK_LEFT "+moveleft"',
'bind PAD0_LEFTSTICK_RIGHT "+moveright"',
'bind PAD0_LEFTSTICK_UP "+forward"',
'bind PAD0_LEFTSTICK_DOWN "+back"',
'bind PAD0_RIGHTSTICK_LEFT "+left"',
'bind PAD0_RIGHTSTICK_RIGHT "+right"',
'bind PAD0_RIGHTSTICK_UP "+lookup"',
'bind PAD0_RIGHTSTICK_DOWN "+lookdown"',
'bind PAD0_LEFTTRIGGER "weapalt"',
'bind PAD0_RIGHTTRIGGER "+attack"',
"in_joystickuseanalog 1",
'seta j_pitch "0.005"',
'seta j_yaw "-0.008"',
'set duck "+movedown; set crouchToggle vstr stand"',
'set stand "-movedown; set crouchToggle vstr duck"',
'set crouchToggle "vstr duck"',
'bind PAD0_B "vstr crouchToggle"'
];
Context.WriteTextFile(realCfg, lines);
var autoExec = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\coopmain\\autoexec.coop.cfg";
var lines = [
"set s_useOpenAL 1",
"set r_dynamiclight 1",
"set r_ignorehwgamma 0",
"set sv_pure 0",
'seta name "' + Context.Nickname + '"',
'seta r_customwidth "' + Context.Width + '"',
'seta r_customheight "' + Context.Height + '"',
'seta r_mode "-1"',
'seta r_fullscreen "0"',
'seta r_allowResize "1"',
'seta r_noborder "1"',
'seta s_musicvolume "0.5"',
'seta cg_fixedAspect "2"',
'seta in_joystickUseAnalog "1"',
'seta in_joystick "1"',
"exec xinput.cfg"
];
Context.WriteTextFile(autoExec, lines);
var joycfg = Context.Options["JoyCfg"];
if (joycfg == "Script Default") {
}
if (joycfg == "RealRTCW Default") {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\coopmain\\autoexec.coop.cfg";
var dict = [Context.FindLineNumberInTextFile(txtPath, "exec xinput.cfg", Nucleus.SearchType.StartsWith) + "|exec xbox.cfg"];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\coopmain\\autoexec.coop.cfg";
if (Context.PlayerID > 0) {
var dict = [Context.FindLineNumberInTextFile(txtPath, "seta s_musicvolume", Nucleus.SearchType.StartsWith) + '|seta s_musicvolume "0.0"'];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (Player.IsKeyboardPlayer) {
var dict = [Context.FindLineNumberInTextFile(txtPath, "exec xinput.cfg", Nucleus.SearchType.StartsWith) + "|exec mkb.cfg"];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
Game.ProtoInput.OnInputLocked = function() {
for (var i = 0; i < PlayerList.Count; i++) {
var player = PlayerList[i];
ProtoInput.StartFocusMessageLoop(player.ProtoInputInstanceHandle, 0, true, false, true, false, false);
System.Threading.Thread.Sleep(1000);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.GetCursorPosHookID);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.SetCursorPosHookID);
ProtoInput.InstallHook(player.ProtoInputInstanceHandle, ProtoInput.Values.CursorVisibilityStateHookID);
ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.RawInputFilterID);
ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseButtonFilterID);
ProtoInput.EnableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.KeyboardButtonFilterID);
ProtoInput.StopFocusMessageLoop(player.ProtoInputInstanceHandle);
}
};
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.CursorVisibilityStateHookID);
ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.RawInputFilterID);
ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.MouseButtonFilterID);
ProtoInput.DisableMessageFilter(player.ProtoInputInstanceHandle, ProtoInput.Values.KeyboardButtonFilterID);
}
};
};