[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

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

Post by Realspace » Thu, 21. Nov 13, 15:21

stupid question...but with these steam updates how the hell I know what the patches change in the game? With the retail you just decompressed the patch into a folder and took a look at the dat to see if anything related to your mod was changed...now?

Raider480
Posts: 190
Joined: Fri, 30. Jul 10, 05:32
x4

Post by Raider480 » Thu, 21. Nov 13, 15:24

UniTrader wrote:XRebirth still prefers to use files inside Cats/Dats instead of raw files, except you give it a parameter which tells XR to prefer extracted files.
As far as I know, X has always actually preferred to load loose files rather than whatever is in a cat/dat pair:
http://forum.egosoft.com/viewtopic.php?p=4100121
Ketraar wrote:technically its the other direction [...] loose files are the last ones to be loaded, thus overwriting everything else

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

Post by Realspace » Fri, 22. Nov 13, 00:22

another request: any guess where the physics of the skunk are set? I guess in the engine_player_01 etc but nothing happens when I change it. What file.xml? The booster instead is moddable, already done.

tc3
Posts: 45
Joined: Sun, 30. Jul 06, 13:16
x3tc

Post by tc3 » Fri, 22. Nov 13, 10:27

Hello all

After a little help if possible - i cant seem to mod my game. Ive put various mods into the extensions folder, they are all 'on' in extensions ingame, but none of them work.

Question - everytime i put one in the extensions folder, they all have their own 'content.xml' - and im overwriting when copying mods over - do i need to manually edit this file with different info for each mod? What does this file actually do? I presume its what stopping mods from working (no cockpit, Nesa etc)?

Any help much appreciated, thank you in advance.

Tim, captain of the Skunk, signing off.

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

Post by Realspace » Fri, 22. Nov 13, 12:08

Just some few hints, first you don't need to change the files altogether, you can simply add or replace part of the entries in the files, that is the power of xml. For the exact syntax read the guide, I'm having problems too for things that are not listed in the guide about the correct syntax. Second you have to add the file upper in the root too, the ones where the items you change are listed, it maybe a matarial (so dds and effects etc) or thers. They generaly are listed in the index folder or in the libraries. Must say that the criteria of listing is quite beyond my coohmprension. Hope for some tool release soon!

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

Post by UniTrader » Fri, 22. Nov 13, 12:26

every extension needs its own sub-older in bthe extensions-folder so if you do it right it wont overwrite a file in any case.
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 ;)

OpiWanktGenObi
Posts: 13
Joined: Mon, 29. Sep 08, 14:20
x4

Post by OpiWanktGenObi » Fri, 22. Nov 13, 13:40

..because i still see outdated and wrong content.xml entries:

i beg you, please read through your content.xml before uploading new or updated mod files.
by the way: the version number has to be multiplied by 100. if you want to see a version "1.20" in the games mod-description, it should look like version="120" in the content.xml.
thanks :)

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

Post by Realspace » Fri, 22. Nov 13, 16:20

Trying to use the diff method but not working

Code: Select all

<diff> 
 <replace sel="/macros/macro[@name='enginebooster_player_01_macro']/properties/boost">
<boost charge="0" duration="200" minshieldpercent="10" recharge="1">
</replace>
</diff> 
ORIGINAL:

Code: Select all

<macros>
  <macro name="enginebooster_player_01_macro" class="enginebooster">
    <component ref="generic_enginebooster" />
    <properties>
      <boost charge="0" duration="20" minshieldpercent="10" recharge="1">
        <speed forward="10" rotation="0.2" />
        <acceleration forward="5" reverse="1" strafe="5" rotation="0.25" />
      </boost>
      <effects>
        <boosting ref="boostfx_engine_player_01" />
      </effects>
      <sounds>
        <charging ref="engine_booster_charge" />
        <boosting ref="engine_booster" />
        <boosting_lfe ref="engine_booster_lfe" />
      </sounds>
    </properties>
  </macro>
</macros>
If I add

Code: Select all

 />
instead of

Code: Select all

>
at the end of <boost etc.. it works but then disabilitates the following properties (speed and acceleration).

:gruebel:

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

Post by UniTrader » Fri, 22. Nov 13, 16:28

Realspace wrote:Trying to use the diff method but not working

Code: Select all

<diff> 
 <replace sel="/macros/macro[@name='enginebooster_player_01_macro']/properties/boost">
<boost charge="0" duration="200" minshieldpercent="10" recharge="1">
</replace>
</diff> 
ORIGINAL:

Code: Select all

<macros>
  <macro name="enginebooster_player_01_macro" class="enginebooster">
    <component ref="generic_enginebooster" />
    <properties>
      <boost charge="0" duration="20" minshieldpercent="10" recharge="1">
        <speed forward="10" rotation="0.2" />
        <acceleration forward="5" reverse="1" strafe="5" rotation="0.25" />
      </boost>
      <effects>
        <boosting ref="boostfx_engine_player_01" />
      </effects>
      <sounds>
        <charging ref="engine_booster_charge" />
        <boosting ref="engine_booster" />
        <boosting_lfe ref="engine_booster_lfe" />
      </sounds>
    </properties>
  </macro>
</macros>
If I add

Code: Select all

 />
instead of

Code: Select all

>
at the end of <boost etc.. it works but then disabilitates the following properties (speed and acceleration).

