Star Wars: Episode I - Racer · handler “Star Wars Racer 1”
Version 1
Release notes
First Release.
- Released
- Size
- 1.4 MB
- Downloads
- 17
- Check
- Unverified
- SHA-256
- c7fa2421aa6122194891703608c827047ea35e0cfee7de841db0cf27d1b78c5a
Files 13
| Path | Size |
|---|---|
| handler.js | 11 KB |
| StarWarsRacer1/current_control.map | 5.7 KB |
| StarWarsRacer1/D3D8.dll | 332 KB |
| StarWarsRacer1/D3DImm.dll | 171 KB |
| StarWarsRacer1/DDraw.dll | 209 KB |
| StarWarsRacer1/dgVoodoo.conf | 15 KB |
| StarWarsRacer1/dgVoodooCpl.exe | 344 KB |
| StarWarsRacer1/Dinput.dll | 172 KB |
| StarWarsRacer1/Dinput8.dll | 173 KB |
| StarWarsRacer1/nircmd.exe | 117 KB |
| StarWarsRacer1/position.cmd | 201 B |
| StarWarsRacer1/XInput1_3.dll | 478 KB |
| StarWarsRacer1/XInputPlus.ini | 2.4 KB |
handler.js
Plain textHub.Handler.Version = 1; // Released at https://hub.splitscreen.me/ on Fri Nov 27 2020 23:55:31 GMT+0000 (UTC).
Hub.Handler.Id = "eLwEGoC3dp3nDRPhA";
Hub.Maintainer.Name = "Bizzo";
Hub.Maintainer.Id = "HEgozNi3MNvhAmWfi";
Game.FileSymlinkCopyInstead = [
//this files will be copied from the original folder
"audio.cfg",
"ipxwrapper.dll",
"wsock32.dll",
"Smush.dll",
"mswsock.dll",
"IFORCE2.dll",
"dsetup32.dll",
"dsetup16.dll",
"dsetup.dll",
"dpwsockx.dll",
"a3dapi.dll"
];
Game.FileSymlinkExclusions = [
//what files should not be copied
"ddraw.dll",
"steam_appid.txt",
"current_control.map",
"D3D8.dll",
"D3DImm.dll",
"dgVoodoo.conf",
"Dinput.dll",
"Dinput8.dll",
"XInput1_3.dll",
"XInputPlus.ini"
];
var answers = ["Last chosen", "Only-First", "All-Players", "All-Disabled"]; //adding variables that user can use on the options
Game.AddOption("Which player will have music in race?", "", "MUSIC", answers);
Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.HardlinkGame = true;
Game.SupportsKeyboard = false;
Game.KeyboardPlayerFirst = false;
Game.ExecutableName = "SWEP1RCR.EXE";
Game.SteamID = "808910";
Game.GUID = "SWEpIRacer";
Game.GameName = "STAR WARS™ Episode I Racer";
Game.NeedsSteamEmulation = false;
Game.UseGoldberg = false;
Game.UseSteamStubDRMPatcher = true;
Game.KeepSymLinkOnExit = true;
Game.CreateSteamAppIdByExe = true;
Game.LauncherTitle = "";
Game.SaveType = Nucleus.SaveType.CFG;
Game.SupportsPositioning = true;
Game.HideTaskbar = true;
Game.WorkingFolder = "";
Game.MaxPlayersOneMonitor = 4;
Game.MaxPlayers = 8;
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "?";
Game.HasDynamicWindowTitle = true;
Game.IdInWindowTitle = true;
Game.Hook.DInputEnabled = false;
Game.Hook.DInputForceDisable = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.Hook.CustomDllEnabled = false;
Game.PromptBetweenInstances = true;
Game.HookFocus = true;
Game.HookInit = true;
Game.NotTopMost = true;
Game.DontResize = true;
Game.DontReposition = true;
Game.PauseBetweenProcessGrab = 10;
Game.PauseBetweenStarts = 10;
Game.PauseBetweenContextAndLaunch = 5;
Game.StartArguments = "-i";
Game.PreventWindowDeactivation = true;
Game.FakeFocus = true;
Game.Description =
"Script support only gamepads. Create a server in the first instance, choose your podracer and choose how many laps. Before start the next instance, move your gamepad and be sure that is recognized by the instance. When you are ready start the next instance. Join in the server and choose your podracer before start the next one. After you click 'ok' on the last Nucleus prompt (hook/sends fake messages) you will not be able to use the mouse anymore. Only the first player is able to change the podracer and the track with the gamepad. Ctrl+Q is used for exit the race.";
Game.Play = function() {
Game.SupportsMultipleKeyboardsAndMice = true;
Game.HookSetCursorPos = true;
Game.HookGetCursorPos = true;
Game.HookGetKeyState = true;
Game.HookGetAsyncKeyState = true;
Game.HookGetKeyboardState = true;
Game.HookFilterRawInput = true;
Game.HookFilterMouseMessages = false;
Game.HookUseLegacyInput = false;
Game.HookDontUpdateLegacyInMouseMsg = false;
Game.HookMouseVisibility = true;
Game.SendNormalMouseInput = true;
Game.SendNormalKeyboardInput = true;
Game.SendScrollWheel = true;
Game.ForwardRawMouseInput = true;
Game.ForwardRawKeyboardInput = false;
Game.HookReRegisterRawInput = false;
Game.HookReRegisterRawInputMouse = false;
Game.HookReRegisterRawInputKeyboard = false;
Game.DrawFakeMouseCursor = true;
Game.LockInputAtStart = false;
Game.LockInputToggleKey = 0x23;
var txtPath = Game.Folder + "\\position.cmd";
var dict = ['4|nircmd.exe win setsize ititle "Episode I Racer(' + Context.PlayerID + ')" ' + Player.MonitorBounds.X + " " + Player.MonitorBounds.Y + " " + Context.Width + " " + Context.Height + ""];
Context.ReplaceLinesInTextFile(txtPath, dict);
Context.RunAdditionalFiles(["all|" + Game.Folder + "\\position.cmd"], false, 0, true);
if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\data\\config\\current\\current_control.map")) {
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\data\\config\\current\\current_control.map"); //Copying the specific files to the Emulator Nucleus instance content folders from the SuperMario64 scripts Nucleus folder
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "current_control.map");
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\dgVoodoo.conf");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "dgVoodoo.conf");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\D3D8.dll");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "D3D8.dll");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\D3DImm.dll");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "D3DImm.dll");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\DDraw.dll");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "DDraw.dll");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\data\\config\\current\\current_control.map"; //Editing a specific file by manually selecting the line and manually edit the text
var dict = ["24|JOYSTICK ENABLED=TRUE", "70|KEYBOARD ENABLED=FALSE"];
Context.ReplaceLinesInTextFile(txtPath, dict);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Dinput.dll");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Dinput.dll");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Dinput8.dll");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Dinput8.dll");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\XInput1_3.dll");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "XInput1_3.dll");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\XInputPlus.ini");
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "XInputPlus.ini");
System.IO.File.Copy(savePkgOrigin, savePath, true);
var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\XInputPlus.ini";
Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
new Nucleus.IniSaveInfo("ControllerNumber", "Controller1", Context.PlayerID + 1),
new Nucleus.IniSaveInfo("ControllerNumber", "Controller2", ""),
new Nucleus.IniSaveInfo("ControllerNumber", "Controller3", ""),
new Nucleus.IniSaveInfo("ControllerNumber", "Controller4", "")
]);
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\dgVoodoo.conf"; //Editing a specific file by manually selecting the line and manually edit the text
var dict = [
"165|Resolution = h:" + Context.Width + ", v:" + Context.Height + "," //Context.Widht and Height will write the numbers of the resolution choosed by the user in the Nucleus UI screen selector
];
Context.ReplaceLinesInTextFile(txtPath, dict);
var mus = Context.Options["MUSIC"]; //this is what happens on the "What type of controller are you using?" option. Basically it just edit ini files depending by the user choice
if (mus == "Only-First") {
if (Context.PlayerID == "0") {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\data\\config\\current\\audio.cfg"; //Editing a specific file by manually selecting the line and manually edit the text
var dict = ["12|AUDIO MUSIC=ON"];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (Context.PlayerID > "0") {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\data\\config\\current\\audio.cfg"; //Editing a specific file by manually selecting the line and manually edit the text
var dict = ["12|AUDIO MUSIC=OFF"];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
}
if (mus == "All-Players") {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\data\\config\\current\\audio.cfg"; //Editing a specific file by manually selecting the line and manually edit the text
var dict = ["12|AUDIO MUSIC=ON"];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
if (mus == "All-Disabled") {
var txtPath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\data\\config\\current\\audio.cfg"; //Editing a specific file by manually selecting the line and manually edit the text
var dict = ["12|AUDIO MUSIC=OFF"];
Context.ReplaceLinesInTextFile(txtPath, dict);
}
Context.EditRegKey(
"HKEY_LOCAL_MACHINE",
"SOFTWARE\\WOW6432Node\\LucasArts Entertainment Company LLC\\Star Wars: Episode I Racer\\v1.0",
"executable",
Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\SWEP1RCR.EXE",
Nucleus.RegType.String
);
Context.EditRegKey(
"HKEY_LOCAL_MACHINE",
"SOFTWARE\\WOW6432Node\\LucasArts Entertainment Company LLC\\Star Wars: Episode I Racer\\v1.0",
"GUID",
"{" + Context.GamepadGuid + "}",
Nucleus.RegType.String
);
Context.EditRegKey(
"HKEY_LOCAL_MACHINE",
"SOFTWARE\\WOW6432Node\\LucasArts Entertainment Company LLC\\Star Wars: Episode I Racer\\v1.0",
"Install Path",
Context.GetFolder(Nucleus.Folder.InstancedGameFolder),
Nucleus.RegType.String
);
Context.EditRegKey("HKEY_LOCAL_MACHINE", "SOFTWARE\\WOW6432Node\\LucasArts Entertainment Company LLC\\Star Wars: Episode I Racer\\v1.0", "JoystickID", Context.PlayerID + 1, Nucleus.RegType.String);
Context.EditRegKey("HKEY_LOCAL_MACHINE", "SOFTWARE\\WOW6432Node\\LucasArts Entertainment Company LLC\\Star Wars: Episode I Racer\\v1.0", "Last Game", "NucleusCoop", Nucleus.RegType.String);
Context.EditRegKey("HKEY_LOCAL_MACHINE", "SOFTWARE\\WOW6432Node\\LucasArts Entertainment Company LLC\\Star Wars: Episode I Racer\\v1.0", "Last Player", Context.Nickname, Nucleus.RegType.String);
Context.EditRegKey(
"HKEY_LOCAL_MACHINE",
"SOFTWARE\\WOW6432Node\\LucasArts Entertainment Company LLC\\Star Wars: Episode I Racer\\v1.0",
"Source Dir",
Context.GetFolder(Nucleus.Folder.InstancedGameFolder),
Nucleus.RegType.String
);
Context.EditRegKey(
"HKEY_LOCAL_MACHINE",
"SOFTWARE\\WOW6432Node\\LucasArts Entertainment Company LLC\\Star Wars: Episode I Racer\\v1.0",
"Source Path",
Context.GetFolder(Nucleus.Folder.InstancedGameFolder),
Nucleus.RegType.String
);
};