Deus Ex: Difference between revisions

From LANCommander
No edit summary
No edit summary
 
Line 5: Line 5:
{{Game.InfoBox.Developer|Ion Storm}}
{{Game.InfoBox.Developer|Ion Storm}}
|Publishers =
|Publishers =
{{Game.InfoBox.Developer|Eidos Interactive}}{{Game.InfoBox.Developer|Aspyr Media}}
{{Game.InfoBox.Publisher|Eidos Interactive}}{{Game.InfoBox.Publisher|Aspyr Media}}
|Release Date =
|Release Date =
{{Game.InfoBox.ReleaseDate|Windows|June 26, 2000}}
{{Game.InfoBox.ReleaseDate|Windows|June 26, 2000}}
Line 24: Line 24:
|Contents =
|Contents =
<syntaxhighlight lang="powershell" line>
<syntaxhighlight lang="powershell" line>
# Define the path to the autoexec.cfg file
$Display = Get-PrimaryDisplay
$filePath = "$InstallDirectory\System\DeusEx.ini"


# Get the screen resolution
$X = $Display.Bounds.Width
Add-Type -AssemblyName System.Windows.Forms
$Y = $Display.Bounds.Height
$screen = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Size
$width = $screen.Width
$height= $screen.Height


# Read the content of the file
$FOV = 75
$content = Get-Content -Path $filePath


# Loop through each line in the file
Write-ReplaceContentInFile -Pattern '^FullscreenViewportX=(.+)' -Substitution "FullscreenViewportX=$($Display.Bounds.Width)" -FilePath "$InstallDirectory\System\DeusEx.ini"
for ($i = 0; $i -lt $content.Count; $i++) {
Write-ReplaceContentInFile -Pattern '^FullscreenViewportY=(.+)' -Substitution "FullscreenViewportY=$($Display.Bounds.Height)" -FilePath "$InstallDirectory\System\DeusEx.ini"
    $line = $content[$i]


    # Check if the line contains "SCREENWIDTH" and "640"
if (($X / $Y) -eq (16 / 9)) {
    if ($line -like '*FullscreenViewportX*') {
    $FOV = 90
        # Replace the line with the updated width
} elseif (($X / $Y) -eq (16 / 10)) {
        $content[$i] = "FullscreenViewportX=$width"
    $FOV = 85
    }
        if ($line -like '*FullscreenViewportY*') {
        # Replace the line with the updated width
        $content[$i] = "FullscreenViewportY=$height"
    }
}
}


# Save the updated content back to the file
Write-ReplaceContentInFile -Pattern '^DesiredFOV=(.+)' -Substitution "DesiredFOV=$FOV.000000" -FilePath "$InstallDirectory\System\DeusEx.ini"
$content | Set-Content -Path $filePath
Write-ReplaceContentInFile -Pattern '^DefaultFOV=(.+)' -Substitution "DefaultFOV=$FOV.000000" -FilePath "$InstallDirectory\System\DeusEx.ini"
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Latest revision as of 00:41, 22 February 2024

Developers
Ion Storm
Publishers
Eidos InteractiveAspyr Media
Release Date
Windows: June 26, 2000
Genres
AdventureShooterRole-playing (RPG)
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play DeusEx.exe {InstallDir}/System True

Install Script

$Display = Get-PrimaryDisplay

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

$FOV = 75

Write-ReplaceContentInFile -Pattern '^FullscreenViewportX=(.+)' -Substitution "FullscreenViewportX=$($Display.Bounds.Width)" -FilePath "$InstallDirectory\System\DeusEx.ini"
Write-ReplaceContentInFile -Pattern '^FullscreenViewportY=(.+)' -Substitution "FullscreenViewportY=$($Display.Bounds.Height)" -FilePath "$InstallDirectory\System\DeusEx.ini"

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

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

Name Change Script

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