Acquire the Erlking?

Please post any spoilers for X4: Foundations here.

Moderator: Moderators for English X Forum

Mr.Killer
Posts: 730
Joined: Sat, 29. Jan 11, 22:11
x4

Re: Acquire the Erlking?

Post by Mr.Killer »

Nanook wrote: Sat, 16. Mar 24, 04:30
Mr.Killer wrote: Fri, 15. Mar 24, 23:16
Alan Phipps wrote: Fri, 15. Mar 24, 12:22 You can build an Erlking from a blueprint after PHQ research which unlocks only if you lose the Erlking you already owned. You were intended to only ever have one at any one time.
Weird rule: Oh, you have blueprints, however cheaply aquired, but you can only make one of them. Is hardly a blue print, more a one-time lose print! :lol:
Not "one time", more like one at a time, for every time you lose it, I believe. :wink:
HUH?? So when I lose it, I can build one again?

Like a nice cup of coffee, only one fits in my cup, and only when it's empty, then I can fill it??? again???
That is somewhat a satisfying thought, but I liked my interpretation of 'blue-print / lose-print' I found it a witty remark and rather funny, but Nanook, I hope you are right.
Ps. Computers can make errors, they are made and programmed by error-making humans. :D
Mr.Killer
Posts: 730
Joined: Sat, 29. Jan 11, 22:11
x4

Re: Acquire the Erlking?

Post by Mr.Killer »

This sounds very awkward but at one point Boso was able to re-invent the powercore again :? , so I could build another Erlking, however, when I wanted a third, I ran into the same problem, no powercore. Looking at research and there the whole section about the Erlking was gone. :gruebel:

My question actually is: Please explain the background info about this weird behavior, please, because I really don't understand anything about this.

Thanks.
Ps. Computers can make errors, they are made and programmed by error-making humans. :D
Alan Phipps
Moderator (English)
Moderator (English)
Posts: 31449
Joined: Fri, 16. Apr 04, 19:21
x4

Re: Acquire the Erlking?

Post by Alan Phipps »

It's simple. The vanilla game intends that the Erlking be 'special' and so is intended to prevent you from having more than one at a time. If you have two in plain vanilla then that is a bug somewhere such as a situation unforeseen by the devs.
A dog has a master; a cat has domestic staff.
Mr.Killer
Posts: 730
Joined: Sat, 29. Jan 11, 22:11
x4

Re: Acquire the Erlking?

Post by Mr.Killer »

Keep those bugs coming then, I love the power of the unforseen in our benefit :lol:

Serious though, if this is a bug, I can't really give a savegame at this point because I use the steam provided 'help' (or plainly cheat) to just make some things a bit easier. I hate to get killed in a battle if I am not the only one present but being targetted by most enemies, so my reasoning is, if they can cheat, I can too.

(This is with a lot of games, the non-AI is always a high priority target, as I have noticed over the years playing different games with bots.) (Not claiming something that needs to be changed.)
Ps. Computers can make errors, they are made and programmed by error-making humans. :D
Nanook
Moderator (English)
Moderator (English)
Posts: 28200
Joined: Thu, 15. May 03, 20:57
x4

Re: Acquire the Erlking?

Post by Nanook »

Well, you, as the player, are the center of the universe, and the most powerful adversary. So it stands to reason you're the priority target. As in most games. :eg:
Have a great idea for the current or a future game? You can post it in the [L3+] Ideas forum.

X4 is a journey, not a destination. Have fun on your travels.
Endoryl
Posts: 25
Joined: Wed, 7. Dec 11, 10:25

Re: Acquire the Erlking?

Post by Endoryl »

chew-ie wrote: 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.
Indeed a very nice gimmick to extract the data vault positions!
I'm usually a zealous anti-cheater in games.
But these vault locations are so poorly implemented that I don't feel the slightest bit of remorse here using this tool.
Searching 10's of hours for these vaults, 100's of km outside the "normal" planes. Thx but no thx. Not my defenition of fun.
Many many thanks to the creator of the bat file. Saved me lots of frustration in consequent playthroughs.
dalton5
Posts: 54
Joined: Wed, 3. Nov 04, 21:59
x4

Re: Acquire the Erlking?

Post by dalton5 »

Hello, How can I find the x, y, z position of my ship. Thanks in advance
RainerPrem
Posts: 4442
Joined: Wed, 18. Jan 06, 07:39
x4

Re: Acquire the Erlking?

Post by RainerPrem »

dalton5 wrote: Tue, 3. Sep 24, 17:06 Hello, How can I find the x, y, z position of my ship. Thanks in advance
E.g. Fly to the center of the sector. It mostly is (0,0,0). Then you can check the distances and angles to gates and factories.
Redi
Posts: 1
Joined: Thu, 10. Oct 24, 15:55

Re: Acquire the Erlking?

Post by Redi »

So how do i actually use the coordinates that the batch file gives me?
Alan Phipps
Moderator (English)
Moderator (English)
Posts: 31449
Joined: Fri, 16. Apr 04, 19:21
x4

Re: Acquire the Erlking?

Post by Alan Phipps »

Just consider x, y, z coords as relative to the 0,0,0 position in the centre of the sector. I can't think of any other way to explain it. Flying there is a matter of picking some reference item in the middle of the sector and then checking your distance and direction relative to it until it approximately matches the coords you want to get to, then start scanning.
A dog has a master; a cat has domestic staff.
RubyRezal
Posts: 148
Joined: Tue, 26. Apr 22, 17:30
x4

Re: Acquire the Erlking?

Post by RubyRezal »

EDIT: Error happened when I tried to run it on the compressed save file. It worked fine on a manually decompressed save file.
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
Edit 6/2/23: Thanks jojorne for catching an issue related to the GUI for compressed saves

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 = 'Save file (*.xml; *.xml.gz)|*.xml;*.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 trying to use this PowerShell script but it doesn't seem to work for me. This is the error I'm getting, I'm not sure how to fix it.

Code: Select all

You cannot call a method on a null-valued expression.
At line:13 char:9
+         $output.Write($buffer, 0, $read)
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull
User avatar
alt3rn1ty
Posts: 3080
Joined: Thu, 26. Jan 06, 19:45
x4

Re: Acquire the Erlking?

Post by alt3rn1ty »

dalton5 wrote: Tue, 3. Sep 24, 17:06 Hello, How can I find the x, y, z position of my ship. Thanks in advance
Redi wrote: Thu, 10. Oct 24, 15:57 So how do i actually use the coordinates that the batch file gives me?
Have a read of this post ..
viewtopic.php?p=5200430&sid=b3a95af8b60 ... 0#p5200430
.. See if that helps at all.
Laptop Dell G15 5510 : Win 11 x64
CPU - 10th Gen' Core I7 10870H 2.2-5.0ghz, GPU - NVidia Geforce RTX 3060, VRAM 6gb GDDR5,
RAM - 32gb (2x16gb, Dual Channel mode set in BIOS) DDR4 2933mhz Kingston Fury Impact,
SSD - Kioxia M.2 NVME 512gb (System), + Samsung M.2 NVME 970 Evo Plus 1tb (Games)

:goner: Seeker of Sohnen.
Long live Queen Polypheides, and may her tentacles always be supple. :boron:
Candaan001
Posts: 69
Joined: Mon, 25. Oct 21, 06:33
x4

Re: Acquire the Erlking?

Post by Candaan001 »

https://roguey.co.uk/x4/universe/

Click into the map and it gives you reference coordinates for fixed things like system gates.
Works for me every time.

Return to “X4: Foundations - Spoilers”