Recoil

From LANCommander
Revision as of 01:24, 1 August 2023 by DoctorDalek (talk | contribs) (Created page with "Category:Games {{Game.InfoBox |Cover = cover.jpg |Release Date = {{Game.InfoBox.ReleaseDate|Windows|March 11, 1999}} | PCGamingWiki = Recoil }} {{Game.ActionBox |Actions = {{Game.ActionBox.Row|Name = Play|Path = Recoil.exe|Arguments = |WorkingDirectory = |Primary = True}} }} {{Game.Scripts.Install |Name = Install Script |Description = Creates the default values in the registry. |RequiresAdmin = False |Contents = <syntaxhighlight lang="powershell" line> function Ge...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Release Date
Windows: March 11, 1999
View at PCGamingWiki

Actions

Name Path Arguments Working Directory Primary
Play Recoil.exe True

Install Script

Creates the default values in the registry.

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 $bytes
}

$RegPath = "HKCU:\Software\Zipper\RECOIL\1.0"
$PlayerNameHex = ([byte[]](0x4C, 0x6F, 0x72, 0x64, 0x20, 0x4E, 0x65, 0x6C, 0x73, 0x6F, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
$CmdMapHex = ([byte[]](0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0xcb, 0x00, 0x00, 0x00, 0xcd, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x80, 0x01, 0x2b, 0x00, 0x40, 0x01, 0x30, 0x00, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x80, 0x08, 0x39, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x78, 0x02, 0x00, 0x03, 0x80, 0x02, 0x00, 0x04, 0x88, 0x02, 0x00, 0x05, 0x58, 0x02, 0x00, 0x06, 0x60, 0x02, 0x00, 0x07, 0x68, 0x02, 0x00, 0x08, 0x38, 0x02, 0x00, 0x09, 0x40, 0x02, 0x00, 0x0a, 0x48, 0x02, 0x00, 0x18, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x2d, 0x02, 0x00, 0x00, 0x18, 0x04, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
$SoundVolumeHex = ([byte[]](0x00, 0x00, 0x80, 0x3f)

$NewNameHex = Get-AsciiBytesAsString -InputString $NewName -MaxLength 22
$PlayerNameHex = $NewNameHex

New-Item -Path "$RegPath" -Force

New-ItemProperty -Path "$RegPath\VMode" -Value 5
New-ItemProperty -Path "$RegPath\Joystick" -Value 0
New-ItemProperty -Path "$RegPath\HWAPI" -Value 1
New-ItemProperty -Path "$RegPath\HUDType_HW" -Value 1
New-ItemProperty -Path "$RegPath\HUDType_SW" -Value 2
New-ItemProperty -Path "$RegPath\HUDFlag_HW" -Value 1
New-ItemProperty -Path "$RegPath\HUDFlag_SW" -Value 1
New-ItemProperty -Path "$RegPath\FullScreen" -Value 1
New-ItemProperty -Path "$RegPath\CDAudio" -Value 1
New-ItemProperty -Path "$RegPath\SoundAPI" -Value 0
New-ItemProperty -Path "$RegPath\SoundLOD" -Value 0
New-ItemProperty -Path "$RegPath\MuteSound" -Value 0
New-ItemProperty -Path "$RegPath\GameIntensity" -Value 1
New-ItemProperty -Path "$RegPath\GameCtlOptions" -Value 10
New-ItemProperty -Path "$RegPath\TextureMemory_HW" -Value 0
New-ItemProperty -Path "$RegPath\TextureMemory_SW" -Value 0
New-ItemProperty -Path "$RegPath\ObjectLOD_HW" -Value 0
New-ItemProperty -Path "$RegPath\ObjectLOD_SW" -Value 0
New-ItemProperty -Path "$RegPath\GfxFlags_HW" -Value 27
New-ItemProperty -Path "$RegPath\GfxFlags_SW" -Value 15
New-ItemProperty -Path "$RegPath\EffectsLevel_HW" -Value 0
New-ItemProperty -Path "$RegPath\EffectsLevel_SW" -Value 1
New-ItemProperty -Path "$RegPath\HWCardFlag" -Value 1
New-ItemProperty -Path "$RegPath\WOLPasswordFlag" -Value 1
New-ItemProperty -Path "$RegPath\PlayerName" -PropertyType Binary -Value $PlayerNameHex
New-ItemProperty -Path "$RegPath\CmdMap" -PropertyType Binary -Value $CmdMapHex
New-ItemProperty -Path "$RegPath\SoundVolume" -PropertyType Binary -Value $SoundVolumeHex

Name Change Script

Player names are stored in the registry as a 22-byte, ASCII-encoded binary key.

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 $bytes
}

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

$RegPath = "HKCU:\Software\Zipper\RECOIL\1.0"
$PlayerNameHex = ([byte[]](0x4C, 0x6F, 0x72, 0x64, 0x20, 0x4E, 0x65, 0x6C, 0x73, 0x6F, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)

$NewNameHex = Get-AsciiBytes -InputString $NewName -MaxLength 22
$PlayerNameHex = $NewNameHex

New-ItemProperty -Path "$RegPath\PlayerName" -PropertyType Binary -Value $PlayerNameHex

Uninstall Script

Removes the registry tree created by the installer

Remove-Item -Path "HKCU:\Software\Zipper\RECOIL" -Force -Recurse