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

Need for Speed: Most Wanted · handler “Need For Speed Most Wanted 2005”

Version 4

Release notes

Multiple Keyboards/Mice support, XInput/DInput mode selector and Compatible mode resolutions selector.

Released
Size
1.7 MB
Downloads
368
Check
Verified
SHA-256
fa68e28e347c6515a22cf20c0d9e9fe2eb47beb8aed762cbbfa3cfb768003e48
Download v4 (.nc)All versions

Files 13

PathSize
handler.js20 KB
Need For Speed Most Wanted 2005/1/NUCLEUS62 KB
Need For Speed Most Wanted 2005/1/SPARKLE-2012270-09-26-17-32-36.SAV62 KB
Need For Speed Most Wanted 2005/scripts/buttons-playstation.tpk651 KB
Need For Speed Most Wanted 2005/scripts/buttons-xbox.tpk651 KB
Need For Speed Most Wanted 2005/scripts/NFSMostWanted.WidescreenFix.asi349 KB
Need For Speed Most Wanted 2005/scripts/NFSMostWanted.WidescreenFix.ini1.1 KB
Need For Speed Most Wanted 2005/scripts/NFSMWExtraOptions.asi278 KB
Need For Speed Most Wanted 2005/scripts/NFSMWExtraOptionsSettings.ini13 KB
Need For Speed Most Wanted 2005/scripts/NFSMWHUDAdapter.asi74 KB
Need For Speed Most Wanted 2005/server.cfg1.4 KB
Need For Speed Most Wanted 2005/Settings.ini548 B
Need For Speed Most Wanted 2005/winmm.dll2.1 MB

handler.js

Plain text
Hub.Handler.Version = 4; // Released at https://hub.splitscreen.me/ on Sat Nov 28 2020 00:14:25 GMT+0000 (UTC).
Hub.Handler.Id = "nBgGXtk5pTq9Taq2F";
Hub.Maintainer.Name = "Bizzo";
Hub.Maintainer.Id = "HEgozNi3MNvhAmWfi";

/*
In DInput mode, you can use only ONE XboxOne controller and you can't use at the same time the keyboard. 
You must click/alt+tab on the corresponding instance to make it work. 
In alternative you can try fix the problem by doing this http://www.snes9x.com/phpbb3/viewtopic.php?t=27510 or try Xoutput.
*/

var answers = ["Yes", "No"];
var answers1 = ["XInput", "DInput"];
var answers2 = ["No", "Yes"]; //adding variables that user can use on the options
var answers3 = ["640x480", "800x600", "1024x768", "1280x960", "1280x1024"];

Game.AddOption("Which type of controllers will be used?", "In DInput mode, you will probably need to map the gamepads buttons.", "Pad", answers1); //adding options after the input/screen selector
Game.AddOption("Skip intro?", "If you choose No, it could help with crashes.", "Intro", answers);
Game.AddOption("Use compatible mode?", "If your GPU doesn't allow custom resolutions, enable this option.", "GPU", answers2);
Game.AddOption("Resolution of compatible mode?", "This will affect only if compatible mode is enabled.", "Res", answers3);

Game.FileSymlinkCopyInstead = ["server.dll"]; //this files will be copied from the original folder

Game.FileSymlinkExclusions = [
  //this files will not be symlinked from the original folder
  "server.cfg",
  "winmm.dll",
  "dinput8.dll",
  "XInput1_3.dll",
  "XInputPlus.ini",
  "Dinput.dll",
  "buttons-playstation.tpk",
  "buttons-xbox.tpk",
  "NFSMostWanted.WidescreenFix.asi",
  "NFSMostWanted.WidescreenFix.ini",
  "modupdater.asi",
  "modupdater.ini",
  "modupdater.log",
  "Settings.ini",
  "NFSMWExtraOptions.asi",
  "NFSMWExtraOptionsSettings.ini",
  "NFSMWHUDAdapter.asi"
];

Game.HandlerInterval = 100;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SupportsKeyboard = false;
Game.ExecutableName = "speed.exe";
Game.LauncherExe = "speed.exe";
Game.SteamID = "";
Game.GUID = "NeedForSpeedMostWanted2005";
Game.GameName = "Need For Speed Most Wanted 2005";
Game.HideTaskbar = true;
Game.ChangeExe = false;
Game.NeedsSteamEmulation = false;
Game.UseGoldberg = false;
Game.GoldbergNeedSteamInterface = false;
Game.LauncherTitle = "";
Game.SupportsPositioning = true;
Game.BinariesFolder = "";
Game.MaxPlayers = 4;
Game.MaxPlayersOneMonitor = 4;
Game.Hook.ForceFocus = true;
Game.Hook.ForceFocusWindowName = "Need for Speed™️ Most Wanted";
Game.Hook.DInputEnabled = true;
Game.Hook.DInputForceDisable = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false; //set on true from make Xinput controllers act like DirectInput ones
Game.UseDevReorder = true; //set on true if you use DirectInput controllers
Game.XInputPlusDll = ["xinput1_3.dll", "dinput.dll", "dinput8.dll"];
Game.Hook.CustomDllEnabled = false;
Game.FakeFocus = true;
Game.PreventWindowDeactivation = false;
Game.PauseBetweenStarts = 30;
Game.PromptBetweenInstances = true;
Game.UseDirectX9Wrapper = false;
Game.Hook.CustomDllEnabled = false;
Game.KeepSymLinkOnExit = true;

