Acquire the Erlking?

Please post any spoilers for X4: Foundations here.

Moderator: Moderators for English X Forum

jlehtone
Posts: 21794
Joined: Sat, 23. Apr 05, 21:42
x4

Re: Acquire the Erlking?

Post by jlehtone » Mon, 18. Apr 22, 00:40

BigBANGtheory wrote:
Sun, 17. Apr 22, 21:21
<position x="31416.18" y="-319.843" z="19007.887"/>
:o
East-northeast (from where-ever the "center" is)?
Goner Pancake Protector X
Insanity included at no extra charge.
There is no Box. I am the sand.

Raptor34
Posts: 2475
Joined: Sat, 12. Jun 10, 04:43
x4

Re: Acquire the Erlking?

Post by Raptor34 » Mon, 18. Apr 22, 07:09

jlehtone wrote:
Mon, 18. Apr 22, 00:40
BigBANGtheory wrote:
Sun, 17. Apr 22, 21:21
<position x="31416.18" y="-319.843" z="19007.887"/>
:o
East-northeast (from where-ever the "center" is)?
Yes to this and the earlier question.
Though it's actually -3km so not really far off the ecliptic. Actually none of mine was far off afaict, adv sats picked them all up easy.
What I had trouble with was identifying coordinates though, which took me awhile for nothing. In hindsight I should have just spammed sats around that region. It seemed to be near my initial scan point. Relatively speaking, was like 1-200km off.

jpinard
Posts: 37
Joined: Wed, 14. Sep 05, 08:20
x4

Re: Acquire the Erlking?

Post by jpinard » Mon, 12. Sep 22, 07:15

silentradios wrote:
Sun, 27. Mar 22, 14:51
Edit 3/27: Apparently Avarice V and IV were swapped (I got the friendly name mapping from reddit - not sure where a real source is) -- I confirmed in my save and two others did as well

Here is a bat file that runs the powershell inside it (sneaky.. but effective) : https://anechoic.space/erlkinggui.bat
It has a few features over the previous script including:
  • A File selection dialog
  • Support for gz / compressed saves
  • GUI output of the positions
Here is the same script that you can copy and past and save into a .bat file (use notepad and save as UTF-8 or ANSI (do not select the with BOM ones) and run to avoid the prompts that you get from windows about it being safe or not..

Code: Select all

@findstr/v "^@f.*&" "%~f0"|powershell -noprofile -executionpolicy bypass -&goto:eof
#Fist line stolen from https://stackoverflow.com/a/2611394
#This uses a fair amount of memory - if you have limited ram exit X4 first...
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Messagebox]::Show("This uses a fair amount of memory - if you have limited ram exit X4 first...")

#stolen from https://4sysops.com/archives/how-to-create-an-open-file-folder-dialog-box-with-powershell/
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ 
    InitialDirectory = [Environment]::GetFolderPath('MyDocuments') + "\Egosoft\X4" 
    Filter = '*.xml|*.gz'
    Title = "Select savegame file"
}
while([string]::IsNullOrWhiteSpace($FileBrowser.FileName)){
    $null = $FileBrowser.ShowDialog()
    sleep 1
}

#from https://social.technet.microsoft.com/Forums/windowsserver/en-US/5aa53fef-5229-4313-a035-8b3a38ab93f5/unzip-gz-files-using-powershell?forum=winserverpowershell
Function Expand-GZip{
    Param(
        $infile,
        $outfile = ($infile -replace '\.gz$','')
        )
    $input = New-Object System.IO.FileStream $inFile, ([IO.FileMode]::Open), ([IO.FileAccess]::Read), ([IO.FileShare]::Read)
    $output = New-Object System.IO.FileStream $outFile, ([IO.FileMode]::Create), ([IO.FileAccess]::Write), ([IO.FileShare]::None)
    $gzipStream = New-Object System.IO.Compression.GzipStream $input, ([IO.Compression.CompressionMode]::Decompress)
    $buffer = New-Object byte[](1024)
    while($true){
        $read = $gzipstream.Read($buffer, 0, 1024)
        if ($read -le 0){break}
        $output.Write($buffer, 0, $read)
        }
    $gzipStream.Close()
    $output.Close()
    $input.Close()
}

$gzip = $false

if($FileBrowser.FileName -match "\.gz$"){
    Write-Host "Extracting compressed save, this may take a while"
    $gzip = $true
    Expand-GZip -infile $FileBrowser.FileName
}

if($gzip) {
    $file = ($FileBrowser.FileName -replace '\.gz$','')
} else {
    $file = $FileBrowser.FileName
}

Write-Host "Loading XML, this may take a while and will use lots of ram"

$Xml=New-Object Xml
#unzip .gz file with 7-zip or gunzip first or use uncompressed saves
$Xml.Load($file)

Write-Host "Finding Erlking Data Vaults"
$components=Select-Xml -Xml $Xml -XPath "/savegame/universe//component"
$erl=$components | ?{$_.Node.macro -and $_.Node.macro.Contains("erlking")}
$vaults = $erl | ?{$_.Node.macro -and $_.Node.macro.Contains("landmarks_erlking_vault")}

