Max Payne 3: The Complete Edition · handler “Max Payne 3: The Complete Edition”
Version 3
Release notes
Updated downgrader patch to work with v272
- Released
- Size
- 5.9 MB
- Downloads
- 309
- Check
- Verified
- SHA-256
- 9d7fb092eaf7c95e2b389a7dae9dd3ef398cd9a13939637e0413431b29d415d8
Files 28
| Path | Size |
|---|---|
| Max Payne 3/common/movies/mp3_logo_bink_pt01.bik | 468 B |
| Max Payne 3/common/movies/mp3_logo_bink_pt02.bik | 468 B |
| Max Payne 3/common/movies/mp3_logo_bink_pt03.bik | 468 B |
| Max Payne 3/common/movies/mp3_payne_pill_rockstar_logo.bik | 468 B |
| Max Payne 3/downgrade.xdelta | 3.5 MB |
| Max Payne 3/Goldberg SocialClub Emu Saves/Max Payne 3/0F74F4C4/MP3_LOADOUT | 13 KB |
| Max Payne 3/Goldberg SocialClub Emu Saves/Max Payne 3/0F74F4C4/MP3_PLAYERCUSTOM | 35 KB |
| Max Payne 3/Goldberg SocialClub Emu Saves/Max Payne 3/0F74F4C4/MP3_PROGRESSION | 63 KB |
| Max Payne 3/Goldberg SocialClub Emu Saves/Max Payne 3/0F74F4C4/MP3_PROG_BACKUP | 63 KB |
| Max Payne 3/Goldberg SocialClub Emu Saves/Max Payne 3/0F74F4C4/MP3_STATS | 63 KB |
| Max Payne 3/Goldberg SocialClub Emu Saves/settings/account_name.txt | 9 B |
| Max Payne 3/Goldberg SteamEmu Saves/settings/account_name.txt | 9 B |
| Max Payne 3/graphics.xml | 535 B |
| Max Payne 3/scripthook/dinput8.dll | 200 KB |
| Max Payne 3/scripthook/ScriptHook.dll | 941 KB |
| Max Payne 3/scripthook/Trainer.asi | 277 KB |
| Max Payne 3/scripthook/Trainer.ini | 237 B |
| Max Payne 3/socialclub.dll | 391 KB |
| Max Payne 3/socialclub.ini | 750 B |
| Max Payne 3/steam_api.dll | 2.2 MB |
| Max Payne 3/steam_api.ini | 2.1 KB |
| Max Payne 3/steam_interfaces.txt | 357 B |
| Max Payne 3/steam_settings/disable_networking.txt | 71 B |
| Max Payne 3/steam_settings/disable_overlay.txt | 0 B |
| Max Payne 3/steam_settings/load_dlls/launc.dll | 189 KB |
| Max Payne 3/steam_settings/steam_appid.txt | 6 B |
| Max Payne 3/xdelta.exe | 610 KB |
| handler.js | 10 KB |
handler.js
Plain textHub.Handler.Version = 3; // Released at https://hub.splitscreen.me/ on Thu Feb 08 2024 02:08:59 GMT+0000 (Coordinated Universal Time).
Hub.Handler.Id = "yD93rAKiBNpPZkrrB";
Hub.Maintainer.Name = "happyexpress";
Hub.Maintainer.Id = "yasq5hW6LH5sjwQty";
Game.Description =
"For the latest Complete Edition Steam version of Max Payne 3. \n" +
"Gamepads only. \n" +
"Your game must be installed outside C:\\Users\\. \n" +
"This script will generate Windows user accounts for each player. \n" +
"You can remove them by pressing Windows key and searching 'Add, Edit, or Remove Other Users'. \n" +
"\n" +
"Steps: \n" +
"Run Nucleus as Administrator. \n" +
//"I recommend you check 'Keep Nucleus Accounts' in your Nucleus settings. \n" +
// "Run the handler and click OK on the prompt window each time an instance starts \n" +
// "(You may need to Alt+Tab to the prompt). \n" +
"Player 1 should go to Multiplayer -> LAN -> Select Gamemode to start a lobby. \n" +
"Other players can then go to Multiplayer -> LAN -> Select Gamemode to join. \n" +
"If you want to use Free Aim instead of Soft Lock, go to the Select Gamemode screen \n" +
"and press X to switch. Everyone else must do the same to join your lobby. \n" +
"\n" +
"Unlock all mod: https://drive.google.com/file/d/19_r1zDUBR-L5bjkAccdFGTyRo8AbLiuj/view?usp=drivesdk \n" +
"Hide enemy nametags and healthbars mod: https://drive.google.com/file/d/1e6of9RNzO84Oxhg00tg-OTPkcu6Ji12D/view?usp=drivesdk";
Game.FileSymlinkExclusions = ["MaxPayne3.exe", "steam_api.dll", "socialclub.dll"];
Game.GameName = "Max Payne 3";
Game.HandlerInterval = 100;
Game.SupportsKeyboard = false;
//Game.KeyboardPlayerFirst = true;
Game.SymlinkExe = false;
Game.SymlinkGame = true;
Game.SymlinkFolders = false;
Game.GUID = "Max Payne 3";
Game.ExecutableName = "MaxPayne3.exe";
Game.MaxPlayers = 16;
Game.MaxPlayersOneMonitor = 16;
Game.Hook.DInputEnabled = false;
Game.Hook.XInputEnabled = true;
Game.Hook.XInputReroute = false;
Game.Hook.CustomDllEnabled = false;
Game.InjectHookXinput = true;
Game.FakeFocus = true;
Game.FakeFocusInterval = 10000;
Game.HookFocus = true;
Game.SetWindowHook = true;
Game.PauseBetweenStarts = 20;
Game.PauseBetweenProcessGrab = 20;
Game.ThirdPartyLaunch = true;
Game.RequiresAdmin = true;
Game.IgnoreThirdPartyPrompt = true;
var answers = ["Yes", "No"];
Game.AddOption(
"Downgrade the EXE?",
"The EXE will be downgraded from v272 to v216 (this won't touch the EXE in your root game install folder). \n" + "If you already have v216 and it's non-RGL, select 'No'.",
"Downgrade",
answers
);
Game.Play = function() {
var accountName = "MaxPayne3Player" + (Context.PlayerID + 1);
var downgrade = Context.Options["Downgrade"] == "Yes";
var uniqueUser = true; //Context.Options["UniqueUser"] == "Yes";
if (uniqueUser) {
// Execute a powershell script to manually create a distinct user to run this instance
var psScriptFile = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\createuser.ps1";
const psScript = [
"$UserExists = Get-WmiObject -Class Win32_UserAccount -Filter \"Name='" + accountName + "'\"; ",
" ",
"if (-not $UserExists) { ",
" # Create the user account without a password ",
' New-LocalUser -Name "' + accountName + '" -Password (ConvertTo-SecureString "12345" -AsPlainText -Force) -PasswordNeverExpires; ',
" ",
" # Add the user to the Administrators group ",
' Add-LocalGroupMember -Group "Administrators" -Member "' + accountName + '"; ',
" ",
' $UserName = "' + accountName + '" ',
' $Password = ConvertTo-SecureString "12345" -AsPlainText -Force ',
" $Credential = New-Object System.Management.Automation.PSCredential ($UserName, $Password) ",
" ",
" # Run a program as the user to generate the user data ",
' Start-Process -FilePath "cmd.exe" -ArgumentList "/C exit" -Credential $Credential ',
" ",
" Write-Host \"User account '" + accountName + "' created and added to the Administrators group.\"; ",
"} else { ",
" Write-Host \"User account '" + accountName + "' already exists.\"; ",
"} "
];
var cmd = '%SystemRoot%\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy RemoteSigned -command ".\\createuser.ps1"; '; //PAUSE;";
var cmdFile = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\createuser.bat";
Context.WriteTextFile(psScriptFile, psScript);
Context.WriteTextFile(cmdFile, [cmd]);
Context.RunAdditionalFiles(["all|" + cmdFile], false, 5, true, false);
Context.Wait(2000);
}
const copiedFiles = ["socialclub.dll", "socialclub.ini", "steam_api.dll", "steam_api.ini", "steam_interfaces.txt", "downgrade.xdelta", "xdelta.exe"];
for (let index = 0; index < copiedFiles.length; ++index) {
const fileName = copiedFiles[index];
var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\" + fileName;
var savePkgOrigin = System.IO.Path.Combine(Game.Folder, fileName);
System.IO.File.Copy(savePkgOrigin, savePath, true);
}
// var bat = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\steam_settings.bat";
// var lines = ['xcopy /E /I /Y "' + Game.Folder + "\\steam_settings" + '" "' + Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\steam_settings" + '" '];
// Context.WriteTextFile(bat, lines);
// Context.RunAdditionalFiles(["all|" + bat], false, 5);
var bat = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\copyFolders.bat";
var lines = [
'xcopy /E /I /Y "' + Game.Folder + "\\steam_settings" + '" "' + Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\steam_settings" + '" ',
'xcopy /E /I /Y "' + Game.Folder + "\\common" + '" "' + Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\common" + '" '
];
Context.WriteTextFile(bat, lines);
Context.RunAdditionalFiles(["all|" + bat], false, 0, true, false);
// Player nicknames
var path = Game.Folder + "\\Goldberg SocialClub Emu Saves\\settings\\account_name.txt";
var lines = ["1|" + Context.Nickname];
Context.ReplaceLinesInTextFile(path, lines);
var path = Game.Folder + "\\Goldberg SteamEmu Saves\\settings\\account_name.txt";
var lines = ["1|" + Context.Nickname];
Context.ReplaceLinesInTextFile(path, lines);
var appdata = uniqueUser ? "C:\\Users\\" + accountName + "\\AppData\\Roaming" : Context.NucleusUserRoot + "\\AppData\\Roaming";
var documents = uniqueUser ? "C:\\Users\\" + accountName + "\\Documents" : Context.NucleusUserRoot + "\\Documents";
if (!System.IO.Directory.Exists(appdata + "\\Goldberg SocialClub Emu Saves\\Max Payne 3")) {
// If this folder doesn't exist, we can assume first time setup needs to be done
var bat = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\copysaves.bat";
var lines = [
'xcopy /E /I /Y "' + Game.Folder + "\\Goldberg SocialClub Emu Saves" + '" "' + appdata + "\\Goldberg SocialClub Emu Saves" + '"',
'xcopy /E /I /Y "' + Game.Folder + "\\Goldberg SteamEmu Saves" + '" "' + appdata + "\\Goldberg SteamEmu Saves" + '"',
uniqueUser
? 'xcopy "' +
Game.Folder +
"\\graphics.xml" + //Guarantees the instance launches in windowed mode
'" "' +
documents +
"\\Rockstar Games\\Max Payne 3\\" +
'"'
: ""
];
Context.WriteTextFile(bat, lines);
Context.RunAdditionalFiles(["all|" + bat], false, 5);
Context.Wait(2000);
}
var savePath = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\MaxPayne3Old.exe";
var savePkgOrigin = Context.RootInstallFolder + "\\MaxPayne3.exe";
System.IO.File.Copy(savePkgOrigin, savePath, true);
var psScriptFile = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\start.ps1";
if (uniqueUser) {
// Execute a powershell script to run Max Payne 3 through ForceBindIP
const psScript = [
"$ForceBindIPPath = '" + Context.NucleusFolder + "\\utils\\ForceBindIP\\ForceBindIP.exe'; ",
"$ProgramPath = '" + Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\MaxPayne3.exe'; ",
"if (-Not (Test-Path -Path $ProgramPath -PathType Leaf)) { ",
' [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms"); ',
' [System.Windows.Forms.MessageBox]::Show("EXE not found! Are you sure you have the latest legit Steam version?"); ',
" Exit; ",
"} ",
"$IPAddress = '127.0.0." + (Context.PlayerID + 1) + "'; ",
"$UserName = '" + accountName + "'; ",
"$Password = ConvertTo-SecureString '12345' -AsPlainText -Force; ",
"$Credential = New-Object System.Management.Automation.PSCredential ($UserName, $Password); ",
'Start-Process -FilePath $ForceBindIPPath -ArgumentList " -i $IPAddress `"$ProgramPath`" " -Credential $Credential; '
];
} else {
}
var cmdFile = Context.GetFolder(Nucleus.Folder.InstancedGameFolder) + "\\start.bat";
var downgradeCmd = downgrade
? [
"(xdelta.exe -d -s MaxPayne3Old.exe downgrade.xdelta MaxPayne3.exe);", // Downgrade to an older version
'IF %ERRORLEVEL% NEQ 0 (%SystemRoot%\\Sysnative\\msg.exe * "EXE downgrade failed! Are you sure you have the latest legit Steam version?");'
]
: [];
var startCmd = ['%SystemRoot%\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy RemoteSigned -command ".\\start.ps1"; ']; //PAUSE;"];
Context.WriteTextFile(psScriptFile, psScript);
Context.WriteTextFile(cmdFile, downgradeCmd.concat(startCmd));
Context.RunAdditionalFiles(["all|" + cmdFile], false, 5, true, false);
};