How can I modify auxiliary ship resource list?

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

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

billw
Posts: 53
Joined: Wed, 1. Oct 08, 19:19
xr

How can I modify auxiliary ship resource list?

Post by billw » Fri, 5. May 23, 03:51

I am writing a mod that give ships and crews running costs in the form of needing resupply of various wares. I want to do this through the existing supply ships, however I cannot work out how I can just explicitly set what wares I want them to provide. I have seen the <shipupgraderesources>, but the ware categories it considers appear to be hardcoded, and I want something I can change at runtime. I got as far as forcing the wares to at least appear in the UI under the Storage section of the supply ship, with target amounts, by calling SetContainerStockLimitOverride from lua, however this has not added the item as a resource, which is what all the trade scripts are working with.
I am currently going through and making patches for everywhere that uses the resources list for supply ships and injecting my own wares directly here, but what I really want to do is simply explicitly add a resource ware to the supply ship so it will work without hackery.

Return to “X4: Foundations - Scripts and Modding”