Medal of Honor: Allied Assault

From LANCommander
Revision as of 03:29, 6 January 2024 by DoctorDalek (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Developers
2015
Publishers
icculus.orgElectronic ArtsAspyr Media
Release Date
Windows: January 22, 2002
Genres
Shooter
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play Medal of Honor: Allied Assault {InstallDir}\MOHAA.exe True
Play Medal of Honor: Allied Assault: Breakthrough {InstallDir}\moh_breakthrough.exe True
Play Medal of Honor: Allied Assault: Spearhead {InstallDir}\moh_spearhead.exe True

Install Script

$Display = Get-PrimaryDisplay

Write-ReplaceContentInFile -Pattern '^seta r_customwidth "(.+)"' -Substitution "seta r_customwidth ""$($Display.Bounds.Width)""" -FilePath "$InstallDirectory\main\configs\unnamedsoldier.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customheight "(.+)"' -Substitution "seta r_customheight ""$($Display.Bounds.Height)""" -FilePath "$InstallDirectory\main\configs\unnamedsoldier.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_mode "(.+)"' -Substitution "seta r_mode ""-1""" -FilePath "$InstallDirectory\main\configs\unnamedsoldier.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customwidth "(.+)"' -Substitution "seta r_customwidth ""$($Display.Bounds.Width)""" -FilePath "$InstallDirectory\mainta\configs\unnamedsoldier.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customheight "(.+)"' -Substitution "seta r_customheight ""$($Display.Bounds.Height)""" -FilePath "$InstallDirectory\mainta\configs\unnamedsoldier.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_mode "(.+)"' -Substitution "seta r_mode ""-1""" -FilePath "$InstallDirectory\mainta\configs\unnamedsoldier.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customwidth "(.+)"' -Substitution "seta r_customwidth ""$($Display.Bounds.Width)""" -FilePath "$InstallDirectory\maintt\configs\unnamedsoldier.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customheight "(.+)"' -Substitution "seta r_customheight ""$($Display.Bounds.Height)""" -FilePath "$InstallDirectory\maintt\configs\unnamedsoldier.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_mode "(.+)"' -Substitution "seta r_mode ""-1""" -FilePath "$InstallDirectory\maintt\configs\unnamedsoldier.cfg"

# Determine the correct FOV
$FOV = 0xA0

if (($Display.Bounds.Width / $Display.Bounds.Height) -eq (16 / 9)) {
    $FOV = 0xBE
} elseif (($Display.Bounds.Width / $Display.Bounds.Height) -eq (16 / 10)) {
    $FOV = 0xB4
} elseif (($Display.Bounds.Width / $Display.Bounds.Height) -eq (21 / 9)) {
    $FOV = 0xF0
} elseif (($Display.Bounds.Width / $Display.Bounds.Height) -eq (32 / 9)) {
    $FOV = 0xF0
}

# Patch gamex86.dll to use correct FOV
Edit-PatchBinary -FilePath "$InstallDirectory\main\gamex86.dll" -Offset 0xA10A6 -Data ([byte[]]@( $FOV ))
Edit-PatchBinary -FilePath "$InstallDirectory\mainta\gamex86.dll" -Offset 0xE7836 -Data ([byte[]]@( $FOV ))
Edit-PatchBinary -FilePath "$InstallDirectory\maintt\gamex86.dll" -Offset 0xEEB06 -Data ([byte[]]@( $FOV ))

Name Change Script

Write-ReplaceContentInFile -Pattern 'seta name (.+)' -Substitution "seta name ""$NewPlayerAlias""" -FilePath "$InstallDirectory\main\configs\unnamedsoldier.cfg"
Write-ReplaceContentInFile -Pattern 'seta name (.+)' -Substitution "seta name ""$NewPlayerAlias""" -FilePath "$InstallDirectory\mainta\configs\unnamedsoldier.cfg"
Write-ReplaceContentInFile -Pattern 'seta name (.+)' -Substitution "seta name ""$NewPlayerAlias""" -FilePath "$InstallDirectory\maintt\configs\unnamedsoldier.cfg"