[TUTORIAL] X Rebirth - Modding Guide

The place to discuss scripting and game modifications for X Rebirth.

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

Fiede
Posts: 8
Joined: Sun, 21. Dec 03, 18:07
x3

Post by Fiede » Sun, 17. Nov 13, 09:55

Hi all!

I have some problems with modding....

I won't say i am inexperienced with modding...but I have no clue what I could possibly miss here.

I tinkered with some of the payership upgrades. To test, I tried to mod the supercharged engine to a top speed of 2400 (10x). But it won't show up in game.

I put the whole xml file there...after it did nothing I thought that it might NEED the patch-xml thing so I did that. But it still didn't altered it.

My directories are exactly like in the cat-files, spell-checked them countless times...the extension shows up in the menu in game and is activated...but it seems like the files are just ignored.

I had some problems with the extraction tools that got posted here. It was a .net error stated, that the path length exceeded 256 characters...I had to move the cat files to another location out of the steam library and extract them there and that worked.

Could it be, that this is the problem also for the game? I guess the path will be called relative to the game install dir? So it shouldn't...

Has someone an idea?

Greetings

Fiede

EDIT: BTW, I used the mod to enable debug menu which works fine. I integrated it in my mod...so it loads at least the one file from the other mod.

The path to the file that is ignored is:
D:\Program Files (x86)\SteamLibrary\SteamApps\common\X Rebirth\extensions\Fiede\assets\props\EngineSystems\macros\engine_player_spe_mk2_macro.xml

The path to the working mod file (debug menu) is:
D:\Program Files (x86)\SteamLibrary\SteamApps\common\X Rebirth\extensions\Fiede\md\MainMenu.xml

None of them is exceeding the 256 character limit...

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

Thanks a lot for the guide!

Post by Realspace » Sun, 17. Nov 13, 21:03

Hi Observe and as first a big thanks for this guide!! This .xml structure resembles a lot how Freelancer was scripted and it has big potentiality for building many easy modification softwares for creating a big populated universe, it seems at least that in this regard the game did not disappoint!

One question..well I'd have many but I start from the most needed.

1) If I replace the content of the zonehighways.xml with an empty file then all the highways disappear from game (except the superhighways)? That would be great..I can't stand these useless roads and the minigame, but this brings me to quest. nr.2) Could you poit me to the file controlling the shield drain when using the turboboost so I can remove it and use the boost instead of the highways? Thank you! :wink:

Takei
Posts: 24
Joined: Tue, 23. Mar 10, 17:37
x4

Post by Takei » Sun, 17. Nov 13, 21:19

Fiede wrote:Hi all!

I have some problems with modding....

I won't say i am inexperienced with modding...but I have no clue what I could possibly miss here.

I tinkered with some of the payership upgrades. To test, I tried to mod the supercharged engine to a top speed of 2400 (10x). But it won't show up in game.

I put the whole xml file there...after it did nothing I thought that it might NEED the patch-xml thing so I did that. But it still didn't altered it.

My directories are exactly like in the cat-files, spell-checked them countless times...the extension shows up in the menu in game and is activated...but it seems like the files are just ignored.

I had some problems with the extraction tools that got posted here. It was a .net error stated, that the path length exceeded 256 characters...I had to move the cat files to another location out of the steam library and extract them there and that worked.

Could it be, that this is the problem also for the game? I guess the path will be called relative to the game install dir? So it shouldn't...

Has someone an idea?

Greetings

Fiede

EDIT: BTW, I used the mod to enable debug menu which works fine. I integrated it in my mod...so it loads at least the one file from the other mod.

The path to the file that is ignored is:
D:\Program Files (x86)\SteamLibrary\SteamApps\common\X Rebirth\extensions\Fiede\assets\props\EngineSystems\macros\engine_player_spe_mk2_macro.xml

The path to the working mod file (debug menu) is:
D:\Program Files (x86)\SteamLibrary\SteamApps\common\X Rebirth\extensions\Fiede\md\MainMenu.xml