#From hatevampire at https://www.reddit.com/r/X4Foundations/comments/thjbik/how_to_read_save_file/
#Not sure where the real source of friendlyname is..

$locationtoname = @{
    cluster_500_sector001_macro="Avarice I"
    cluster_500_sector002_macro="Avarice V"
    cluster_500_sector003_macro="Avarice IV"
    cluster_501_macro="Windfall I"
    cluster_502_macro="Windfall III"
    cluster_503_macro="Windfall IV"
}

$macrotocoords=@{
     "Zone004_Cluster_503_Sector001_macro"="139680,0,-3215.59"
     "Zone003_Cluster_500_Sector003_macro"="-115796.9,0,-96109.38"
     "Zone002_Cluster_503_Sector001_macro"="-2269.199,0,165758.4"
     "Zone006_Cluster_500_Sector002_macro"="-184409.83,0,-3343.0"
     "Zone003_Cluster_501_Sector001_macro"="-97898.44,0,-23632.81"
     "Zone003_Cluster_500_Sector001_macro"="-97898.44,0,-23632.81"
     "Zone005_Cluster_501_Sector001_macro"="-23023.44,0,-160132.8"
     "Zone004_Cluster_504_Sector001_macro"="157616.8,0,-84263.63"
     "tzoneCluster_500_Sector002SHCon9_GateZone_macro"="-39827.2,0,200000"
     "tzoneCluster_500_Sector002SHCon5_GateZone_macro"="-50000,0,200000"
     "Zone001_Cluster_500_Sector003_macro"="-117046.9,0,82593.75"
     "Zone001_Cluster_501_Sector001_macro"="-127062.5,0,133718.8"
     "Zone005_Cluster_504_Sector001_macro"="-23023.44,0,-160132.8"
     "Zone004_Cluster_500_Sector001_macro"="103164.1,0,-32492.19"
     "Zone002_Cluster_500_Sector001_macro"="-10960.94,0,112070.3"
     "Zone003_Cluster_500_Sector002_macro"="-7132.69,0,531.25"
     "Zone002_Cluster_500_Sector002_macro"="-118489.4,0,-131687.5"
     "tzoneCluster_500_Sector003SHCon9_GateZone_macro"="50000,0,200000"
     "Zone005_Cluster_500_Sector002_macro"="98694.83,0,-126406.3"
     "tzoneCluster_500_Sector001SHCon2_GateZone_macro"="66960.9,0,-207957"
     "tzoneCluster_500_Sector003SHCon5_GateZone_macro"="40054.7,0,200000"
     "tzoneCluster_500_Sector001SHCon10_GateZone_macro"="-45738.28,0,-200000"
     "Zone005_Cluster_500_Sector003_macro"="34671.88,0,-152515.6"
     "Zone001_Cluster_504_Sector001_macro"="-127062.5,0,133718.8"
     "Zone003_Cluster_502_Sector001_macro"="-97898.44,0,-23632.81"
     "Zone002_Cluster_504_Sector001_macro"="137904.1,0,135199.3"
     "Zone005_Cluster_503_Sector001_macro"="-23023.44,0,-160132.8"
     "Zone001_Cluster_500_Sector001_macro"="-127062.5,0,133718.8"
     "Zone004_Cluster_501_Sector001_macro"="103164.1,0,-32492.19"
     "tzoneCluster_500_Sector001SHCon4_GateZone_macro"="76886.7,0,-207957"
     "Zone006_Cluster_502_Sector001_macro"="47000.0,0,172000.0"
     "Zone002_Cluster_500_Sector003_macro"="44015.63,0,158125"
     "tzoneCluster_500_Sector001SHCon6_GateZone_macro"="-55785.2,0,-200000"
     "Zone002_Cluster_501_Sector001_macro"="-10960.94,0,112070.3"
     "Zone001_Cluster_500_Sector002_macro"="-78593.63,0,157937.5"
     "Zone003_Cluster_503_Sector001_macro"="-199365.3,0,-55454.45"
     "Zone001_Cluster_502_Sector001_macro"="-127062.5,0,133718.8"
     "Zone003_Cluster_504_Sector001_macro"="-226443.3,0,-97194.67"
     "Zone005_Cluster_500_Sector001_macro"="-23023.44,0,-160132.8"
     "Zone004_Cluster_500_Sector003_macro"="110359.4,0,7250"
     "Zone001_Cluster_503_Sector001_macro"="-190039.3,0,180073.9"
     "Zone005_Cluster_502_Sector001_macro"="-23023.44,0,-160132.8"
     "Zone004_Cluster_500_Sector002_macro"="101721.7,0,100656.3"
     "Zone002_Cluster_502_Sector001_macro"="108009.3,0,115933.7"
     "Zone004_Cluster_502_Sector001_macro"="103164.1,0,-32492.19"
}

