Dune 2000: Difference between revisions

From LANCommander
(Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|Westwood Studios}} |Publishers = {{Game.InfoBox.Publisher|Westwood Studios}} {{Game.InfoBox.Publisher|Electronic Arts}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|September 1, 1998}} |Genres = {{Game.InfoBox.Genre|Real Time Strategy (RTS)}} {{Game.InfoBox.Genre|Strategy}} | PCGamingWiki = Dune_2000 }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = cn...")
 
No edit summary
Line 5: Line 5:
{{Game.InfoBox.Developer|Westwood Studios}}
{{Game.InfoBox.Developer|Westwood Studios}}
|Publishers =
|Publishers =
{{Game.InfoBox.Publisher|Westwood Studios}}
{{Game.InfoBox.Developer|Westwood Studios}}{{Game.InfoBox.Developer|Electronic Arts}}
{{Game.InfoBox.Publisher|Electronic Arts}}
|Release Date =
|Release Date =
{{Game.InfoBox.ReleaseDate|Windows|September 1, 1998}}
{{Game.InfoBox.ReleaseDate|Windows|September 1, 1998}}
|Genres =
|Genres =
{{Game.InfoBox.Genre|Real Time Strategy (RTS)}}
{{Game.InfoBox.Genre|Real Time Strategy (RTS)}}{{Game.InfoBox.Genre|Strategy}}
{{Game.InfoBox.Genre|Strategy}}
|PCGamingWiki = Dune_2000}}
| PCGamingWiki = Dune_2000
}}


{{Game.ActionBox
{{Game.ActionBox
|Actions =  
|Actions =  
{{Game.ActionBox.Row|Name = Play|Path = cncnet5.exe|Arguments = |WorkingDirectory = |Primary = True}}
{{Game.ActionBox.Row|Name = Play|Path = {InstallDir}\cncnet5.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
$filePath = "$InstallDirectory\dune2000.ini"
 
# Get the screen resolution
Add-Type -AssemblyName System.Windows.Forms
$screen = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Size
$width = $screen.Width
$height= $screen.Height
 
# Read the content of the file
$content = Get-Content -Path $filePath
 
# Loop through each line in the file
for ($i = 0; $i -lt $content.Count; $i++) {
    $line = $content[$i]


function Write-ReplaceContentInFile([string]$Regex, [string]$Replacement, [string]$FilePath)
    # Check if the line contains "SCREENWIDTH" and "640"
{
    if ($line -like '*GameWidth*') {
    $content = (Get-Content $FilePath) -replace $Regex, $Replacement
        # Replace the line with the updated width
     [IO.File]::WriteAllLines($FilePath, $content)
        $content[$i] = "GameWidth=$width"
    }
        if ($line -like '*GameHeight*') {
        # Replace the line with the updated width
        $content[$i] = "GameHeight=$height"
     }
}
}


Write-ReplaceContentInFile -Regex 'Nickname=(.+)' -Replacement "Nickname=$NewName" -FilePath "$InstallDir\cncnet5.ini"
# Save the updated content back to the file
$content | Set-Content -Path $filePath
</syntaxhighlight>
}}
           
{{Game.Scripts.NameChange
|Name = Name Change Script
|Description =
|RequiresAdmin = False
|Contents =
<syntaxhighlight lang="powershell" line>
Write-ReplaceContentInFile -Pattern 'Nickname=(.+)' -Substitution "Nickname=$NewPlayerAlias" -FilePath "$InstallDirectory\cncnet5.ini"
</syntaxhighlight>
</syntaxhighlight>
}}
}}

Revision as of 02:09, 6 January 2024

Developers
Westwood Studios
Publishers
Westwood StudiosElectronic Arts
Release Date
Windows: September 1, 1998
Genres
Real Time Strategy (RTS)Strategy
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play {InstallDir}\cncnet5.exe True

Install Script

$filePath = "$InstallDirectory\dune2000.ini"

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

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

# Loop through each line in the file
for ($i = 0; $i -lt $content.Count; $i++) {
    $line = $content[$i]

    # Check if the line contains "SCREENWIDTH" and "640"
    if ($line -like '*GameWidth*') {
        # Replace the line with the updated width
        $content[$i] = "GameWidth=$width"
    }
        if ($line -like '*GameHeight*') {
        # Replace the line with the updated width
        $content[$i] = "GameHeight=$height"
    }
}

# Save the updated content back to the file
$content | Set-Content -Path $filePath

Name Change Script

Write-ReplaceContentInFile -Pattern 'Nickname=(.+)' -Substitution "Nickname=$NewPlayerAlias" -FilePath "$InstallDirectory\cncnet5.ini"