None of them is exceeding the 256 character limit...

Having the same Problem as Fiede. Someone found the error yet?

here is my assets folder. I just can't find the mistake i made.....

https://dl.dropboxusercontent.com/u/90634021/assets.zip

User avatar
Observe
Posts: 5079
Joined: Fri, 30. Dec 05, 17:47
xr

Re: Thanks a lot for the guide!

Post by Observe » Sun, 17. Nov 13, 21:30

Realspace wrote:Hi Observe and as first a big thanks for this guide!!
Thank you. It is my pleasure if I can help jump-start Rebirth modding in some small way. :)
Realspace wrote:This .xml structure resembles a lot how Freelancer was scripted and it has big potentiality for building many easy modification softwares for creating a big populated universe, it seems at least that in this regard the game did not disappoint!
Absolutely! The modding potential with this game is huge.
Realspace wrote:1) If I replace the content of the zonehighways.xml with an empty file then all the highways disappear from game (except the superhighways)? That would be great..I can't stand these useless roads
I wouldn't apply an empty file, because other files make reference to entries within zonehighways. Probably the best way would be to delete the "splinetube" entries using the "diff patch" method.

I agree with you the game is better without the local highways. Removing the highways is one of the first things I looked into, because I don't like the highway tubes strewn all over the place like some sort of hillbilly space junkyard. There are other things that need doing to compensate for the lack of highways, but personally that's the direction I am leaning with mods I have in the hopper.
Realspace wrote:2) Could you poit me to the file controlling the shield drain when using the turboboost so I can remove it and use the boost instead of the highways? Thank you! :wink:
I found that at one point, but I can't remember off-hand which file it is. Yes, if you are going to remove the highways, it makes sense having longer boost time. Either that, or traveling on other ships works well too. :wink:

If I was to develop a mod (and if you weren't already doing it), one of the first would be what I think you are looking at - better backgrounds and removal or reduction of local highway tubes cluttering up what might otherwise be a nice scene. :)

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

Re: Thanks a lot for the guide!

Post by Realspace » Sun, 17. Nov 13, 21:48

Observe wrote: If I was to develop a mod, one of the first would be what I think you are looking at - better backgrounds and removal or reduction of local highway tubes cluttering up what might otherwise be a nice scene. :)
Yeah..you know, we all remember discussing about this in the previous games :wink: if finally a better space experience can be added this must be the start for any mod, at least let's start with immersion!

I'm happly replacing the starbox for the moment and it works. About the lanes..you mean I leave the entries (<macro name="Highway01Sector01_macro") but remove only the reference to the splintubes? I still don't understand how the root works, should I modify also the other files in the hierarchy, mean galaxy.xml and sectors.xml (wherever there is a reference to zonehighways.xml) and replace the references with the url "extensions/MYMOD/map/etc"?

For replacing the skybox I had to replace the ref in the libraries/material_library.xml, what about highways?

Of course thanks alot for the help!! and in case you remember the file regulating the ship's booster... :D

User avatar
Observe
Posts: 5079
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe » Sun, 17. Nov 13, 22:21

Without having giving this a lot of thought (therefore prone to error), it occurs to me you probably want to work with sectors.xml instead of zonehighways. I would look at creating a replacement sectors.xml contained within your mod maps folder using <diff> root with <replace sel.../> . You will see example usage of that in my mod file accompanying the guide.

Basically, you can replace everything below <macros> with a new version having removal of zonehighways connections. Keep in mind, these files are likely to undergo changes as Egosoft optimizes and evolves the game. As such, you would have to keep an eye on updates. But then, that's kind of par for the course in modding as you know.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Sun, 17. Nov 13, 22:56

for those who want to just tinker with the game a hint: copy the xml you want to edit in the same folder where it belongs in the root folder of the game and change the file ending to pck - this gives it priority over xml ;) for some reason patch xmls are required for use in the extensions-folder as i found out today, so for tinkering with the game i think its the best to extract the game files in the root folder and work with a pck copy of the files you want to change. so you can try it outttt and KNOW that YOUR files are used, and when you are done you can compare it with the original xml file and make an extension from it ;)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

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