//		[Multiple Keyboards/Mice lines]

//[thanks to Ilyaki for the multiple keyboards and mice support and guide]
Game.SupportsMultipleKeyboardsAndMice = true; //If enable, it will allow multiple Keyboards and Mice to be used as a device input in Nucleus. Before enable it by default, be sure that all works without problems.

// This will hook the SetCursorPos Windows function which the game may use to set the mouse position.
// This is useful to have on to prevent the game from moving the 'real' Windows mouse cursor around the screen.
Game.HookSetCursorPos = true;
// This will hook the GetCursorPos Windows function which the game may use to get the mouse position.
Game.HookGetCursorPos = true;
// These options hook Windows functions that can be used by the game to detect if keys are down.
// HookGetAsyncKeyState is usually the only one that's needed, but leave the others enabled if there are no problems.
// Some games may conflict with these hooks, so try toggling some of them if keyboard input isn't working properly.
Game.HookGetKeyState = true;
Game.HookGetAsyncKeyState = true;
Game.HookGetKeyboardState = true;
// This filters raw input messages inside the application. This makes sure each instance only receives input for its designated input device.
Game.HookFilterRawInput = true;
// This hook filters many mouse messages to position the mouse cursor and other necessary changes from within the game itself.
// This should almost always be enabled, unless it causes some conflict.
Game.HookFilterMouseMessages = false;
// This is the main switch for legacy input.
Game.HookUseLegacyInput = false;
//Nucleus Coop will hook mouse movement messages and the GetCursorPos function to work around legacy input. Some games only need the GetCursorPos hook and conflict when mouse movement messages are edited. If this is the case, enable this option:
Game.HookDontUpdateLegacyInMouseMsg = false;

Game.HookMouseVisibility = false;

// This will send the game mouse input via Windows messages.
Game.SendNormalMouseInput = true;
// This sends keyboard input via Windows messages. This is usually all that's needed to get keyboard input working.
Game.SendNormalKeyboardInput = true;
// Use this to send scroll wheel events to the game.
// Some games don't need this, if for example they receive scroll wheel data from raw input.
Game.SendScrollWheel = true;
//In some cases, you may need to forward raw mouse input. This is almost never needed as re-register raw input has the same effect with a much more efficient method. Forwarding input forwards raw input from Nucleus Coop to the game. This has a high CPU usage and many input events will not pass, resulting in choppy movement.
Game.ForwardRawMouseInput = false;
// The same as ForwardRawMouseInput, but for keyboards. Again, this should almost never be used instead of re-register raw input.
Game.ForwardRawKeyboardInput = false;
// This will re-register the game for Windows raw input with the option to receive input while not in the foreground.
// This is important as most games will register to receive raw input only when in the foreground.
Game.HookReRegisterRawInput = false;
Game.HookReRegisterRawInputMouse = false;
Game.HookReRegisterRawInputKeyboard = false;
// This enables the fake mouse cursor to be drawn over the game by Nucleus Coop.
// If the game uses a custom cursor, you will probably not need this option. (This will be obvious if you see the games custom cursor and a fake cursor drawn over it).
// Be aware this is a 'fake' mouse cursor in the sense that Nucleus Coop will fake mouse input to the game via the other options and then the fake mouse cursor is drawn where the game should be responding to mouse input.
// The fake cursor is drawn by creating a large transparent window over the game. This may prevent the game from receiving mouse input from the 'real' Windows cursor. It is sometimes useful to disable this while testing.
Game.DrawFakeMouseCursor = false;
// Once you have finished setting up the input options, enable this to automatically lock input (equivalent to pressing End) once all of the instances have been set up.
// This is usually convenient to leave disabled whilst testing.
Game.LockInputAtStart = false;
// If you need to change the key to toggle input lock, e.g. if the game uses the End key, edit it with this.
// You can find a list of keys and their numbers at https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
Game.LockInputToggleKey = 0x23;

