Doom II: Hell on Earth

From LANCommander
Revision as of 02:09, 6 January 2024 by DoctorDalek (talk | contribs) (Created new page for Doom II: Hell on Earth)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Developers
id Software
Publishers
Virgin Interactive Entertainment (Europe) Ltd.Imagineerid SoftwareTapwaveGT Interactive SoftwareBethesda Softworks
Release Date
Windows: September 30, 1994
Genres
PuzzleShooter
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play Coop {InstallDir}\Doom2.bat True
Play Deathmatch {InstallDir}\Doom2_dm.bat True

Install Script

#Updates bat file launchers to the server address and correct ports
######################################################################
$LauncherCoop = "$InstallDirectory\Doom2.bat"
$LauncherDM = "$InstallDirectory\Doom2_dm.bat"
$uri = New-Object System.Uri($ServerAddress)
$Server = $uri.Host
$Server_COOP = $Server + ":10668"
$Server_DM = $Server + ":10669"
# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^zandronum.exe -connect (.+)' -Substitution "zandronum.exe -connect ""$Server_COOP"" -iwad ""doom2.wad""" -FilePath "$LauncherCoop"
Write-ReplaceContentInFile -Pattern '^zandronum.exe -connect (.+)' -Substitution "zandronum.exe -connect ""$Server_DM"" -iwad ""doom2.wad""" -FilePath -FilePath "$LauncherDM"
#######################################################################

#Updates Screen Resolution to match desktop resolution
#######################################################################
$Username=$env:username
$Config = "$InstallDirectory\zandronum-$Username.ini"
Copy-Item -Path "$InstallDirectory\zandronum.ini" -Destination "$Config" -Recurse

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

# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^con_virtualheight=(.+)' -Substitution "con_virtualheight=$($Display.Bounds.Height)" -FilePath "$Config"
Write-ReplaceContentInFile -Pattern '^con_virtualwidth=(.+)' -Substitution "con_virtualwidth=$($Display.Bounds.Width)" -FilePath "$Config"
Write-ReplaceContentInFile -Pattern '^vid_defheight=(.+)' -Substitution "vid_defheight=$($Display.Bounds.Height)" -FilePath "$Config"
Write-ReplaceContentInFile -Pattern '^vid_defwidth=(.+)' -Substitution "vid_defwidth=$($Display.Bounds.Width)" -FilePath "$Config"
#######################################################################

Name Change Script

#Updates name= to the player who is on lan commander
#######################################################################
$Username=$env:username
$Config = "$InstallDirectory\zandronum-$Username.ini"
Write-ReplaceContentInFile -Pattern '^name=(.+)' -Substitution "name=$NewPlayerAlias" -FilePath "$Config"
#######################################################################