what about the <remove>?

Post by Realspace » Sun, 17. Nov 13, 22:57

Observe wrote:Without having giving this a lot of thought (therefore prone to error), it occurs to me you probably want to work with sectors.xml instead of zonehighways. I would look at creating a replacement sectors.xml contained within your mod maps folder using <diff> root with <replace sel.../> . You will see example usage of that in my mod file accompanying the guide.

Basically, you can replace everything below <macros> with a new version having removal of zonehighways connections. Keep in mind, these files are likely to undergo changes as Egosoft optimizes and evolves the game. As such, you would have to keep an eye on updates. But then, that's kind of par for the course in modding as you know.
Can't I use the remove function? such as

Code: Select all

<diff>
	<!-- Lane Abolition --> 
<remove sel="/macros/macro[@name='Highway01Sector01_macro']/connections"> 
<macro name="Highway01Sector01_macro" class="highway">
     </remove> 
</diff> 
Well at least this was my attempt with the zonehighways.xml but even changing it with a blank file did not change anything in the game, I'll try with sectors
UniTrader wrote:for those who want to just tinker with the game a hint: copy the xml you want to edit in the same folder where it belongs in the root folder of the game and change the file ending to pck - this gives it priority over xml ;) for some reason patch xmls are required for use in the extensions-folder as i found out today, so for tinkering with the game i think its the best to extract the game files in the root folder and work with a pck copy of the files you want to change. so you can try it outttt and KNOW that YOUR files are used, and when you are done you can compare it with the original xml file and make an extension from it ;)
Thanks for the info UniTrader, you mean for example if I put the zonehighways.xml of my own in the "MAINROOT/maps/XU_ep1_universe" folder instead of "MAINROOT/extensions/mapsXU_ep1_universe" it will have the priority over the same file contained inside the DAT? Do I simply rename it to .pck (no compression?)?

EDIT
@UniTrader Yes it worked, mean I added the folowing:

MAINROOT/maps/XU_ep1_universe/zonehighways.pck

...this one being just a blank xml file renamed to pck. Lanes are gone all over the game, don't know if it affects other parts but should not, zones and jobs are independent from highways. Only I suppose this way you must start a new game, I'd like to be able to implement a file for the /extensions folder instead
Last edited by Realspace on Sun, 17. Nov 13, 23:24, edited 1 time in total.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: what about the <remove>?

Post by UniTrader » Sun, 17. Nov 13, 23:23

Realspace wrote:
UniTrader wrote:for those who want to just tinker with the game a hint: copy the xml you want to edit in the same folder where it belongs in the root folder of the game and change the file ending to pck - this gives it priority over xml ;) for some reason patch xmls are required for use in the extensions-folder as i found out today, so for tinkering with the game i think its the best to extract the game files in the root folder and work with a pck copy of the files you want to change. so you can try it outttt and KNOW that YOUR files are used, and when you are done you can compare it with the original xml file and make an extension from it ;)
Thanks for the info UniTrader, you mean for example if I put the zonehighways.xml of my own in the "MAINROOT/maps/XU_ep1_universe" folder instead of "MAINROOT/extensions/maps/XU_ep1_universe" it will have the priority over the same file contained inside the DAT? Do I simply rename it to .pck (no compression?)?
Yes, simply change the xml ending to pck;)
but i found your mistake: you are missing a mod folder for your project inside the extensions-folder ;) and optimally a content.xml ;) here an example from my files for what should be inside:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<content id="FuelCellPatch" name="Fuel Cell Patch" description="makes Fuel Cell Offers available" author="UniTrader" date="2013-11-16" version="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="content.xsd">
	<text language="49" name="Sprungzellenpatch" description="macht die Angebote für Sprungzellen verfügbar" author="UniTrader" /> 
</content>
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

User avatar
Observe
Posts: 5079
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe » Sun, 17. Nov 13, 23:24

