X4: Foundations

X4: Foundations

Supply chains [trade scripts for internal logistics]
36 Comments
Tekitha 21 Apr @ 11:50am 
mimic behaviour does not seem to be working, anyone else having this issue?
Borkon 18 Apr @ 2:43pm 
Warning: will fail if you have workforce on your food factory because it refuses to trade wares that are also used at the same station.
Jacob Ellemann-Jensen 18 Apr @ 1:32pm 
Hello I'm having quite a few difficulties getting my ships to supply my stations. I've set up a main warehouse, and assigned a mimic behaviour fleet to do supply courier multi. But out of 22 ships, only 1 ship is trading at a time. I can see that all my stations are filled with products, just waiting to be shipped off
MeroX 26 Mar @ 3:44pm 
Really good mod, but sometimes my traders buy 1 ware from my station instead of full cargo.
fieldencoleman 18 Mar @ 2:20pm 
I'm having the exact same issues as @Lokaar. Overall, very useful! Can't wait to see how it works fully running as intended.
Mizumono 17 Mar @ 1:31pm 
Hey @Highway To Hell,
really love your mod, it helps me fix an issue where traders keep on trading 20 BoFu to stations and completely ignore the fact that the stations have absolutely no water supply, while the water factory builds up said water. I am bothered by the renaming of the ships though - I love to give my ships individual names. I already read below that you can't remove that, but did not entirely understand why that is the case. Could you please explain?
Thalur 13 Mar @ 2:00pm 
I've run in to a couple of bugs:

1) Supply courier multi isn't respecting the cargo types (solid/liquid/container) when assigning orders. I have a warehouse with the usual container products plus scrap metal and a mixed fleet of container and solid transports. When one of the cargo types runs out the ships of that type start spamming new trade orders but they constantly fail because the ships don't have any cargo space of the right type. This makes the routes flicker on the map as they re-plot twice a second. I haven't checked if sales agent has the same issue yet.

2) I can't get traders to pick up intermediate goods from a station that both produces and consumes them. This may not be a problem with your scripts though as it also happens in the base game "trade for commander" logic. It works fine if I set up a repeating order for the specific item.

Other than that it has been really useful so far, keep up the good work!
Well Done 12 Mar @ 8:29am 
I understand the auto naming not being able to remove automatically. It isn't that big of a deal to rename them if removed from the role. It isn't something that I would expect people to have to worry about often

What is the max travel range for the infrastructure courier in both positions, assigned to station and not? And would it be possible, read not much trouble, to make that configurable for the job? Something like zero to thirty jumps in case we want to limit some ships to a certain cluster and also allow others full transit of the universe.

Thanks again for support such a wonderful mod for us all to enjoy!
Mythery 9 Mar @ 1:55pm 
Hi @Highway To Hell

sure thing I can give it a try and tell you if it's working.
Just tell me how I can test the changes and I'll give you feedback asap.
GameBurrow 9 Mar @ 1:37pm 
Nice, thanks!
Highway To Hell  [author] 9 Mar @ 1:20pm 
@GameBurrow
Sure, I can expose those things, in fact they are here. I removed options before publishing in order to keep script simple. I'll publish a version where those options would be exposed as advanced.
Highway To Hell  [author] 9 Mar @ 1:18pm 
@deltaCorben
I will include it in advanced options.

Regarding redoing assignments.
Engine limitation is not allows to edit order options for ship assigned to the base. That is a bit painful, I know. What I suggest to use Supply courier until mid game. Then plan all necessary production stations, create them (even if they are not functional). After that configure Supply courier multi once (and copy to another ships).
Highway To Hell  [author] 9 Mar @ 1:12pm 
@Well Done
Unfortunately removing order can't be processed easily(if possible) therefore restoring original ship name unlikely for now.
Highway To Hell  [author] 9 Mar @ 1:09pm 
@Mythery
Even distribution is on my mind. The draft version is not performing nice. Either there are a lot dull ware transfers (especially when you have a huge trade fleet) or configuration is over complicated.

TLDR even distribution is complicated because it is hard to take into account wares which already in transfer..


