[Mod Help] Changing ware consumption
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 225
- Joined: Thu, 21. Nov 13, 03:22
[Mod Help] Changing ware consumption
Hey all, looking to make a simple mod to reduce the Space Fuel cost in Plate Foundries from 1,600/hr to 160/hr because I think that's WAY more reasonable. Anyone know how to do that?
-
- Posts: 1842
- Joined: Tue, 2. Nov 10, 02:20
Sure. The production values are determined in the in the \\libraries\wares.xml file. Searching for id="reinforced locates the reinforced metal plating entry (starting at line 1789), then looking through it we see that space fuel is set as a secondary ware with a consumption rate of 400(!!!) units per production cycle.
Replacing a single value (the amount) in the expression goes something like:
edit: This code example contains an error (unspecified production branch). See my next comment for explanation.
And while you're playing around in there, removing Medical Supplies from the primary resource list and adding it into the secondary list is an option, too:
edit: This code example contains errors (unspecified production branches). See my next comment for explanation.(Medical Supplies are secondary wares in literally every other production process, so I'm guessing that this and the 400 Space Fuel consumption per cycle were not intended....)
I'm not sure that changing factory production rates applies to facilities already built, though. It may or may not only work for new factories or a new game start.
Replacing a single value (the amount) in the expression goes something like:
edit: This code example contains an error (unspecified production branch). See my next comment for explanation.
Code: Select all
<replace sel="//ware[@id='reinforcedmetalplating']/production/secondary/ware[@ware='spacefuel']/@amount">40</replace>
edit: This code example contains errors (unspecified production branches). See my next comment for explanation.
Code: Select all
<!-- remove medical supplies as primary resource -->
<remove sel="//ware[@id='reinforcedmetalplating']/production/primary/ware[@ware='medicalsupplies']"/>
<!-- add medical supplies as secondary resource -->
<add sel="//ware[@id='reinforcedmetalplating']/production/secondary">
<ware ware="medicalsupplies" amount="40" />
</add>
I'm not sure that changing factory production rates applies to facilities already built, though. It may or may not only work for new factories or a new game start.
Last edited by Vim Razz on Tue, 16. Sep 14, 16:54, edited 1 time in total.
-
- Posts: 225
- Joined: Thu, 21. Nov 13, 03:22
-
- Posts: 1842
- Joined: Tue, 2. Nov 10, 02:20
Possibly? I trash my saves with reckless abandon, so I haven't actually tried modifying production with an ongoing game.
I just remember something being said about production settings of finished modules being stored in the save, way back during discussions about tweaking the IURV from the plot.
edit -- also -- whoops! I forgot to account for the multiple production methods in the lines of code above. Both "default" and "omicron" recipes need editing. Since "production" on it's own doesn't uniquely identify a branch, what I typed earlier wont work...
So, two entries are needed, one for each production type:
And similarly, medical supplies would need to be added/removed for each production type specifically.
I just remember something being said about production settings of finished modules being stored in the save, way back during discussions about tweaking the IURV from the plot.
edit -- also -- whoops! I forgot to account for the multiple production methods in the lines of code above. Both "default" and "omicron" recipes need editing. Since "production" on it's own doesn't uniquely identify a branch, what I typed earlier wont work...

So, two entries are needed, one for each production type:
Code: Select all
<replace sel="//ware[@id='reinforcedmetalplating']/production[@method='default']/secondary/ware[@ware='spacefuel']/@amount">40</replace>
<replace sel="//ware[@id='reinforcedmetalplating']/production[@method='omicron']/secondary/ware[@ware='spacefuel']/@amount">30</replace>
-
- Posts: 167
- Joined: Mon, 8. Mar 10, 04:30
Hmmm... tried making a new extension with that (never done before, but it showed up properly in my extensions!). Existing modules were unaffected. Made a new construction shop to test and it still has the same requirements (40 Med primary, 1600 Spacefuel secondary), but both wares are in red. Any idea what I did wrong?
-
- Posts: 1842
- Joined: Tue, 2. Nov 10, 02:20
-
- Posts: 421
- Joined: Wed, 22. Jul 09, 22:31
I've never tried to "mod" any X game until now and I don't know much about xml, but it worked, so I'm pretty proud of me
Though it was mostly copy-pasta.
http://i.imgur.com/gHuLdAW.jpg
Revenat342, I suppose you forgot the <diff> thing, it seems... Well, necessary.
Also it may be obvious but this should be in extensions/whatever/libraries/wares.xml.
I suppose it could be done with less lines (is there really no way to modify both "default" and "omicron" at the same time?), but whatever.

http://i.imgur.com/gHuLdAW.jpg
Revenat342, I suppose you forgot the <diff> thing, it seems... Well, necessary.
Also it may be obvious but this should be in extensions/whatever/libraries/wares.xml.
Code: Select all
<diff>
<replace sel="//ware[@id='reinforcedmetalplating']/production[@method='default']/secondary/ware[@ware='spacefuel']/@amount">40</replace>
<replace sel="//ware[@id='reinforcedmetalplating']/production[@method='omicron']/secondary/ware[@ware='spacefuel']/@amount">30</replace>
<remove sel="//ware[@id='reinforcedmetalplating']/production[@method='default']/primary/ware[@ware='medicalsupplies']"/>
<remove sel="//ware[@id='reinforcedmetalplating']/production[@method='omicron']/primary/ware[@ware='medicalsupplies']"/>
<add sel="//ware[@id='reinforcedmetalplating']/production[@method='default']/secondary">
<ware ware="medicalsupplies" amount="40" />
</add>
<add sel="//ware[@id='reinforcedmetalplating']/production[@method='omicron']/secondary">
<ware ware="medicalsupplies" amount="40" />
</add>
</diff>
-
- Moderator (Script&Mod)
- Posts: 14571
- Joined: Sun, 20. Nov 05, 22:45
Nope, XR doesnt support the inofficial msel extension currently.. your diff file is as short as it can getbm01 wrote:I suppose it could be done with less lines (is there really no way to modify both "default" and "omicron" at the same time?), but whatever.

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
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

-
- Posts: 167
- Joined: Mon, 8. Mar 10, 04:30
This is what I have:
I have it in a DAT file in /extensions/constructionyardfix, because all my other mods just have a single ext_01.dat with no sub-folders. Is this correct?
*EDIT* Never mind! Made a fresh XML file in extensions/cyfix/libraries/wares.xml. Worked on all my existing stations, too. Only odd thing is that the spacefuel and medical supplies requirements are in red on the new station I test-built, though they both have the numbers I want and are both secondary resources. Any idea what this means, if anything? The existing stations are white as normal.
*RE-EDIT* Haha, never mind again. Red just meant they were illegal in PMC space where I built my test station... just like it said at the top of the screen.... stupid me. Momma always said I gon' be somebody.
So, seems like everything is working great! Thanks, everyone!
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<diff>
<!-- remove medical supplies as primary resource -->
<remove sel="//ware[@id='reinforcedmetalplating']/production/primary/ware[@ware='medicalsupplies']"/>
<!-- add medical supplies as secondary resource -->
<add sel="//ware[@id='reinforcedmetalplating']/production/secondary">
<ware ware="medicalsupplies" amount="40" />
</add>
<replace sel="//ware[@id='reinforcedmetalplating']/production[@method='default']/secondary/ware[@ware='spacefuel']/@amount">40</replace>
<replace sel="//ware[@id='reinforcedmetalplating']/production[@method='omicron']/secondary/ware[@ware='spacefuel']/@amount">40</replace>
</diff>
*EDIT* Never mind! Made a fresh XML file in extensions/cyfix/libraries/wares.xml. Worked on all my existing stations, too. Only odd thing is that the spacefuel and medical supplies requirements are in red on the new station I test-built, though they both have the numbers I want and are both secondary resources. Any idea what this means, if anything? The existing stations are white as normal.
*RE-EDIT* Haha, never mind again. Red just meant they were illegal in PMC space where I built my test station... just like it said at the top of the screen.... stupid me. Momma always said I gon' be somebody.
So, seems like everything is working great! Thanks, everyone!
-
- Posts: 1842
- Joined: Tue, 2. Nov 10, 02:20
Congratulations on getting it to work despite my not-very-complete explanations!
The .cat/.dat files you see in a lot of mods now are compressed directory structures packaged with the Rebirth Tools utility. I don't know if there's any real benefit to doing it that way other than, you know, having it look cool.

The .cat/.dat files you see in a lot of mods now are compressed directory structures packaged with the Rebirth Tools utility. I don't know if there's any real benefit to doing it that way other than, you know, having it look cool.
-
- Moderator (English)
- Posts: 8074
- Joined: Tue, 30. Mar 04, 12:28
-
- Posts: 421
- Joined: Wed, 22. Jul 09, 22:31
You also need a content.xml, which gives some details to X Rebirth. I made a dummy one personally. Here's my folder: http://s000.tinyupload.com/index.php?fi ... 8730728984
I forgot to remove something though. You can delete the assets folder, it's a fix for 2.5 beta 7 and is completely unrelated to this topic. It fixes the ship types of light and heavy sul (trader for both instead of fighter). I don't know if it affects anything else than the encyclopedia entries (that's what I'm trying to find out).
I forgot to remove something though. You can delete the assets folder, it's a fix for 2.5 beta 7 and is completely unrelated to this topic. It fixes the ship types of light and heavy sul (trader for both instead of fighter). I don't know if it affects anything else than the encyclopedia entries (that's what I'm trying to find out).
-
- Moderator (English)
- Posts: 8074
- Joined: Tue, 30. Mar 04, 12:28
-
- Posts: 421
- Joined: Wed, 22. Jul 09, 22:31
-
- Posts: 2774
- Joined: Tue, 29. Oct 13, 21:59