Doom 3: Difference between revisions

From LANCommander
(Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|id Software}} |Publishers = {{Game.InfoBox.Publisher|Activision}} {{Game.InfoBox.Publisher|Aspyr Media}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|August 3, 2004}} |Genres = {{Game.InfoBox.Genre|Shooter}} | PCGamingWiki = Doom_3 }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play Doom 3|Path = dhewm3.exe|Arguments = |WorkingDirectory = |Primary = True}} {{Ga...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
{{Game.InfoBox.Developer|id Software}}
{{Game.InfoBox.Developer|id Software}}
|Publishers =
|Publishers =
{{Game.InfoBox.Publisher|Activision}}
{{Game.InfoBox.Publisher|Activision}}{{Game.InfoBox.Publisher|Aspyr Media}}
{{Game.InfoBox.Publisher|Aspyr Media}}
|Release Date =
|Release Date =
{{Game.InfoBox.ReleaseDate|Windows|August 3, 2004}}
{{Game.InfoBox.ReleaseDate|Windows|August 3, 2004}}
|Genres =
|Genres =
{{Game.InfoBox.Genre|Shooter}}
{{Game.InfoBox.Genre|Shooter}}
| PCGamingWiki = Doom_3
|PCGamingWiki = Doom_3}}
}}


{{Game.ActionBox
{{Game.ActionBox
|Actions =  
|Actions =  
{{Game.ActionBox.Row|Name = Play Doom 3|Path = dhewm3.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play Doom 3|Path = {InstallDir}\dhewm3.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play Doom 3 - Resurrection of Evil|Path = dhewm3.exe|Arguments = +set fs_game d3xp|WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play Doom 3 - Resurrection of Evil|Path = {InstallDir}\dhewm3.exe|Arguments = +set fs_game d3xp|WorkingDirectory = |Primary = True}}
}}
}}


{{Game.SaveBox
|Paths =
{{Game.SaveBox.Row|Type = File|Path = %USERPROFILE%/Documents/My Games/dhewm3}}
}}


{{Game.Scripts.Install
{{Game.Scripts.Install
Line 29: Line 23:
|Description =  
|Description =  
|RequiresAdmin = False
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
$InstallDir = $PSScriptRoot
<syntaxhighlight lang="powershell" line>
# Accessible via $Display.Width and $Display.Height
# Bounds are accessible by $Display.Bounds.Width and $Display.Bounds.Height
Add-Type -AssemblyName System.Windows.Forms
$Display = Get-PrimaryDisplay
$Display = ([System.Windows.Forms.Screen]::AllScreens | Where-Object Primary).Bounds
 
function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
    $content = (Get-Content $FilePath) -replace $Regex, $Replacement
    [IO.File]::WriteAllLines($FilePath, $content)
}


Copy-Item -Path "$InstallDir\ProfileTemplate" -Destination "$($env:USERPROFILE)\Documents\My Games\dhewm3" -Recurse
Copy-Item -Path "$InstallDirectory\ProfileTemplate" -Destination "$($env:USERPROFILE)\Documents\My Games\dhewm3" -Recurse


# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Regex '^seta r_customHeight "(.+)"' -Replacement "seta r_customHeight ""$($Display.Height)""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\base\dhewm.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customHeight "(.+)"' -Substitution "seta r_customHeight ""$($Display.Bounds.Height)""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\base\dhewm.cfg"
Write-ReplaceContentInFile -Regex '^seta r_customWidth "(.+)"' -Replacement "seta r_customWidth ""$($Display.Width)""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\base\dhewm.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customWidth "(.+)"' -Substitution "seta r_customWidth ""$($Display.Bounds.Width)""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\base\dhewm.cfg"
Write-ReplaceContentInFile -Regex '^seta r_customHeight "(.+)"' -Replacement "seta r_customHeight ""$($Display.Height)""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\d3xp\dhewm.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customHeight "(.+)"' -Substitution "seta r_customHeight ""$($Display.Bounds.Height)""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\d3xp\dhewm.cfg"
Write-ReplaceContentInFile -Regex '^seta r_customWidth "(.+)"' -Replacement "seta r_customWidth ""$($Display.Width)""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\d3xp\dhewm.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customWidth "(.+)"' -Substitution "seta r_customWidth ""$($Display.Bounds.Width)""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\d3xp\dhewm.cfg"
</syntaxhighlight>
</syntaxhighlight>
}}
}}
 
           
{{Game.Scripts.NameChange
{{Game.Scripts.NameChange
|Name = Name Change Script
|Name = Name Change Script
|Description =  
|Description =  
|RequiresAdmin = False
|RequiresAdmin = False
|Contents = <syntaxhighlight lang="powershell" line>
|Contents =
$InstallDir = $PSScriptRoot
<syntaxhighlight lang="powershell" line>
$NewName = $args[0]
 
function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
{
    $content = (Get-Content $FilePath) -replace $Regex, $Replacement
    [IO.File]::WriteAllLines($FilePath, $content)
}
 
# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Regex '^seta ui_name "(.+)"' -Replacement "seta ui_name ""$NewName""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\base\dhewm.cfg"
Write-ReplaceContentInFile -Pattern '^seta ui_name "(.+)"' -Substitution "seta ui_name ""$NewPlayerAlias""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\base\dhewm.cfg"
Write-ReplaceContentInFile -Regex '^seta ui_name "(.+)"' -Replacement "seta ui_name ""$NewName""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\d3xp\dhewm.cfg"
Write-ReplaceContentInFile -Pattern '^seta ui_name "(.+)"' -Substitution "seta ui_name ""$NewPlayerAlias""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\d3xp\dhewm.cfg"
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Latest revision as of 00:42, 22 February 2024

Developers
id Software
Publishers
ActivisionAspyr Media
Release Date
Windows: August 3, 2004
Genres
Shooter
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play Doom 3 {InstallDir}\dhewm3.exe True
Play Doom 3 - Resurrection of Evil {InstallDir}\dhewm3.exe +set fs_game d3xp True

Install Script

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

Copy-Item -Path "$InstallDirectory\ProfileTemplate" -Destination "$($env:USERPROFILE)\Documents\My Games\dhewm3" -Recurse

# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^seta r_customHeight "(.+)"' -Substitution "seta r_customHeight ""$($Display.Bounds.Height)""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\base\dhewm.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customWidth "(.+)"' -Substitution "seta r_customWidth ""$($Display.Bounds.Width)""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\base\dhewm.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customHeight "(.+)"' -Substitution "seta r_customHeight ""$($Display.Bounds.Height)""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\d3xp\dhewm.cfg"
Write-ReplaceContentInFile -Pattern '^seta r_customWidth "(.+)"' -Substitution "seta r_customWidth ""$($Display.Bounds.Width)""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\d3xp\dhewm.cfg"

Name Change Script

# Use regex to replace text within a file. Quotes are escaped by double quoting ("")
Write-ReplaceContentInFile -Pattern '^seta ui_name "(.+)"' -Substitution "seta ui_name ""$NewPlayerAlias""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\base\dhewm.cfg"
Write-ReplaceContentInFile -Pattern '^seta ui_name "(.+)"' -Substitution "seta ui_name ""$NewPlayerAlias""" -FilePath "$($env:USERPROFILE)\Documents\My Games\dhewm3\d3xp\dhewm.cfg"