What you suggest might be a good idea. I can implement it quickly if you willing to to test it. (I am on business trip until April, can't test myself).
GameBurrow 7 Mar @ 12:23pm 
1. It would be nice if renaming the ship is an optional setting
2. It would be nice if assigning the ship as subordinate is an optional - I personally don't like that logic since you it's annoying to edit the order.
deltaCorben 7 Mar @ 9:39am 
Another one: it would be nice if the supply courier multi could receive one or more sectors as target so I do not need to redo all the assignments every time I build a station.
deltaCorben 6 Mar @ 9:23pm 
It would be nice if the Supply Courier script stopped renaming the ships all the time. I am trying to add the destination in the name so that I can see at a glance how many are going where.
Well Done 6 Mar @ 11:22am 
When removing a ship from a role that gives it a prefix doesn't remove said prefix. Seems to work great otherwise! Thanks for updating and continuing to supporting it.
Mythery 28 Feb @ 1:09pm 
The “Sales agent” distributes goods as soon as the source station is above a defined percentage value for goods. This happens until the goods in the target stations have reached the maximum.
I would like to achieve an even distribution of goods between several trade stations. Currently there is a constant ping-pong as soon as the percentage value moves between the defined value and 100%.
I would like to suggest an option (checkbox?) whereby the specified percentage value of the source station is simultaneously checked as the maximum percentage value for the target stations. If the destination station is above this percentage value, no goods are transported.
This would ensure that goods are distributed evenly between several trade stations.
Mythery 28 Feb @ 1:09pm 
Hi, I've been using the extension for a few days now and it's all working quite well so far.

Two ideas that would improve the experience, at least for me and possibly for others:

When using the “Supply courier multi”, the messages regarding failed commands pile up. These should be removed as soon as a valid command is being executed.
flacidmember 11 Feb @ 5:40pm 
Oh I see.
I just thought infra courier was like courier multi, but it supplied all factories, rather than just the designated factories.
Highway To Hell  [author] 11 Feb @ 4:19pm 
@flacidmember Infra courier only tries to fulfill demands of build storage and station or ship resupply requests. All of them never require liquid or solid materials (at least in vanilla game). I am not sure what you are trying to achieve with mining ship as infra courier, mb more information would be useful.
flacidmember 10 Feb @ 11:06am 
Thank you.
I can confirm the supply courier multi is now shifting solids and liquids.

I tried infrastructure courier with a mining ship... Left it 2 minutes or so, but it didn't pick up any trades. Maybe I didn't give it enough time to start working.
Highway To Hell  [author] 8 Feb @ 7:52am 
Update has been uploaded.
Highway To Hell  [author] 8 Feb @ 7:41am 
@Leavism, @Steel Dragon @FlacidMember
Thanks for report I've found why script ignored solid/liquid wares. The fix is ready, I'll upload it to steam, there is some lag before steam verifies.
Highway To Hell  [author] 8 Feb @ 6:36am 
@The Adversary yes. You can add and delete these scripts during middle in the game.
Keep in mind that after deleting script all traders will return to vanila trade script
Highway To Hell  [author] 8 Feb @ 6:33am 
@Kallekanin91 Thanks a lot!
Highway To Hell  [author] 8 Feb @ 6:33am 
@Steel Dragon
Sorry for long absence.
Haven't tested with liquid and solid wares, but I don't remember anything specific to container storage, so I expect it should work fine.

In your case my suggestion:
Trade station - we treat as warehouse
Supply Depots with miners (vanila script) and solid/liquid trader(Sales Agent with warehouse and all supply depots are included in group 1 set low threshold (0% fine))
It will cause distribution of excess ores/gases to warehouse (trade station)

Then assign container freighters as supply courier multi (warehouse - trade station, factories - your factories)

Remember to have correct trade offers for you stations (in logical view). Everything matters except price (limits, traderestrictions, faction restrictions)


Alternative
Try to use solid/liquid freighter as supply courier between supply depot and your trade station(warehouse).
flacidmember 7 Feb @ 9:20pm 
I'm having the same problem as Leavism.

I've got a warehouse that receives all my mined materials, and I'm trying to assign mining ships to act as couriers between the warehouse and factories.

I tried using Infrastructure Courier and Supply Courier Multi, but my mining ships just sit idle and don't move.

Command on the ship shows "searching for trades". Less than 50km away, it's assigned warehouse is selling ore and there is also a factory buying ore. The price on the factory is higher than the price on the warehouse - incase there was any consideration to profits by the trader script.
Leavism 25 Jan @ 11:23pm 
@Steel Dragon

I have a very similar set up and have been trying to get something working without much luck. Here's what I have if anyone was able to get something like it working.

Resource Depot that is full of ore, ice, silicon, methane.
Hull Parts Factory that needs the ore and methane from the resource depot.
Food and meds factory that needs ice from the resource depot.

Does this mod work with resources or does it only transfer manufactured wares?
The Adversary 25 Jan @ 1:40am 
is this safe to add mid game? since the last time i added a mod like this it broke the game preventing the AI from trading
Kallekanin91 24 Jan @ 6:53am 
@ Highway To Hell
Thank you. That worked like a Charm. I hade made it to complex I think, with many wares.
GREAT MOD!!!!!
Steel Dragon 15 Jan @ 11:20pm 
Love the mod but could use a little clarification please.

In my games I use
Supply Depots (In liquid or solid fields to collect raw goods)
Trade Stations (collects raw goods from depots and distributes to factories, also sells finished goods)
Factory Stations (collect inputs from trade stations and sells outputs back to trade station for distribution.

In a setup like this what scripts do your recommend? Thanx again for the great work!
Mechanical 15 Jan @ 2:45pm 
One of my gripes with X4 is how anemic shipping build materials to a station is. There was a mod that did the job, but stopped working since the last major update. Current trader mods just don't cut it. But this one, this one they're so aggressive and EAGER to ship built materials. Previous mods, I needed 20+ ships per station I was building. This mod I need only 5 ships, as the infrastructure couriers DON'T get distracted.
Highway To Hell  [author] 14 Jan @ 4:36am 
@Kallekanin91
When you are saying BUILD storage, you mean a normal station which has all required build wares (hull parts, claytronics, etc) or a build storage which is small dock near each station?
If first is true, then your station should expose sell offers for infrastructure couriers. in order to get wares in buy offers should be exposed for supply couriers.

Example of working setup:
1. warehouse (only docks and container storage).
2. Hull parts factory.
3. Claytronics factory.
4. Energy cell factory.

Three Supply couriers :
1. Hull parts -> warehouse
2. Claytronics -> warehouse
3. Energy cell -> warehouse

Warehouse has sell and buy offers enabled for hull parts, claytronics, energy cell. (Faction filter can be used to limit only to your faction)

Infrastructure couriers are assigned to the warehouse.
Kallekanin91 13 Jan @ 6:06am 
Hello. Mod seems perfect, but I have a Challenge. I am trying to set up a BUILD storage, with Infrastructure Couriers. I have build it, have made the wares, with BUY and try to use Supply Couriers to get the wares. I have choosen NO sell in Build Storage. It just Trickles inn. Even when I have a lot of ENERGY, they are not collecting. Am I doing something wrong?