[Solved]Little help please with a Wares.xml mod I want to make for myself

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

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

Post Reply
Starman01
Posts: 167
Joined: Wed, 20. Jun 07, 13:56
x4

[Solved]Little help please with a Wares.xml mod I want to make for myself

Post by Starman01 » Fri, 3. Jun 22, 10:36

Hi all,

(edit) Wrong forum, sorry... Belongs to X4 modding of course. Solution below for anyone interested... @Mods : Feel free to delete or move.Thanks


i would very much appreciated a small help from the talented modders here :) I try to create a small mod for myself that changes the requirements for the scrap metal processing. I just tried editing the wares.xml (lowering energy requirement), but for whatever reason, when I launch the game this simple change conflicts with the research screen, it is no longer visible. It's definitly my mod causing it, so some conflict is created. It worked in 5.0, but something seems to have change in 5.1, since it now creates the problem.

After looking into some other mods that also change wares.xml it seems one can not simply change the file, but I have to use some commands like "replace" or "DIFF" in my mod file, but I can't get the synthax right.
So I would be really happy if someone can help me out here, i want to play this scrap thing so much, but the current implementation is just tedious and pointless from an economic view (by the time I have the money for this setup, i can simply build tons of hullpart and claytronic factories myself.)

These are the copied entries from wares.xml with my change already included. How must I write the synthax for wares.xml to accept this change in the game ?

Thank you very much in advance for helping !
<ware id="claytronics" name="{20201,501}" description="{20201,502}" factoryname="{20201,504}" group="shiptech" transport="container" volume="24" tags="container economy stationbuilding">
<price min="1734" average="2040" max="2346" />
<production time="900" amount="108" method="default" name="{20206,101}">
<primary>
<ware ware="antimattercells" amount="100" />
<ware ware="energycells" amount="140" />
<ware ware="microchips" amount="160" />
<ware ware="quantumtubes" amount="100" />
</primary>
<effects>
<effect type="work" product="0.34" />
</effects>
</production>
<production time="300" amount="60" method="recycling" name="{20206,1101}" tags="noplayerbuild recycling">
<primary>
<ware ware="energycells" amount="3000" />
<ware ware="scrapmetal" amount="125" />
</primary>
<effects>
<effect type="work" product="0.34" />
</effects>
</production>
<icon active="ware_claytronics" video="ware_claytronics_macro" />
</ware>

<ware id="hullparts" name="{20201,1201}" description="{20201,1202}" factoryname="{20201,1204}" group="hightech" transport="container" volume="12" tags="container economy stationbuilding">
<price min="146" average="209" max="272" />
<production time="900" amount="294" method="default" name="{20206,101}">
<primary>
<ware ware="energycells" amount="80" />
<ware ware="graphene" amount="40" />
<ware ware="refinedmetals" amount="280" />
</primary>
<effects>
<effect type="work" product="0.37" />
</effects>
</production>
<production time="900" amount="294" method="teladi" name="{20206,401}">
<primary>
<ware ware="energycells" amount="80" />
<ware ware="graphene" amount="40" />
<ware ware="teladianium" amount="204" />
</primary>
<effects>
<effect type="work" product="0.37" />
</effects>
</production>
<production time="300" amount="200" method="recycling" name="{20206,1101}" tags="noplayerbuild recycling">
<primary>
<ware ware="energycells" amount="1500" />
<ware ware="scrapmetal" amount="50" />
</primary>
<effects>
<effect type="work" product="0.37" />
</effects>
</production>
<icon active="ware_hullparts" video="ware_hullparts_macro" />
</ware>

<ware id="scrapmetal" name="{20201,6601}" description="{20201,6602}" factoryname="{20201,6604}" group="refined" transport="solid" volume="10" tags="economy recycling solid">
<price min="318" average="375" max="431" />
<production time="60" amount="1" method="processing" name="{20206,1301}" tags="noplayerbuild recycling">
<primary>
<ware ware="energycells" amount="3" />
<ware ware="rawscrap" amount="1" />
</primary>
</production>
<icon active="ware_scrapmetal" video="ware_scrapmetal_macro" />
</ware>
Last edited by Starman01 on Fri, 3. Jun 22, 14:00, edited 1 time in total.