:gruebel:
with the <replace> you replace the whole node (everything from <boost ... to ..</boost>, not just the single line given. so you have to re-add the original content, too like this:
iff>
<replace sel="/macros/macro[@name='enginebooster_player_01_macro']/properties/boost">
<boost charge="0" duration="200" minshieldpercent="10" recharge="1">
<speed forward="10" rotation="0.2" />
<acceleration forward="5" reverse="1" strafe="5" rotation="0.25" />
</boost>
</replace>
</diff>
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: 1411
Joined: Wed, 15. Nov 06, 10:21
x4

Post by Realspace » Fri, 22. Nov 13, 16:38

Holy shit!! I had tried that too at the beginning but forgot the closing </boost> ...2 hour lost!! :evil:
Thanks!! :D

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

Post by UniTrader » Fri, 22. Nov 13, 16:47

hint: use an editor which understands xml - makes everything much easier. (i recommend Notepad++ - has syntax highlight, syntax check, pretty print and autocompletionn with a few settings ;) )
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: 1411
Joined: Wed, 15. Nov 06, 10:21
x4

Post by Realspace » Fri, 22. Nov 13, 16:59

UniTrader wrote:hint: use an editor which understands xml - makes everything much easier. (i recommend Notepad++ - has syntax highlight, syntax check, pretty print and autocompletionn with a few settings ;) )
Thank you that helps alot indeed and saves from stupid errors and wasted time! :D

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Sat, 23. Nov 13, 15:54

Added information about the ins and outs of Content.xml.

http://forum.egosoft.com/viewtopic.php? ... 13#4192513


What is relevant to most mods right now:

You can tell the mod to not attach itself to the savegame so it can be uninstalled by turning it off or deleting the whole folder...
without having to "hack" the savegame.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

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

Post by UniTrader » Sat, 23. Nov 13, 16:48

just added this info to my Mod-Starter-Pack and made a few more improvements:

- improved content.xsd:
-> now knows about the optional save-parameter to be able to remove savegame-safe mods
-> text and depenencies are now optional
- modified scriptproperties.html
-> renamed to default_scriptproperties.html and now depends on the related default_***.xml-Files in the Libraries-folder instead of files with the original Names - prevents conflicts, see next point.
- improved bat-file for removing mod-development related files for creating the package:
-> now removes default_-files mentioned in the previous point instead of the possibly modified original filese (in case you want to modify them)
-> now removes unnecesary folders, if they are empty (except the tools-folder, that one is wiped)

still to find under the same Link: ;)
http://ubuntuone.com/23zTOAse4OkgAjk2ZPIcLL
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 » Sat, 23. Nov 13, 16:51

Gazz wrote:Added information about the ins and outs of Content.xml.
Thanks. :)

Scoob
Posts: 10174
Joined: Thu, 27. Feb 03, 22:28
x4

Post by Scoob » Sat, 23. Nov 13, 21:52

Hi Observe,

Firstly thanks for the guide - I have a headache after reading it so it must be good :)

A question for you if I may. I've been trying to do a Hull Shield mod for capital ship shields for a few days now, but I kept running into issues - basically my understanding is evidently flawed. Dingutis has done something similar to what I indended here but it's not quite what I was hoping to achieve.

I'd started off by first trying to add a new shield type to modify, based on ..assets\props\SurfaceElements\Macros\shieldgenerator_size_m_mk3_macro. My plan was to name it shieldgenerator_m_hull_macro in this test.

To do this I basically copied the contents of said macro, and popped in into an <add sel= so I could modify it's stats independently of the original, buffing its values substantially.

Next, for each ship I wanted to mod in ..assets\units\size_xl\ I'll use a <replace sel to replace the shield generator covering the jumpdrive with my new un-grouped version for it to cover the hull. I am yet to identify this for each ship, but I just need to check the jumpdrive group with the associated shield group to tie the two up.

I thought, in theory, this was a fairly sound approach and, being a NEW shield type, it'd not risk undesired effects on unmodified ships. However, I'm struggling to get things right.

Having seen Dingutis's more straight-forward approach of, basically, ungrouping all shields and giving them a buff, I was inspired to try to get mine working again. I certainly want to first create a proper (working) new shield type for the "hull shield" - actually, several, so I can modify for different ships as need be, and then identify and replace the shield for the jumpdrive as the new hull shield.

I did consider adding an entirely new surface element for the hull shield, but that's way beyond me. Having my modded hull shield on a critical component such as the Jumpdrive works for me. I.e. Take down a ships hull shield, kill it's jumpdrive (no more shield, no insta-escape option) yet you still have a formidable foe to contend with.

Likely I've taken on more than I can handle, as my earlier attempt didn't work, but I'd love to get some advice from you regarding adding this new shield type for use. Once that's in place, I think I have a handle on the remaining bits, so edits to all ships I wish to use the new hull shield variant.

Any advice welcome.

Cheers,

Scoob.

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

Post by UniTrader » Sun, 24. Nov 13, 13:57

one more info about content.xml:
<content>-node has an enabled-Parameter which when set to "false" turns mods off by default. Updated content.xsd in myStarter pack. (will make a Topic about it when i decided which cat-tool to include)



[Post about Content.xml updated. - Gazz]
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 ;)

blegoff
Posts: 15
Joined: Sun, 14. Oct 07, 16:04
x4

Post by blegoff » Sun, 24. Nov 13, 22:39

i'll try to make my mod, and i have some question

do you know how to store data in xml file ?

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

Post by UniTrader » Sun, 24. Nov 13, 23:14

what kind of data do you want to store where?
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 ;)

blegoff
Posts: 15
Joined: Sun, 14. Oct 07, 16:04
x4

Post by blegoff » Mon, 25. Nov 13, 00:16

UniTrader wrote:what kind of data do you want to store where?
i want to create a new xml file (like a save) to store price, coordinate, comment

Return to “X Rebirth - Scripts and Modding”