UniTrader wrote:for those who want to just tinker with the game a hint: copy the xml you want to edit in the same folder where it belongs in the root folder of the game and change the file ending to pck - this gives it priority over xml
Another way is to use -prefersinglefiles in your startup properties. That way, your external files will take priority over the internal (cat/dat) versions. I usually extract all the game files, tinker with the ones I am interested in, and then make the mod patch once I know what I'm doing. :)

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

Re: what about the <remove>?

Post by Realspace » Sun, 17. Nov 13, 23:27

UniTrader wrote:
Realspace wrote:
UniTrader wrote:for those who want to just tinker with the game a hint: copy the xml you want to edit in the same folder where it belongs in the root folder of the game and change the file ending to pck - this gives it priority over xml ;) for some reason patch xmls are required for use in the extensions-folder as i found out today, so for tinkering with the game i think its the best to extract the game files in the root folder and work with a pck copy of the files you want to change. so you can try it outttt and KNOW that YOUR files are used, and when you are done you can compare it with the original xml file and make an extension from it ;)
Thanks for the info UniTrader, you mean for example if I put the zonehighways.xml of my own in the "MAINROOT/maps/XU_ep1_universe" folder instead of "MAINROOT/extensions/maps/XU_ep1_universe" it will have the priority over the same file contained inside the DAT? Do I simply rename it to .pck (no compression?)?
Yes, simply change the xml ending to pck;)
but i found your mistake: you are missing a mod folder for your project inside the extensions-folder ;) and optimally a content.xml ;) here an example from my files for what should be inside:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<content id="FuelCellPatch" name="Fuel Cell Patch" description="makes Fuel Cell Offers available" author="UniTrader" date="2013-11-16" version="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="content.xsd">
	<text language="49" name="Sprungzellenpatch" description="macht die Angebote für Sprungzellen verfügbar" author="UniTrader" /> 
</content>
thanks sorry I wrote wrong, of course it was MAINROOT/extensions/MYMOD/maps/..

it worked anyway, the .pck file put int the main root/maps/etc, all lanes are gone now!!

I don't know if it affects other parts but should not, zones and jobs are independent from highways. Only I suppose this way you must start a new game, I'd like to be able to implement a file for the /extensions folder instead

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Sun, 17. Nov 13, 23:38

Observe wrote:
UniTrader wrote:for those who want to just tinker with the game a hint: copy the xml you want to edit in the same folder where it belongs in the root folder of the game and change the file ending to pck - this gives it priority over xml
Another way is to use -prefersinglefiles in your startup properties. That way, your external files will take priority over the internal (cat/dat) versions. I usually extract all the game files, tinker with the ones I am interested in, and then make the mod patch once I know what I'm doing. :)
thx for that hint, could be useful :) but i think i still prefer my way because with this method you always know which files you tinkered with and you always have the original file as reference
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

User avatar
Observe
Posts: 5079
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe » Sun, 17. Nov 13, 23:41

UniTrader wrote:thx for that hint, could be useful :) but i think i still prefer my way because with this method you always know which files you tinkered with and you always have the original file as reference
Good point. :)

User avatar
Observe
Posts: 5079
Joined: Fri, 30. Dec 05, 17:47
xr

Post by Observe » Mon, 18. Nov 13, 01:32

I have decided to place the mod accompanying this guide on Nexus. It is now available here. OP download links reflect this change.

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

Index/macros.xml

Post by Realspace » Mon, 18. Nov 13, 05:32

How to use the files included in the Index? If I want to change a single entry.
I found the ref to the zonehighways.xml so changing it to my mod's URL can do remove the lanes since the file in my mod is a blank one.

so I changed it into
<entry name="highway*" value="extensions/MYMOD/maps\XU_ep1_universe\zonehighways"/>

but had to copy/pase the entire macros.xml and change thi single entry, can't I just use the patch method? Only..how is the syntax for Index/macros ?

MutantDwarf
Posts: 711
Joined: Tue, 20. Jun 06, 02:29
x4

Post by MutantDwarf » Mon, 18. Nov 13, 07:51

