Descent 3

From LANCommander
Revision as of 00:25, 1 August 2023 by DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Developers = {{Game.InfoBox.Developer|Outrage Games}} {{Game.InfoBox.Developer|Loki Software}} |Publishers = {{Game.InfoBox.Publisher|Interplay Entertainment}} {{Game.InfoBox.Publisher|Graphic Simulations}} |Release Date = {{Game.InfoBox.ReleaseDate|Windows|June 17, 1999}} |Genres = {{Game.InfoBox.Genre|Shooter}} {{Game.InfoBox.Genre|Simulator}} | PCGamingWiki = Descent_3 }} {{Game.ActionBox |Actions = {{Game.Action...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Developers
Outrage Games

Loki Software

Publishers
Interplay Entertainment Graphic Simulations
Release Date
Windows: June 17, 1999
Genres
Shooter

Simulator

View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Patch Configuration InjectD3Configuration.exe False
Play InjectD3.exe True
Level Editor D3EDIT.EXE {InstallDir}/Editor False

Install Script

This script requires admin access to function properly

$InstallDir = $PSScriptRoot

New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage\Descent 3 Level Editor"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage\Descent 3 Level Editor\Settings"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage\Descent3"
New-Item -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage\Descent3\Version"

New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage\Descent 3 Level Editor" -Name "D3Dir" -Value "$InstallDir" -Force

New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage\Descent3" -Name "ConnectionSpeed" -Value "Fast" -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage\Descent3" -Name "NetworkConnection" -Value "LAN" -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage\Descent3" -Name "ProfanityPrevention" -Value 0 -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage\Descent3" -Name "PredefDetailSetting" -Value 3 -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage\Descent3" -Name "PreferredRenderer" -Value 2 -Force

New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage\Descent3\Version" -Name "Build" -Value 0 -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage\Descent3\Version" -Name "Major" -Value 1 -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Outrage\Descent3\Version" -Name "Minor" -Value 4 -Force

Name Change Script

$NewName = $args[0]
$InstallDir = $PSScriptRoot

function Get-AsciiBytes([string]$InputString, [int]$MaxLength)
{
    if ($InputString.Length -gt $MaxLength)
    {
        $InputString = $InputString.Substring(0, $MaxLength)
    }

    $bytes = [System.Text.Encoding]::ASCII.GetBytes($InputString)
    $array = @()
    $count = 0

    $extraPadding = $MaxLength - $bytes.Length

    foreach ($byte in $bytes)
    {
        if ($count -lt $MaxLength)
        {
            $array += $byte
            $count++
        }
    }

    for ($i = $count; $i -lt $MaxLength; $i++)
    {
        $array += 0x00
    }

    return $array
}

function Patch-Binary([byte[]]$Data, [int]$Offset, [string]$FilePath)
{
    $bytes = [System.IO.File]::ReadAllBytes($FilePath)

    for ($i = 0; $i -lt $Data.Length; $i++)
    {
        $bytes[$Offset + $i] = $Data[$i]
    }

    [System.IO.File]::WriteAllBytes($FilePath, $bytes)
}

$rawBytes = Get-AsciiBytes -InputString $newName -MaxLength 19

Copy-Item -Path "$InstallDir\DefaultPilot" -Destination "$InstallDir\$NewName.plt"

Patch-Binary -FilePath "$InstallDir\$NewName.plt" -Offset 0x4 -Data $rawBytes

New-ItemProperty -Path "HKCU:\SOFTWARE\Outrage\Descent3" -Name "Default_pilot" -Value "$NewName.plt" -Force