Postal 2: Share the Pain

From LANCommander
Revision as of 00:47, 22 February 2024 by DoctorDalek (talk | contribs) (Created new page for Postal 2: Share the Pain)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Developers
Running with Scissors
Publishers
Whiptail Interactive
Release Date
Windows: December 17, 2003
Genres
Shooter
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play Postal 2: Share the Pain {InstallDir}\System\Postal2MP.exe True

Install Script

# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
$Display = Get-PrimaryDisplay

$X = $Display.Bounds.Width
$Y = $Display.Bounds.Height
$FOV = 90

Write-ReplaceContentInFile -Pattern 'StartupFullscreen=(.+)' -Substitution "StartupFullscreen=True" -FilePath "$InstallDirectory\ShareThePain\System\Default.ini"
Write-ReplaceContentInFile -Pattern 'WindowedViewportX=(.+)' -Substitution "WindowedViewportX=$X" -FilePath "$InstallDirectory\ShareThePain\System\Default.ini"
Write-ReplaceContentInFile -Pattern 'WindowedViewportY=(.+)' -Substitution "WindowedViewportY=$Y" -FilePath "$InstallDirectory\ShareThePain\System\Default.ini"
Write-ReplaceContentInFile -Pattern 'FullscreenViewportX=(.+)' -Substitution "FullscreenViewportX=$X" -FilePath "$InstallDirectory\ShareThePain\System\Default.ini"
Write-ReplaceContentInFile -Pattern 'FullscreenViewportY=(.+)' -Substitution "FullscreenViewportY=$Y" -FilePath "$InstallDirectory\ShareThePain\System\Default.ini"
Write-ReplaceContentInFile -Pattern 'MenuViewportX=(.+)' -Substitution "MenuViewportX=$X" -FilePath "$InstallDirectory\ShareThePain\System\Default.ini"
Write-ReplaceContentInFile -Pattern 'MenuViewportY=(.+)' -Substitution "MenuViewportY=$Y" -FilePath "$InstallDirectory\ShareThePain\System\Default.ini"

Write-ReplaceContentInFile -Pattern 'StartupFullscreen=(.+)' -Substitution "StartupFullscreen=True" -FilePath "$InstallDirectory\ShareThePain\System\Postal2MP.ini"
Write-ReplaceContentInFile -Pattern 'WindowedViewportX=(.+)' -Substitution "WindowedViewportX=$X" -FilePath "$InstallDirectory\ShareThePain\System\Postal2MP.ini"
Write-ReplaceContentInFile -Pattern 'WindowedViewportY=(.+)' -Substitution "WindowedViewportY=$Y" -FilePath "$InstallDirectory\ShareThePain\System\Postal2MP.ini"
Write-ReplaceContentInFile -Pattern 'FullscreenViewportX=(.+)' -Substitution "FullscreenViewportX=$X" -FilePath "$InstallDirectory\ShareThePain\System\Postal2MP.ini"
Write-ReplaceContentInFile -Pattern 'FullscreenViewportY=(.+)' -Substitution "FullscreenViewportY=$Y" -FilePath "$InstallDirectory\ShareThePain\Postal2MP\Postal2MP.ini"
Write-ReplaceContentInFile -Pattern 'MenuViewportX=(.+)' -Substitution "MenuViewportX=$X" -FilePath "$InstallDirectory\ShareThePain\System\Postal2MP.ini"

if (($X / $Y) -eq (16 / 9)) {
    $FOV = 106
} elseif (($X / $Y) -eq (16 / 10)) {
    $FOV = 100
}

Write-ReplaceContentInFile -Pattern '^DesiredFOV=(.+)' -Substitution "DesiredFOV=$FOV" -FilePath "$InstallDirectory\System\DeusEx.ini"
Write-ReplaceContentInFile -Pattern '^DefaultFOV=(.+)' -Substitution "DefaultFOV=$FOV" -FilePath "$InstallDirectory\System\DeusEx.ini"

Name Change Script

Write-ReplaceContentInFile -Pattern 'Name=(.+)' -Substitution "Name=$NewPlayerAlias" -FilePath "$InstallDirectory\System\Default.ini"
Write-ReplaceContentInFile -Pattern 'Name=(.+)' -Substitution "Name=$NewPlayerAlias" -FilePath "$InstallDirectory\System\User.ini"
Write-ReplaceContentInFile -Pattern 'Name=(.+)' -Substitution "Name=$NewPlayerAlias" -FilePath "$InstallDirectory\System\Postal2MP.ini"