Does anyone know if it's possible to mod the player interaction menu at all? For example, adding an option to docks, such as 'comm'? I'm not sure where that stuff is defined; I'd imagine it's one of the compiled LUA files, but I don't see any that'd fit with the interaction menu.

Meh. It's not like we can edit them now, anyways, since those LUA files are in a non-standard format. The hex looks pretty similar to LUA 5.1, but with an almost completely different header, and even if you change that header to the standard LUA one it doesn't decompile. It may just be that I need to select different options in the header than the default ones, but I'm still highly sadfaced about it - editing those UI files would probably be a treasure trove of editing goodness.

User avatar
enenra
Posts: 7150
Joined: Fri, 8. Apr 05, 19:09
x4

Post by enenra » Mon, 18. Nov 13, 10:53

MutantDwarf wrote:Does anyone know if it's possible to mod the player interaction menu at all? For example, adding an option to docks, such as 'comm'? I'm not sure where that stuff is defined; I'd imagine it's one of the compiled LUA files, but I don't see any that'd fit with the interaction menu.

Meh. It's not like we can edit them now, anyways, since those LUA files are in a non-standard format. The hex looks pretty similar to LUA 5.1, but with an almost completely different header, and even if you change that header to the standard LUA one it doesn't decompile. It may just be that I need to select different options in the header than the default ones, but I'm still highly sadfaced about it - editing those UI files would probably be a treasure trove of editing goodness.
This keeps within the UI but changes some of the elements in it:
http://forum.egosoft.com/viewtopic.php?t=349949

(no need to change LUA in this case, but of course it's kinda limited)

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Post by UniTrader » Mon, 18. Nov 13, 11:09

he modified the "Main Menu" ring at the bottom for that, which is used for NPC interaction and so on.. not the optimal solution, but the currently best which can be done. (ths menu is btw completely coded in MD, so its easy to change)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

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

macros.xml

Post by Realspace » Mon, 18. Nov 13, 13:20

Observe...be patient with me...all this xml root is so confusing... :roll:
if I see correcty by your mod, the files inside INDEX MACROS.XML and COMPONENTS.XML DON'T need the patch method? I want to chenge the reference to these objects so to use my booster, here it is

Code: Select all

<index>
	<!-- <entry name="*" value="assets\entry"/>-->

	<entry name="highway*" value="extensions\RS_NoLanes\maps\XU_ep1_universe\zonehighways"/>

	<entry name="enginebooster_player_01_macro" value="extensions\RS_NoLanes\assets\props\EngineSystems\macros\enginebooster_player_01_macro"/>

	<entry name="radar_ship_s_player_01_macro" value="extensions\RS_stars\assets\props\surfaceelements\macros\radar_ship_s_player_01_macro"/>

</index>
Already tested, it works if a put the full macros.xml in my mod and change only these 3, can I simply add a macros.xml in my mod containing ONLY the 3 entries I need?[/b]

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

macros.xml

Post by Realspace » Mon, 18. Nov 13, 13:22

Observe...be patient with me...all this xml root is so confusing... :roll:
if I see correcty by your mod, the files inside INDEX MACROS.XML and COMPONENTS.XML DON'T need the patch method? I want to chenge the reference to these objects so to use my booster, here it is

Code: Select all

<index>
	<!-- <entry name="*" value="assets\entry"/>-->

	<entry name="highway*" value="extensions\RS_NoLanes\maps\XU_ep1_universe\zonehighways"/>

	<entry name="enginebooster_player_01_macro" value="extensions\RS_NoLanes\assets\props\EngineSystems\macros\enginebooster_player_01_macro"/>

	<entry name="radar_ship_s_player_01_macro" value="extensions\RS_stars\assets\props\surfaceelements\macros\radar_ship_s_player_01_macro"/>

</index>
Already tested, it works if a put the full macros.xml in my mod and change only these 3, can I simply add a macros.xml in my mod containing ONLY the 3 entries I need?[/b]

Return to “X Rebirth - Scripts and Modding”