#Get offsets up the tree
function Recurse-Offsets($node){
    if($node.class -and $node.class -eq "galaxy"){
        return @()
    }
    if($node.offset -ne $null){
        if($node.offset.position){
            $x=$node.offset.position.x
            $y=$node.offset.position.y
            $z=$node.offset.position.z
        } else {
            $x,$y,$z=0,0,0
        }
        if($node.offset.rotation){
            if($node.offset.rotation.yaw){$yaw=$node.offset.rotation.yaw} else {$yaw=0}
            if($node.offset.rotation.pitch){$pitch=$node.offset.rotation.pitch} else {$pitch=0}
            if($node.offset.rotation.roll){$roll=$node.offset.rotation.roll} else {$roll=0}
        } else {
            $pitch,$roll,$yaw=0,0,0
        }
        if($macrotocoords[$node.macro]){
            $x,$y,$z=$macrotocoords[$node.macro].Split(",")
        }
        $obj = [pscustomobject]@{
            x=$x
            y=$y
            z=$z
            pitch=$pitch
            roll=$roll
            yaw=$yaw
            code=$node.code
            macro=$node.macro
            class=$node.class
        }
        return @($obj) + (Recurse-Offsets -node $node.ParentNode)
    } else {
        return Recurse-Offsets -node $node.ParentNode
    }
}

$data=. {
    foreach($vault in $vaults){
        $data=Recurse-Offsets $vault.Node
        $sums = $data | Measure-Object -Sum -Property x,y,z
        $location = $data |?{$_.class -eq "sector"} | select -ExpandProperty macro
        if([string]::IsNullOrWhiteSpace($location)){
            $location = $data |?{$_.class -eq "cluster"} | select -ExpandProperty macro
        }
        [pscustomobject]@{
            location=$locationtoname[$location]
            Xkm=($sums |?{$_.property -eq "x"}).sum/1000
            Ykm=($sums |?{$_.property -eq "y"}).sum/1000
            Zkm=($sums |?{$_.property -eq "z"}).sum/1000
            blueprint=$vault.Node.connections.connection.component.blueprints |?{$_ -ne $null}
            vault=$vault.Node.macro
            code=$vault.Node.code
        }
    }
} 
$data | ft -AutoSize
$data | Out-GridView
if($gzip){
    if([System.Windows.Forms.MessageBox]::Show("Remove the extracted save $file" , "Remove Save?" , 4, 64) -eq "Yes"){
        Remove-Item -Path $file
    }
}

[System.Windows.Forms.Messagebox]::Show("Done, you can copy out of the cmd window or grid view before closing this if you want.")

<#
#Some other useful snippets

#detailed output
. {
    foreach($vault in $vaults){
        Recurse-Offsets $vault.Node
        "-----"
    }
} | ft -AutoSize

