Medal of Honor: Allied Assault: Difference between revisions

From LANCommander
No edit summary
No edit summary
 
Line 5: Line 5:
{{Game.InfoBox.Developer|2015}}
{{Game.InfoBox.Developer|2015}}
|Publishers =
|Publishers =
{{Game.InfoBox.Publisher|icculus.org}}
{{Game.InfoBox.Publisher|icculus.org}}{{Game.InfoBox.Publisher|Electronic Arts}}{{Game.InfoBox.Publisher|Aspyr Media}}
{{Game.InfoBox.Publisher|Electronic Arts}}
{{Game.InfoBox.Publisher|Aspyr Media}}
|Release Date =
|Release Date =
{{Game.InfoBox.ReleaseDate|Windows|January 22, 2002}}
{{Game.InfoBox.ReleaseDate|Windows|January 22, 2002}}
|Genres =
|Genres =
{{Game.InfoBox.Genre|Shooter}}
{{Game.InfoBox.Genre|Shooter}}
| PCGamingWiki = Medal_of_Honor:_Allied_Assault
|PCGamingWiki = Medal_of_Honor:_Allied_Assault}}
}}


{{Game.ActionBox
{{Game.ActionBox
|Actions =  
|Actions =  
{{Game.ActionBox.Row|Name = Play Medal of Honor: Allied Assault|Path = MOHAA.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play Medal of Honor: Allied Assault|Path = {InstallDir}\MOHAA.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play Medal of Honor: Allied Assault: Breakthrough|Path = moh_breakthrough.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play Medal of Honor: Allied Assault: Breakthrough|Path = {InstallDir}\moh_breakthrough.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play Medal of Honor: Allied Assault: Spearhead|Path = moh_spearhead.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play Medal of Honor: Allied Assault: Spearhead|Path = {InstallDir}\moh_spearhead.exe|Arguments = |WorkingDirectory = |Primary = True}}
}}
}}


{{Game.Scripts.NameChange
 
|Name = Name Change Script
{{Game.Scripts.Install
|Name = Install Script
|Description =  
|Description =  
|RequiresAdmin = False
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
$NewName = $args[0]
<syntaxhighlight lang="powershell" line>
$InstallDir = $PSScriptRoot
$Display = Get-PrimaryDisplay


function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
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"
     $content = (Get-Content $FilePath) -replace $Regex, $Replacement
Write-ReplaceContentInFile -Pattern '^seta r_mode "(.+)"' -Substitution "seta r_mode ""-1""" -FilePath "$InstallDirectory\main\configs\unnamedsoldier.cfg"
     [IO.File]::WriteAllLines($FilePath, $content)
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
}
}


Write-ReplaceContentInFile -Regex 'seta name (.+)' -Replacement "seta name ""$NewName""" -FilePath "$InstallDir\main\configs\unnamedsoldier.cfg"
# Patch gamex86.dll to use correct FOV
Write-ReplaceContentInFile -Regex 'seta name (.+)' -Replacement "seta name ""$NewName""" -FilePath "$InstallDir\mainta\configs\unnamedsoldier.cfg"
Edit-PatchBinary -FilePath "$InstallDirectory\main\gamex86.dll" -Offset 0xA10A6 -Data ([byte[]]@( $FOV ))
Write-ReplaceContentInFile -Regex 'seta name (.+)' -Replacement "seta name ""$NewName""" -FilePath "$InstallDir\maintt\configs\unnamedsoldier.cfg"
Edit-PatchBinary -FilePath "$InstallDirectory\mainta\gamex86.dll" -Offset 0xE7836 -Data ([byte[]]@( $FOV ))
Edit-PatchBinary -FilePath "$InstallDirectory\maintt\gamex86.dll" -Offset 0xEEB06 -Data ([byte[]]@( $FOV ))
</syntaxhighlight>
}}
           
{{Game.Scripts.NameChange
|Name = Name Change Script
|Description =
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
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"
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Latest revision as of 03:29, 6 January 2024

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"