How to navigate through XML files ? Game general database ?

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
Dreej
Posts: 5
Joined: Tue, 9. May 23, 07:47
x4

How to navigate through XML files ? Game general database ?

Post by Dreej » Wed, 17. May 23, 05:52

Hello everyone,

First, i'm not here to make a MOD, i quite like the game as it is.
My only goal here, is to have some little help about how, or where, i could find a "general database" of the game.
Or how to navigate through the XML files.

For instance, where can i find that this "macro" -> "struct_arg_base_02_macro" is equal to this "item" in the game named as "xxxxxxxxx".
Or vice versa, where or/and how can i find that "Cobra" = "ship_spl_xxx_xxx_xxx" ?

I've extracted all the XML files with X Catalog Tool, but i have no idea how to navigate through these easier than just selecting files inside VS Code.

I need to insist that i do not want to edit any existing game files, i just want to read existing informations.

Thank you to any of you that would take some time to help me :)

DeadAirRT
Posts: 1008
Joined: Fri, 25. Jan 19, 03:26
x4

Re: How to navigate through XML files ? Game general database ?

Post by DeadAirRT » Wed, 17. May 23, 13:38

In most files they will have something similar to name="{20101,11002}" which is a translation file name. If you look in the t-file folder, you will find different files named similar to 0001-l044 which contains the different languages the names are translated into.

Dreej
Posts: 5
Joined: Tue, 9. May 23, 07:47
x4

Re: How to navigate through XML files ? Game general database ?

Post by Dreej » Wed, 17. May 23, 14:02

I finally figured this myself yep, by browsing the files and searching on VS Code.
But, do i need to build myself a tool to extract the data i need more easily ?
Or is there something i'm not aware of ?

FanUS
Posts: 69
Joined: Mon, 13. Mar 23, 03:48
x4

Re: How to navigate through XML files ? Game general database ?

Post by FanUS » Wed, 17. May 23, 21:22

The quick and dirty way to mod the game is by changing the macro files direct. All the units, surface element, engine, weaponfx are all in the assets folder. Assets/Props, and Assets/fx, are the two places for pretty much all the ships, s, m, l, xl, shields, engines and all the weapon bullet properties.

Realspace
Posts: 1342
Joined: Wed, 15. Nov 06, 10:21
x4

Re: How to navigate through XML files ? Game general database ?

Post by Realspace » Thu, 18. May 23, 07:00

First of all take a look at this guide for patching the xml:
viewtopic.php?f=129&t=354310
For finding which file contains a macro, use an editor like notepad++ to make advanced search in all the folder that in our case will be the folder containing all the extracted files of the game, in their identical root.

Dreej
Posts: 5
Joined: Tue, 9. May 23, 07:47
x4

Re: How to navigate through XML files ? Game general database ?

Post by Dreej » Thu, 18. May 23, 07:24

Thank you guys, but as i said, i do not want to add, replace or remove.
I just want to see, to read the existing.

But i guess i got my answer : there's no database from which i can query data precisely and there are no tools to just read the XML files in a more "user-friendly" way if i may so.
If i do want this tool, i'll have to build my own database to be used in a second step for a website or equivalent.

Realspace
Posts: 1342
Joined: Wed, 15. Nov 06, 10:21
x4

Re: How to navigate through XML files ? Game general database ?

Post by Realspace » Thu, 18. May 23, 07:35

Yup, I did not read carefully. There are a couple of tools that work on the level you require, even if they do it for modding: X4 Editor and X4 Customizer, you find in the sticky post listing all mods. X4 editor has at least an internal database for ships and engines. Sorry not to give the link but I am writing from a phone.

But if you specify what part interests you: map, ships? We can point to the main files. For instance the galaxy database is managed by galaxy.xml, mapdefaults.xml and the T file containing all names (galaxy's too).

Dreej
Posts: 5
Joined: Tue, 9. May 23, 07:47
x4

Re: How to navigate through XML files ? Game general database ?

Post by Dreej » Thu, 18. May 23, 07:53

I figured where were the informations i wanted in the end. :D
Thanks.

It's just silly for me to query data from the VSCode search engine that will give results i won't be able to use other than by my direct brain.
And i have no knowledge of XML tech whatsoever compared to what i know and can do with SQL or Json for instance.

So, if my ultimate goal is to build a calculator (wares) for ships depending on the "fitting", i'll have to first build a database out from the XML files.
And, then, use it to build my website.

But as i have now built my very first Warf, i realise that such a calculator is not very much necessary.
I was surprised at first that there were a Station Calculator, but none for Ships, now i kind of get why. :)

Thank you anyway !

Post Reply

Return to “X4: Foundations - Scripts and Modding”