#parse out zone info
$zoneinfo = [xml](gc c:\path\to\dlc_pirate_sectors.xml)
$hash = @{}
$zoneinfo.macros.macro | %{
    $_.connections.connection | %{
        $hash += @{$_.macro.ref = $_.offset.position } 
    }
}
# Generate a powershell hash for the above xml and put it on the clipboard
"@{`n" + ($hash.GetEnumerator() |%{"    `"$($_.key)`"=`"$(@($_.value.x,$_.value.y,$_.value.z) -join ",")`"`n"}) + "}" | clip
$components=Select-Xml -Xml $Xml -XPath "/savegame/universe//component"
# Get all classes
$components.Node.class | select -Unique | sort

order of map related:
    galaxy
    cluster
    sector
    zone
#>

I'm sorry, but how do I run this?

|K.O.S.H.
Posts: 3723
Joined: Fri, 19. Dec 03, 10:36
x3tc

Re: Acquire the Erlking?

Post by |K.O.S.H. » Tue, 6. Dec 22, 15:50

I'm missing one the vaults.

I put the scan range for one of my ships to 1000km (via mod), because i searched for hours.
Then i flew into all 6 sectors, but i cannot find the 5th vault...
-> frustrating

i also noticed, that one of the vaults is disoplayed blue on the map and the other 3 are grey...
Wing Commander Mod - German Topic
06.07.11 - v1.1 RELEASED!

Alan Phipps
Moderator (English)
Moderator (English)
Posts: 30349
Joined: Fri, 16. Apr 04, 19:21
x4

Re: Acquire the Erlking?

Post by Alan Phipps » Tue, 6. Dec 22, 17:47

Since you're already modding the game to find them, you shouldn't mind using the batch file in this thread to find them all once and for all.
A dog has a master; a cat has domestic staff.

Feloidea
Posts: 533
Joined: Sat, 25. Apr 09, 11:06
x4

Re: Acquire the Erlking?

Post by Feloidea » Thu, 8. Dec 22, 02:34

jpinard wrote:
Mon, 12. Sep 22, 07:15
silentradios wrote:
Sun, 27. Mar 22, 14:51
Edit 3/27: Apparently Avarice V and IV were swapped (I got the friendly name mapping from reddit - not sure where a real source is) -- I confirmed in my save and two others did as well

Here is a bat file that runs the powershell inside it (sneaky.. but effective) : https://anechoic.space/erlkinggui.bat
It has a few features over the previous script including:
  • A File selection dialog
  • Support for gz / compressed saves
  • GUI output of the positions
Here is the same script that you can copy and past and save into a .bat file (use notepad and save as UTF-8 or ANSI (do not select the with BOM ones) and run to avoid the prompts that you get from windows about it being safe or not..

Code: Select all

@findstr/v "^@f.*&" "%~f0"|powershell -noprofile -executionpolicy bypass -&goto:eof
#Fist line stolen from https://stackoverflow.com/a/2611394
#This uses a fair amount of memory - if you have limited ram exit X4 first...
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Messagebox]::Show("This uses a fair amount of memory - if you have limited ram exit X4 first...")

#stolen from https://4sysops.com/archives/how-to-create-an-open-file-folder-dialog-box-with-powershell/
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ 
    InitialDirectory = [Environment]::GetFolderPath('MyDocuments') + "\Egosoft\X4" 
    Filter = '*.xml|*.gz'
    Title = "Select savegame file"
}
while([string]::IsNullOrWhiteSpace($FileBrowser.FileName)){
    $null = $FileBrowser.ShowDialog()
    sleep 1
}

#from https://social.technet.microsoft.com/Forums/windowsserver/en-US/5aa53fef-5229-4313-a035-8b3a38ab93f5/unzip-gz-files-using-powershell?forum=winserverpowershell
Function Expand-GZip{
    Param(
        $infile,
        $outfile = ($infile -replace '\.gz$','')
        )
    $input = New-Object System.IO.FileStream $inFile, ([IO.FileMode]::Open), ([IO.FileAccess]::Read), ([IO.FileShare]::Read)
    $output = New-Object System.IO.FileStream $outFile, ([IO.FileMode]::Create), ([IO.FileAccess]::Write), ([IO.FileShare]::None)
    $gzipStream = New-Object System.IO.Compression.GzipStream $input, ([IO.Compression.CompressionMode]::Decompress)
    $buffer = New-Object byte[](1024)
    while($true){
        $read = $gzipstream.Read($buffer, 0, 1024)
        if ($read -le 0){break}
        $output.Write($buffer, 0, $read)
        }
    $gzipStream.Close()
    $output.Close()
    $input.Close()
}

$gzip = $false

if($FileBrowser.FileName -match "\.gz$"){
    Write-Host "Extracting compressed save, this may take a while"
    $gzip = $true
    Expand-GZip -infile $FileBrowser.FileName
}

if($gzip) {
    $file = ($FileBrowser.FileName -replace '\.gz$','')
} else {
    $file = $FileBrowser.FileName
}

Write-Host "Loading XML, this may take a while and will use lots of ram"

$Xml=New-Object Xml
#unzip .gz file with 7-zip or gunzip first or use uncompressed saves
$Xml.Load($file)

Write-Host "Finding Erlking Data Vaults"
$components=Select-Xml -Xml $Xml -XPath "/savegame/universe//component"
$erl=$components | ?{$_.Node.macro -and $_.Node.macro.Contains("erlking")}
$vaults = $erl | ?{$_.Node.macro -and $_.Node.macro.Contains("landmarks_erlking_vault")}

#From hatevampire at https://www.reddit.com/r/X4Foundations/comments/thjbik/how_to_read_save_file/
#Not sure where the real source of friendlyname is..

$locationtoname = @{
    cluster_500_sector001_macro="Avarice I"
    cluster_500_sector002_macro="Avarice V"
    cluster_500_sector003_macro="Avarice IV"
    cluster_501_macro="Windfall I"
    cluster_502_macro="Windfall III"
    cluster_503_macro="Windfall IV"
}

$macrotocoords=@{
     "Zone004_Cluster_503_Sector001_macro"="139680,0,-3215.59"
     "Zone003_Cluster_500_Sector003_macro"="-115796.9,0,-96109.38"
     "Zone002_Cluster_503_Sector001_macro"="-2269.199,0,165758.4"
     "Zone006_Cluster_500_Sector002_macro"="-184409.83,0,-3343.0"
     "Zone003_Cluster_501_Sector001_macro"="-97898.44,0,-23632.81"
     "Zone003_Cluster_500_Sector001_macro"="-97898.44,0,-23632.81"
     "Zone005_Cluster_501_Sector001_macro"="-23023.44,0,-160132.8"
     "Zone004_Cluster_504_Sector001_macro"="157616.8,0,-84263.63"
     "tzoneCluster_500_Sector002SHCon9_GateZone_macro"="-39827.2,0,200000"
     "tzoneCluster_500_Sector002SHCon5_GateZone_macro"="-50000,0,200000"
     "Zone001_Cluster_500_Sector003_macro"="-117046.9,0,82593.75"
     "Zone001_Cluster_501_Sector001_macro"="-127062.5,0,133718.8"
     "Zone005_Cluster_504_Sector001_macro"="-23023.44,0,-160132.8"
     "Zone004_Cluster_500_Sector001_macro"="103164.1,0,-32492.19"
     "Zone002_Cluster_500_Sector001_macro"="-10960.94,0,112070.3"
     "Zone003_Cluster_500_Sector002_macro"="-7132.69,0,531.25"
     "Zone002_Cluster_500_Sector002_macro"="-118489.4,0,-131687.5"
     "tzoneCluster_500_Sector003SHCon9_GateZone_macro"="50000,0,200000"
     "Zone005_Cluster_500_Sector002_macro"="98694.83,0,-126406.3"
     "tzoneCluster_500_Sector001SHCon2_GateZone_macro"="66960.9,0,-207957"
     "tzoneCluster_500_Sector003SHCon5_GateZone_macro"="40054.7,0,200000"
     "tzoneCluster_500_Sector001SHCon10_GateZone_macro"="-45738.28,0,-200000"
     "Zone005_Cluster_500_Sector003_macro"="34671.88,0,-152515.6"
     "Zone001_Cluster_504_Sector001_macro"="-127062.5,0,133718.8"
     "Zone003_Cluster_502_Sector001_macro"="-97898.44,0,-23632.81"
     "Zone002_Cluster_504_Sector001_macro"="137904.1,0,135199.3"
     "Zone005_Cluster_503_Sector001_macro"="-23023.44,0,-160132.8"
     "Zone001_Cluster_500_Sector001_macro"="-127062.5,0,133718.8"
     "Zone004_Cluster_501_Sector001_macro"="103164.1,0,-32492.19"
     "tzoneCluster_500_Sector001SHCon4_GateZone_macro"="76886.7,0,-207957"
     "Zone006_Cluster_502_Sector001_macro"="47000.0,0,172000.0"
     "Zone002_Cluster_500_Sector003_macro"="44015.63,0,158125"
     "tzoneCluster_500_Sector001SHCon6_GateZone_macro"="-55785.2,0,-200000"
     "Zone002_Cluster_501_Sector001_macro"="-10960.94,0,112070.3"
     "Zone001_Cluster_500_Sector002_macro"="-78593.63,0,157937.5"
     "Zone003_Cluster_503_Sector001_macro"="-199365.3,0,-55454.45"
     "Zone001_Cluster_502_Sector001_macro"="-127062.5,0,133718.8"
     "Zone003_Cluster_504_Sector001_macro"="-226443.3,0,-97194.67"
     "Zone005_Cluster_500_Sector001_macro"="-23023.44,0,-160132.8"
     "Zone004_Cluster_500_Sector003_macro"="110359.4,0,7250"
     "Zone001_Cluster_503_Sector001_macro"="-190039.3,0,180073.9"
     "Zone005_Cluster_502_Sector001_macro"="-23023.44,0,-160132.8"
     "Zone004_Cluster_500_Sector002_macro"="101721.7,0,100656.3"
     "Zone002_Cluster_502_Sector001_macro"="108009.3,0,115933.7"
     "Zone004_Cluster_502_Sector001_macro"="103164.1,0,-32492.19"
}

#Get offsets up the tree
function Recurse-Offsets($node){
    if($node.class -and $node.class -eq "galaxy"){
        return @()
    }
    if($node.offset -ne $null){
        if($node.offset.position){
            $x=$node.offset.position.x
            $y=$node.offset.position.y
            $z=$node.offset.position.z
        } else {
            $x,$y,$z=0,0,0
        }
        if($node.offset.rotation){
            if($node.offset.rotation.yaw){$yaw=$node.offset.rotation.yaw} else {$yaw=0}
            if($node.offset.rotation.pitch){$pitch=$node.offset.rotation.pitch} else {$pitch=0}
            if($node.offset.rotation.roll){$roll=$node.offset.rotation.roll} else {$roll=0}
        } else {
            $pitch,$roll,$yaw=0,0,0
        }
        if($macrotocoords[$node.macro]){
            $x,$y,$z=$macrotocoords[$node.macro].Split(",")
        }
        $obj = [pscustomobject]@{
            x=$x
            y=$y
            z=$z
            pitch=$pitch
            roll=$roll
            yaw=$yaw
            code=$node.code
            macro=$node.macro
            class=$node.class
        }
        return @($obj) + (Recurse-Offsets -node $node.ParentNode)
    } else {
        return Recurse-Offsets -node $node.ParentNode
    }
}

$data=. {
    foreach($vault in $vaults){
        $data=Recurse-Offsets $vault.Node
        $sums = $data | Measure-Object -Sum -Property x,y,z
        $location = $data |?{$_.class -eq "sector"} | select -ExpandProperty macro
        if([string]::IsNullOrWhiteSpace($location)){
            $location = $data |?{$_.class -eq "cluster"} | select -ExpandProperty macro
        }
        [pscustomobject]@{
            location=$locationtoname[$location]
            Xkm=($sums |?{$_.property -eq "x"}).sum/1000
            Ykm=($sums |?{$_.property -eq "y"}).sum/1000
            Zkm=($sums |?{$_.property -eq "z"}).sum/1000
            blueprint=$vault.Node.connections.connection.component.blueprints |?{$_ -ne $null}
            vault=$vault.Node.macro
            code=$vault.Node.code
        }
    }
} 
$data | ft -AutoSize
$data | Out-GridView
if($gzip){
    if([System.Windows.Forms.MessageBox]::Show("Remove the extracted save $file" , "Remove Save?" , 4, 64) -eq "Yes"){
        Remove-Item -Path $file
    }
}

[System.Windows.Forms.Messagebox]::Show("Done, you can copy out of the cmd window or grid view before closing this if you want.")

<#
#Some other useful snippets

#detailed output
. {
    foreach($vault in $vaults){
        Recurse-Offsets $vault.Node
        "-----"
    }
} | ft -AutoSize

#parse out zone info
$zoneinfo = [xml](gc c:\path\to\dlc_pirate_sectors.xml)
$hash = @{}
$zoneinfo.macros.macro | %{
    $_.connections.connection | %{
        $hash += @{$_.macro.ref = $_.offset.position } 
    }
}
# Generate a powershell hash for the above xml and put it on the clipboard
"@{`n" + ($hash.GetEnumerator() |%{"    `"$($_.key)`"=`"$(@($_.value.x,$_.value.y,$_.value.z) -join ",")`"`n"}) + "}" | clip
$components=Select-Xml -Xml $Xml -XPath "/savegame/universe//component"
# Get all classes
$components.Node.class | select -Unique | sort

order of map related:
    galaxy
    cluster
    sector
    zone
#>

I'm sorry, but how do I run this?
Download file and run it (just double click). It will open a Windows command prompt window. You'll get an information prompt that the process will take quite some ram, just click that away. next the file should automatically open a path to your X4 savegame folder. Open folder and double click on the savefile you want to scan, then let it run. Once it's done you'll get a read out on the sector and coordinates for each vault. You'll also be able to tell which blueprints you already have in case you haven't marked the vaults you already found.

DrakeReborn
Posts: 1
Joined: Fri, 6. Feb 04, 08:23
x2

Re: Acquire the Erlking?

Post by DrakeReborn » Wed, 28. Dec 22, 01:18

Not sure if this has been posted already (too much to read through! :D).

If you're not averse to editing your save (which I'm guessing not based on what I have read), then simply taking ownership of the vaults will make them show up on your map.