Starman01
Posts: 167
Joined: Wed, 20. Jun 07, 13:56
x4

Re: Little help please with a Wares.xml mod I want to make for myself

Post by Starman01 » Fri, 3. Jun 22, 13:25

Just so you don't think I only want other people to do my work, nope :) I tried to figure it out myself by looking at other mods, though I couldn't find one that replaces wares, just "weapon wares"... it has a /primary tag behind it I cannot define, but for the rest I came up with this.

Of courseit didn't work, it completly f.....up the entire production and the view in the logical screen.... I only want to change such a simple integer, why is it this difficult :( Even worse, each try i make takes me 5 to 6 minutes until the game is loaded for testing, on a SSD, with 32 GB ram, and a really fast quad-core cpu....I tried changing the main file to save me the headache, but of course it's not working either because of the copy protection / signature file I can't change :(

So, appearantly I cannot just change a simple entry like I saw in the weapons-mod, most likely because these are all extra files. So if anyone can give me a hand while I try and error myself further into it :)
<?xml version="1.0" encoding="utf-8"?>

<diff>

<replace sel="//wares/ware[@id='claytronics']/production[@method='recycling']">
<primary>
<ware ware="energycells" amount="2500" />
<ware ware="scrapmetal" amount="125" />
</primary>
</replace>

<replace sel="//wares/ware[@id='hullparts']/production[@method='recycling']">
<primary>
<ware ware="energycells" amount="1500" />
<ware ware="scrapmetal" amount="50" />
</primary>
</replace>

<replace sel="//wares/ware[@id='scrapmetal']/production[@method='processing']">
<primary>
<ware ware="energycells" amount="3" />
<ware ware="rawscrap" amount="1" />
</primary>
</replace>

</diff>

User avatar
alexalsp
Posts: 1491
Joined: Fri, 18. Jul 14, 05:28
x4

Re: Little help please with a Wares.xml mod I want to make for myself

Post by alexalsp » Fri, 3. Jun 22, 13:35

This is an X Rebirth thread, not an X4 one :)

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<diff>

<replace sel="//wares/ware[@id='claytronics']/production[@method='recycling']/primary/ware[@ware='energycells']/@amount">2500</replace>
<replace sel="//wares/ware[@id='claytronics']/production[@method='recycling']/primary/ware[@ware='scrapmetal']/@amount">125</replace>


<replace sel="//wares/ware[@id='hullparts']/production[@method='recycling']/primary/ware[@ware='energycells']/@amount">2500</replace>
<replace sel="//wares/ware[@id='hullparts']/production[@method='recycling']/primary/ware[@ware='scrapmetal']/@amount">50</replace>


<replace sel="//wares/ware[@id='scrapmetal']/production[@method='processing']/primary/ware[@ware='energycells']/@amount">3</replace>
<replace sel="//wares/ware[@id='scrapmetal']/production[@method='processing']/primary/ware[@ware='scrapmetal']/@amount">1</replace>


</diff>

Starman01
Posts: 167
Joined: Wed, 20. Jun 07, 13:56
x4

Re: Little help please with a Wares.xml mod I want to make for myself

Post by Starman01 » Fri, 3. Jun 22, 13:49

Oh boy, how did I end in here :)

Thanks for helping , i try it out immediately

Starman01
Posts: 167
Joined: Wed, 20. Jun 07, 13:56
x4

Re: Little help please with a Wares.xml mod I want to make for myself

Post by Starman01 » Fri, 3. Jun 22, 13:59

This works :) Thank you very much, i really appreciate it :)

Post Reply

Return to “X Rebirth - Scripts and Modding”