Trying to make a mod, desperately need some helps

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

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

ISSProxima
Posts: 3
Joined: Mon, 6. Feb 23, 18:15
x4

Trying to make a mod, desperately need some helps

Post by ISSProxima »

Encountered some problems, tried to figure out for hours, ended up with failure.
So at first I tried to add modification materials to the stores with a stock.xml and it works, however they all have a price of 1 Cr so I created a wares.xml in libraries, and add following:

Code: Select all

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

<replace sel="/wares/ware[@id='modpart_weaponchamber_t1']/price">
<price min="100000" average="200000" max="300000" />
</replace>


<replace sel="/wares/ware[@id='modpart_weaponchamber_t2']/price">
<price min="300000" average="400000" max="500000" />
</replace>


<replace sel="/wares/ware[@id='modpart_weaponchamber_t3']/price">
<price min="2000000" average="2500000" max="3000000" />
</replace>
</diff>
however when I opened up the game, those merchandises still remained at 1 Cr

Also I wanted to change the building time of ToA station modules to 1/2, so I created a wares.xml in Mymod\extensions\ego_dlc_pirate\libraries
and wrote:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
    <replace sel="/wares/ware[@id='module_conn_lndm_piratestation_01_core_01']/production[@method='default']/@time">105</replace>
    <replace sel="/wares/ware[@id='module_conn_lndm_piratestation_01_exit_01']/production[@method='default']/@time">105</replace>
    <replace sel="/wares/ware[@id='module_def_lndm_piratestation_02_ring_01']/production[@method='default']/@time">1155</replace>
    <replace sel="/wares/ware[@id='module_gen_welfare_casino_01']/production[@method='default']/@time">578</replace>
    <replace sel="/wares/ware[@id='module_hab_lndm_piratestation_01_port_01']/production[@method='default']/@time">817</replace>
    <replace sel="/wares/ware[@id='module_hab_lndm_piratestation_02_port_01']/production[@method='default']/@time">817</replace>
    <replace sel="/wares/ware[@id='module_hab_lndm_piratestation_02_ring_02']/production[@method='default']/@time">817</replace>
    <replace sel="/wares/ware[@id='module_pir_hab_l_01']/production[@method='default']/@time">578</replace>
    <replace sel="/wares/ware[@id='module_pir_hab_m_01']/production[@method='default']/@time">408</replace>
    <replace sel="/wares/ware[@id='module_pir_hab_s_01']/production[@method='default']/@time">283</replace>
    <replace sel="/wares/ware[@id='module_pir_stor_condensate_l_01']/production[@method='default']/@time">517</replace>
    <replace sel="/wares/ware[@id='module_pir_stor_condensate_s_01']/production[@method='default']/@time">164</replace>
    <replace sel="/wares/ware[@id='module_stor_lndm_piratestation_01_ring_01']/production[@method='default']/@time">517</replace>
    <replace sel="/wares/ware[@id='module_stor_lndm_piratestation_02_storage_01']/production[@method='default']/@time">517</replace>
    <replace sel="/wares/ware[@id='module_stor_lndm_piratestation_02_storage_02']/production[@method='default']/@time">517</replace>
 
</diff>
That too have no effects in-game.

I juar cannot figure out why they didn't work....
User avatar
Dj_FRedy
Posts: 246
Joined: Mon, 27. Jun 11, 05:58
x4

Re: Trying to make a mod, desperately need some helps

Post by Dj_FRedy »

Regarding your first issue, I don't see any problem with your code for your diff not working, maybe you saved before diff wares.xml and visited the same trader from your previous tests? There is a cooldown with the ware before the trader restock, it is possible that the prices have not been updated because of that. Visit another trader to see if the prices have changed.
An example mod implementation can be found here:
(External link to NexusMod Web): https://www.nexusmods.com/x4foundations/mods/74

Regarding your second issue, the diff has to be done in 'Mymod/libraries', not 'Mymod/extensions/ego_dlc_pirate/libraries'. Remember that a dlc is in a way a mod, which follows the same rules as our mods, which also modify the base game. Note that 'ego_dlc_pirate/libraries/wares.xml' is also a diff.
"All my contributions to the Technical Support and Public Beta Feedback sections will be concise and to the point, no diatribes, that's what the other sections are for".
Thank you for your efforts.

Return to “X4: Foundations - Scripts and Modding”