In the decompressed save file, search for "landmarks_erlking_vault" (no quotes) and change the owner attribute to "player" instead of "unknown". Once you've loaded the savegame, search for "data" or "vault" on the map and look for green vaults in the Avarice-related sectors.

EZPZ, no satellite spam or coordinate ninja skills required!

Starlight_Corporation
Posts: 1262
Joined: Thu, 17. Feb 05, 16:51
x4

Re: Acquire the Erlking?

Post by Starlight_Corporation » Tue, 3. Jan 23, 19:08

For folks dreading the datavault search, it isn't always like this, below was my experience looking for them.

Dreaded doing the Erlking datavault hunt after this thread. Initial attempts only reinforced the dread, scouted out all Windfall sectors with my scouts, found nothing. Decided to venture at last into Avarice, with little hope. Didn't visit the sector prior to this in the game. Avarice IV; nothing. Welp. Then the tide turned. Found 3 datavaults in Avarice I, 2 within sight distance of the gates (they show up as 'unidentified object' when you get within 80-90km). 3rd vault was just beyond the shipyard there.
As you figured, last two datavaults were in Avarice Dead End, one within gate viewing distance & other hidden in one of the dustclouds there (still shows up visually if you come within 80 km range of it).

With all the problems reported in this thread, thought I'd post my search for them. Not sure if the 80 km visual range thing is new tho. Note they don't show on scanners before you get close, but by looking around with your ship, you can see a target bracket with 'unidentified object', this really helped with finding them, as the 30/40km radar range definitely is too short for it & they're too small to find visually without the targeting bracket.
Now's the next part... build an XL shipyard solely to install these things on the Erlking.
Last edited by Starlight_Corporation on Wed, 4. Jan 23, 03:14, edited 1 time in total.