Game.Description =
  "Use the horizontal split (vertical crop menu and hud). In DInput mode, XboxOne controllers needs a fix. Open the script for info. When you load the game from Nucleus use always the profile NUCLEUS. Before launching the next instance go to LAN, create a server, in server name write the playername and at the end create a room. Launch the next instance, go to LAN, create a server, in server name write the playername, then search for the room you create before and join in (probably, you will need more than one attempt). When all the players are ready, click ok on the last Nucleus prompt (hook/send fake message). Now you can press 'END' for restrict the input of keyboard/mice players (press it again for release it).";

Game.Play = function() {
  //Create the "scripts" folder inside the NFSMW Nucleus instances content folder
  var filePath = (Context.filePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts"); //the location where a folder named "scripts" will be created
  System.IO.Directory.CreateDirectory(filePath); //What Nucleus will do. Create the directory.
  //Copying the specific files to the NFSMW Nucleus instances content folder from the NFSMW scripts Nucleus folder
  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\buttons-playstation.tpk"); //the location where the specific file will be placed
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "scripts\\buttons-playstation.tpk"); //what file Nucleus will pick from the NFSMW scripts folder
  System.IO.File.Copy(savePkgOrigin, savePath, true); //the action Nucleus will do. Copy the file.
  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\buttons-xbox.tpk");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "scripts\\buttons-xbox.tpk");
  System.IO.File.Copy(savePkgOrigin, savePath, true);
  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMostWanted.WidescreenFix.asi");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "scripts\\NFSMostWanted.WidescreenFix.asi");
  System.IO.File.Copy(savePkgOrigin, savePath, true);
  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMostWanted.WidescreenFix.ini");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "scripts\\NFSMostWanted.WidescreenFix.ini");
  System.IO.File.Copy(savePkgOrigin, savePath, true);
  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\server.cfg");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "server.cfg");
  System.IO.File.Copy(savePkgOrigin, savePath, true);
  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\winmm.dll");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "winmm.dll");
  System.IO.File.Copy(savePkgOrigin, savePath, true);
  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMWExtraOptions.asi");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "scripts\\NFSMWExtraOptions.asi");
  System.IO.File.Copy(savePkgOrigin, savePath, true);
  var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMWHUDAdapter.asi");
  var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "scripts\\NFSMWHUDAdapter.asi");
  System.IO.File.Copy(savePkgOrigin, savePath, true);
  if (!System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMWExtraOptionsSettings.ini")) {
    //if this file is already in the instances folders, Nucleus will not copy the file inside the if{}
    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMWExtraOptionsSettings.ini");
    var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "scripts\\NFSMWExtraOptionsSettings.ini");
    System.IO.File.Copy(savePkgOrigin, savePath, true);
  } //closing the if
  if (!System.IO.Directory.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\1")) {
    //if this directory is already in the instances folders, Nucleus will not copy the files inside the if{}. This will note copy the save file the next time_
    var filePath = (Context.filePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\1\\NFS Most Wanted\\NUCLEUS "); //_you will load the game
    System.IO.Directory.CreateDirectory(filePath);
    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\1\\NFS Most Wanted\\NUCLEUS\\NUCLEUS");
    var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "1\\NUCLEUS");
    System.IO.File.Copy(savePkgOrigin, savePath, true);
    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\1\\NFS Most Wanted\\NUCLEUS\\SPARKLE-2012270-09-26-17-32-36.SAV");
    var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "1\\SPARKLE-2012270-09-26-17-32-36.SAV");
    System.IO.File.Copy(savePkgOrigin, savePath, true);
    var savePath = (Context.SavePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\1\\NFS Most Wanted\\Settings.ini");
    var savePkgOrigin = System.IO.Path.Combine(Game.Folder, "Settings.ini");
    System.IO.File.Copy(savePkgOrigin, savePath, true);
  } //closing the if

  var LocalIP = Context.User.GetLocalIP(); //this will get the user local IP

  var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\server.cfg";
  Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
    new Nucleus.IniSaveInfo("SERVER", "PORT", 9900 + Context.PlayerID),
    new Nucleus.IniSaveInfo("SERVER", "LAN_THROTTLE", "6"), //For connection ralated problems, this is the only number you should edit.
    new Nucleus.IniSaveInfo("SERVER", "ADDR", '%%bind("' + LocalIP + ":" + (9900 + Context.PlayerID) + '")'),
    new Nucleus.IniSaveInfo("SERVER", "TRUST_MATCH", '%%bind("' + LocalIP + '")')
  ]);

  var gpu = Context.Options["GPU"]; //this is what happens on the "Use old GPU compatible mode?" option. Basically it jus edit a ini file depending by the choice
  var res = Context.Options["Res"];

  if (gpu == "No") {
    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMostWanted.WidescreenFix.ini";
    Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [new Nucleus.IniSaveInfo("MAIN", "ResX", Context.Width), new Nucleus.IniSaveInfo("MAIN", "ResY", Context.Height)]); //this will automatically edit the ini file using the context screen division_
  } //_resolution XY selected by the user
  if (gpu == "Yes") {
    if (res == "640x480") {
      var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMostWanted.WidescreenFix.ini";
      Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [new Nucleus.IniSaveInfo("MAIN", "ResX", " 640"), new Nucleus.IniSaveInfo("MAIN", "ResY", " 480")]);
    }
    if (res == "800x600") {
      var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMostWanted.WidescreenFix.ini";
      Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [new Nucleus.IniSaveInfo("MAIN", "ResX", " 800"), new Nucleus.IniSaveInfo("MAIN", "ResY", " 600")]);
    }
    if (res == "1024x768") {
      var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMostWanted.WidescreenFix.ini";
      Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [new Nucleus.IniSaveInfo("MAIN", "ResX", " 1024"), new Nucleus.IniSaveInfo("MAIN", "ResY", " 768")]);
    }
    if (res == "1280x960") {
      var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMostWanted.WidescreenFix.ini";
      Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [new Nucleus.IniSaveInfo("MAIN", "ResX", " 1280"), new Nucleus.IniSaveInfo("MAIN", "ResY", " 960")]);
    }
    if (res == "1280x1024") {
      var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMostWanted.WidescreenFix.ini";
      Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [new Nucleus.IniSaveInfo("MAIN", "ResX", " 1280"), new Nucleus.IniSaveInfo("MAIN", "ResY", " 1024")]);
    }
  }
  var intro = Context.Options["Intro"]; //this is what happens on the "Skip intro?" option. Basically it jus edit a ini file depending by the choice.
  if (intro == "Yes") {
    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMWExtraOptionsSettings.ini";
    Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
      new Nucleus.IniSaveInfo("Misc", "SkipMovies", " 1") //this skip the cutscenes. Set on 0 to enable them. This could help if the game crash at the start
    ]);
  }
  if (intro == "No") {
    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMWExtraOptionsSettings.ini";
    Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [
      new Nucleus.IniSaveInfo("Misc", "SkipMovies", " 0") //this skip the cutscenes. Set on 0 to enable them. This could help if the game crash at the start
    ]);
  }

  if (Context.PlayerID == 0) {
    //this is what Nucleus will do for the first player
    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMWExtraOptionsSettings.ini";
    Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [new Nucleus.IniSaveInfo("Misc", "WindowedMode", "2"), new Nucleus.IniSaveInfo("Misc", "EnableMusic", "1")]);
  } else {
    var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\scripts\\NFSMWExtraOptionsSettings.ini";
    Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [new Nucleus.IniSaveInfo("Misc", "WindowedMode", "2"), new Nucleus.IniSaveInfo("Misc", "EnableMusic", "0")]);
  }

  if (System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Dinput8.dll")) {
    System.IO.File.Delete(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Dinput8.dll");
  }
  if (System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Dinput.dll")) {
    System.IO.File.Delete(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Dinput.dll");
  }

  var NucleusRoot = System.IO.Path.Combine(Game.Folder, "..", "..");
  var ContentRoot = System.IO.Directory.GetParent(Context.GetFolder(Nucleus.Folder.InstancedGameFolder));

  var pad = Context.Options["Pad"];

  if (pad == "XInput") {
    if (System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\devreorder.ini")) {
      System.IO.File.Delete(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\devreorder.ini");
    }

    System.IO.File.Copy(NucleusRoot + "\\utils\\XInputPlus\\x86\\Dinput8.dl_", Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Dinput8.dll", true);
    System.IO.File.Copy(NucleusRoot + "\\utils\\XInputPlus\\x86\\Dinput.dl_", Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Dinput.dll", true);

    /*
	  var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\XinputPlus.ini";  //if you have deadzone problems, enable this lines (for xinput controllers). Nucleus will edit the XinputPlus.ini file for each instance.
	  Context.ModifySaveFile(savePath, savePath, Nucleus.SaveType.INI, [                         // remove the /* * / for enable it
	  new Nucleus.IniSaveInfo("LeftStick", "DeadZone", "3277"),
	  new Nucleus.IniSaveInfo("RightStick", "DeadZone", "3277"),
	  ]);
	   */
  } else if (pad == "DInput") {
    if (System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\XinputPlus.ini")) {
      System.IO.File.Delete(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\XinputPlus.ini");
    }

    if (System.IO.File.Exists(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Xinput1_3.dll")) {
      System.IO.File.Delete(Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\Xinput1_3.dll");
    }

    System.IO.File.Copy(NucleusRoot + "\\utils\\devreorder\\x86\\dinput8.dll", Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\dinput8.dll", true);
  }
};