Need help with basic cargo storage mod

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

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

chrispytoes
Posts: 3
Joined: Thu, 21. Sep 23, 02:41

Need help with basic cargo storage mod

Post by chrispytoes » Sat, 23. Sep 23, 01:24

I'm a programmer new to modding in this game and I'm trying to start off simple and make a mod that increases the max cargo of all L traders. I started out by looking at some other similar mods, and I've mimicked them exactly, but my changes are not applying.

I've written diffs for all files containing the word "trans" or "transporter" in these directories:
  • /assets/units/size_l/macros
  • /extensions/ego_dlc_boron/assets/props/storagemodules/macros
  • /extensions/ego_dlc_split/assets/props/storagemodules/macros
  • /extensions/ego_dlc_terran/assets/units/size_l/macros
Each file contains:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
	<replace sel="//macros/macro/properties/cargo/@max">54000</replace>
</diff>
I packaged up my /assets and /extensions folders into a 01.cat and 01.dat using the catalog tool, and put them into "/extensions/bigger_l_cargo" along with this content.xml:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<content id="bigger_l_cargo" name="Bigger L Cargo" description="L Traders +50% cargo capacity" author="chrispytoes" version="001" date="2023-09-20" save="0" lastupdate="1695267428">
</content>
My extension is enabled in the game, but the cargo amounts are not changing. My mod looks identical to several other cargo mods I've inspected, and all I changed were the numbers, but I can't figure out what's wrong with mine.

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

Re: Need help with basic cargo storage mod

Post by alexalsp » Sat, 23. Sep 23, 10:06

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
	<replace sel="//properties/cargo/@max">54000</replace>
</diff>
Everything seems to be correct, but you can shorten it and check if the mod is enabled in the game, or add it to content.xml

Code: Select all

 enabled="1"
 
 <content id="bigger_l_cargo" name="Bigger L Cargo" description="L Traders +50% cargo capacity" author="chrispytoes" version="001" date="2023-09-20" save="0" lastupdate="1695267428" enabled="1">
 

chrispytoes
Posts: 3
Joined: Thu, 21. Sep 23, 02:41

Re: Need help with basic cargo storage mod

Post by chrispytoes » Sat, 23. Sep 23, 15:52

alexalsp wrote:
Sat, 23. Sep 23, 10:06

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<diff>
	<replace sel="//properties/cargo/@max">54000</replace>
</diff>
Everything seems to be correct, but you can shorten it and check if the mod is enabled in the game, or add it to content.xml

Code: Select all

 enabled="1"
 
 <content id="bigger_l_cargo" name="Bigger L Cargo" description="L Traders +50% cargo capacity" author="chrispytoes" version="001" date="2023-09-20" save="0" lastupdate="1695267428" enabled="1">
 
Removing the closing </content> tag made the extension not show up anymore in the extensions menu. I tried adding the enabled="1" attribute but that didn't fix it.

Would you be able to download and check it out for me? https://drive.google.com/file/d/1bJRfhy ... sp=sharing

Specifically I am looking at a Boron Sturgeon for my tests. It's normally 30k and it should be 45k with the mod.

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

Re: Need help with basic cargo storage mod

Post by alexalsp » Sat, 23. Sep 23, 17:02

The name cat / dat should be

ext_01.cat
ext_01.dat

Пример context.xml

Code: Select all

<content id="bigger_l_cargo" name="Bigger L Cargo" description="L Traders +50% cargo capacity" author="chrispytoes" version="001" date="2023-09-20" save="0" enabled="1">
  <text language="7" name="Bigger L Cargo" description="L Торговцы +50% вместимости трюма"/>
  <text language="33" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="34" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="39" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="44" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="49" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="55" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="81" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="82" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="86" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="88" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
</content>
Steam Workshop for X Rebirth and X4

chrispytoes
Posts: 3
Joined: Thu, 21. Sep 23, 02:41

Re: Need help with basic cargo storage mod

Post by chrispytoes » Sat, 23. Sep 23, 17:55

alexalsp wrote:
Sat, 23. Sep 23, 17:02
The name cat / dat should be

ext_01.cat
ext_01.dat

Пример context.xml

Code: Select all

<content id="bigger_l_cargo" name="Bigger L Cargo" description="L Traders +50% cargo capacity" author="chrispytoes" version="001" date="2023-09-20" save="0" enabled="1">
  <text language="7" name="Bigger L Cargo" description="L Торговцы +50% вместимости трюма"/>
  <text language="33" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="34" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="39" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="44" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="49" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="55" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="81" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="82" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="86" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
  <text language="88" name="Bigger L Cargo" description="L Traders +50% cargo capacity"/>
</content>
Steam Workshop for X Rebirth and X4
Thank you! That did it.

Return to “X4: Foundations - Scripts and Modding”