Alan Phipps
Moderator (English)
Moderator (English)
Posts: 30349
Joined: Fri, 16. Apr 04, 19:21
x4

Re: Acquire the Erlking?

Post by Alan Phipps » Tue, 3. Jan 23, 20:41

@ Sunlight_Corporation: The 5.10 changelog for 7 Apr 2022 includes: "* Improved visibility of Long Range Scan ping of Erlking Vaults." should that help at all.
A dog has a master; a cat has domestic staff.

Starlight_Corporation
Posts: 1262
Joined: Thu, 17. Feb 05, 16:51
x4

Re: Acquire the Erlking?

Post by Starlight_Corporation » Wed, 4. Jan 23, 03:26

Alan Phipps wrote:
Tue, 3. Jan 23, 20:41
@ Sunlight_Corporation: The 5.10 changelog for 7 Apr 2022 includes: "* Improved visibility of Long Range Scan ping of Erlking Vaults." should that help at all.
That is odd, tried finding the 2 vaults that weren't in visual range through long range scans, but didn't show. No blue/purple ping, unless I was close already (30-40 km, tried it on the ones I found first to check what colour ping they would return) & by then I could see the visual indication of the target bracket already.
Note, I am aware I am lucky in finding those last two datavaults so easy in the last two sectors, they just were inside the base sector boundaries, so didn't had to travel far from stations to spot them.
Last two I found by flying around a bit as long range scan pings failed to return pings at longer ranges. (Katana's great for it, covers large distances fast).
Furthest of the 3 vaults that I could spot immediately was at 80 km from the gate I entered, which seems close to max visual spotting range for them (when you get the target bracket with 'unidentified object')

klg90
Posts: 55
Joined: Wed, 19. Dec 18, 16:52
x4

Re: Acquire the Erlking?

Post by klg90 » Tue, 7. Feb 23, 15:04

so by using the method by "Mikhaleech", I've managed to get all of the erlking parts except for the large turrets, the code for the missing one is below...
component class="object" macro="landmarks_erlking_vault_04_macro" connection="space" code="UYW-193" id="[0x848c9]">
<source class="script"/>
<connections>
<connection connection="connection_pickup001" macro="connection_pickup001">
<component class="collectableblueprints" macro="props_sm_container_xs_erlking_blueprint_04_macro" connection="connection01" code="OIC-212" blueprints="turret_pir_l_battleship_01_laser_01_mk1" id="[0x848ca]">

as you can see it doesn't give the option to modify

also the other one
component class="object" macro="landmarks_erlking_vault_05_macro" connection="space" attackmethod="hitbybullet" attacktime="1929893.822" shipattacktime="1929893.822" intentionalattacktime="1929893.822" code="LKK-096" knownto="player" id="[0x81b23]">

this is a pre 5.00 save..

ajime
Posts: 335
Joined: Mon, 15. May 17, 09:00
x4

Re: Acquire the Erlking?

Post by ajime » Mon, 13. Mar 23, 13:32

Mikhaleech wrote:
Wed, 23. Mar 22, 17:04
Ok Gentlements, instead of ridicoulous method, provided by Egosoft, here is a quick workaround to easy find all Erlking's Data Vaults:

Step 1. Temporarily turn off Steam Cloud sync in Steam properties. You may switch it on later.
Step 2. Temporarily turn off savegame compression in X4 game properties. You may switch it on later.
Step 3. Save your game in any slot, copy it somewhere for insurance. Quit the game.
Step 4. Download and install Notepad++ (if you didnt have it yet) or other more powerful XML edit program.
Step 5. Find and open with Notepad++ your savegame file. Usually it is located here - C:\Users\YOURNAME\OneDrive\Documents\Egosoft\X4\68221126\save
Step 6. Now sequentially find and fix all 5 strings with Erlking Vaults locations, to do so:
A. ctrl+F - find "landmarks_erlking_vault_01_macro". The first string shall be like this:
<component class="object" macro="landmarks_erlking_vault_01_macro" connection="space" code="BXD-821" owner="ownerless" knownto="player" id="[0x81bda]">
B. REPLACE in this string owner="ownerless" to owner="player"
C. Repeat the same operation with all subsequent strings from macro="landmarks_erlking_vault_01_macro" to macro="landmarks_erlking_vault_05_macro", where you should find and replace the owner for all numbers of vault_01, vault_02, etc.
Step 7. Dont forget to save the edited file. Then run the X4 game, load your edited savegame file.
Step 8. Open the map, position the view over new Avarice and Windfall sectors and type in the Search box (right upper corner of window) the word "data"
Step 9. PROFIT! All blueprints shall be added to you right after you fly near data vaults that deemed now as your property.

Yes this surgical operation shall mark your savegame as modified. I suppose the game verify a checksum. In that case consider to have two saves in different slots and simply remember or take a screenshot of vaults positions, then load clean save after and find them manually in all already known locations.
I finally gave up and used this approach and backup save scum my way to get the last blueprint. having no breadcrumbs/pings that do not hit 200km below elliptic line ensures it never to be found even after all map fog is out by minions after more than 24 hours. That is not a fun. Truly awful.

Dahkteromar
Posts: 8
Joined: Mon, 26. Aug 13, 15:39

Re: Acquire the Erlking?

Post by Dahkteromar » Fri, 21. Apr 23, 06:12

silentradios wrote:
Sun, 27. Mar 22, 14:51
Edit 3/27: Apparently Avarice V and IV were swapped (I got the friendly name mapping from reddit - not sure where a real source is) -- I confirmed in my save and two others did as well

Here is a bat file that runs the powershell inside it (sneaky.. but effective) : https://anechoic.space/erlkinggui.bat
It has a few features over the previous script including:
  • A File selection dialog
  • Support for gz / compressed saves
  • GUI output of the positions
Here is the same script that you can copy and past and save into a .bat file (use notepad and save as UTF-8 or ANSI (do not select the with BOM ones) and run to avoid the prompts that you get from windows about it being safe or not..
Thank you!

This was a godsent! I literally wasted my entire day trying to find the vaults. I was missing one and ofc it was in a system where there were 2 already.
When you need tools like this to find something in a game then you know it is an awfully horrendously bad game design...
Dahkteromar

mp63
Posts: 123
Joined: Tue, 24. Feb 04, 19:32
x3

Re: Acquire the Erlking?

Post by mp63 » Fri, 21. Apr 23, 15:56

Berhg wrote:
Fri, 18. Mar 22, 02:37
Any suggestion how to quickly and efficiently locate these data vaults?

Flying around in a fast ship and pinging long range scan hasn't shown me one goddam vault in the new DLC sectors, even though I'm using a search pattern to try and systematically cover all areas within a reasonable distance of center.

I guess it doesn't help that I absolutely DETEST this activity.

I mean, I beat all the other shit in this DLC, I want the GODDAM BATTLESHIP! This game needs more battleships.
They drop at random locations (in the avarice dlc sectors) and some are ridicolous far out of the x plane (300+ km) so long range scan won't work. Plastered the whole sectors with satellites and still didn't find all 5. You can try above or below and scan until you find them ... or spoiler... scan your save file for their locations. :idea:

User avatar
chew-ie
Posts: 5374
Joined: Mon, 5. May 08, 00:05
x4

Re: Acquire the Erlking?

Post by chew-ie » Fri, 21. Apr 23, 16:16

mp63 wrote:
Fri, 21. Apr 23, 15:56
Berhg wrote:
Fri, 18. Mar 22, 02:37
Any suggestion how to quickly and efficiently locate these data vaults?

Flying around in a fast ship and pinging long range scan hasn't shown me one goddam vault in the new DLC sectors, even though I'm using a search pattern to try and systematically cover all areas within a reasonable distance of center.

I guess it doesn't help that I absolutely DETEST this activity.

I mean, I beat all the other shit in this DLC, I want the GODDAM BATTLESHIP! This game needs more battleships.
They drop at random locations (in the avarice dlc sectors) and some are ridicolous far out of the x plane (300+ km) so long range scan won't work. Plastered the whole sectors with satellites and still didn't find all 5. You can try above or below and scan until you find them ... or spoiler... scan your save file for their locations. :idea:
Use this bat-file: viewtopic.php?p=5116566#p5116566
(also see one post above yours)

It's really awesome and you can use it without manipulating your savegame - it basically extracts the coordinates and gives you information about what you find where. You then can move your scout to those locations, drop a satellite and open the data vault.

Image

Spoiler
Show
BurnIt: Boron and leaks don't go well together...
Königinnenreich von Boron: Sprich mit deinem Flossenführer
Nila Ti: Folgt mir, ihr Kavalkade von neugierigen Kreaturen!

:idea: Pick your poison seed [for custom gamestarts]

Dahkteromar
Posts: 8
Joined: Mon, 26. Aug 13, 15:39

Re: Acquire the Erlking?

Post by Dahkteromar » Sat, 22. Apr 23, 05:48

Starlight_Corporation wrote:
Tue, 3. Jan 23, 19:08
Now's the next part... build an XL shipyard solely to install these things on the Erlking.
You "only" need an XL maintenance piece (Equipment Dock) to install the pieces which is considerably cheaper than a Building Module for XLs.
Dahkteromar

truckie024
Posts: 49
Joined: Sat, 5. Aug 06, 00:52
x4

Re: Acquire the Erlking?

Post by truckie024 » Sun, 30. Apr 23, 11:25

Is there a limited time to get the earlking, i noted today that the ship has vanished from its location
MOBO asus maximus ix extreme
CPU 7800 intel i7
Ram 64gb
Graphics 2080 rtx TI XC 11GB ram
2X m.2 2TB drives
Water cooling Koolance exos 2.5

Alan Phipps
Moderator (English)
Moderator (English)
Posts: 30349
Joined: Fri, 16. Apr 04, 19:21
x4

Re: Acquire the Erlking?

Post by Alan Phipps » Sun, 30. Apr 23, 15:20

Not unless any mods/edits you might have were to remove it. Otherwise suspect a corrupted game installation or save - as long as you are looking in the right place.
A dog has a master; a cat has domestic staff.

truckie024
Posts: 49
Joined: Sat, 5. Aug 06, 00:52
x4

Re: Acquire the Erlking?

Post by truckie024 » Mon, 1. May 23, 09:43

Hmmm...i have changed nothing in game, must be a glitch tgen as the other day i had to restart pc as wouldnt load
MOBO asus maximus ix extreme
CPU 7800 intel i7
Ram 64gb
Graphics 2080 rtx TI XC 11GB ram
2X m.2 2TB drives
Water cooling Koolance exos 2.5

paraskous
Posts: 585
Joined: Wed, 25. Apr 07, 13:42
x4

Re: Acquire the Erlking?

Post by paraskous » Wed, 3. May 23, 21:26

*doh*

The vaults can be in Windfall, too? That means I found actually the Avarice vaults by myself.

Post Reply

Return to “X4: Foundations - Spoilers”