X4: Foundations

X4: Foundations

39 ratings
Supply chains [trade scripts for internal logistics]
4
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
49.418 KB
3 Jan @ 9:17am
8 Feb @ 7:51am
2 Change Notes ( view )

Subscribe to download
Supply chains [trade scripts for internal logistics]

Description
This scripts heavily inspired by X3TC era "CLS1/CLS2" scripts as well as X4 "Mules and warehouses" scripts.

Collection of trade scripts for player stations. Simple and effective relocation of goods between player owned (not only) stations.

There are 4 scripts:
  1. Supply courier
  2. Supply courier multi
  3. Sales agent
  4. Infrastructure courier

Supply courier
Establishes supply/demand connection between two chosen stations.
Script respects any trade restriction (faction restriction, buy/sell limit) but not the price. Courier will try to be effective. It will use as much cargo space as possible for both parts of the trips. I recommend to use L traders for this role.

Supply courier multi
Very similar to previous one, except it has two uneven parties.
First is warehouse (a station which can trade everything relevant in your economy), second is the list of the stations (in my example factories). This script randomly chooses a station from the list and runs supply courier script between the warehouse and chosen station. It will continue to serve chosen pair until no available trades will be available. In this case it will switch to another pair. This script allows to balance your traders between multiple stations.

Sales agent
This script serves to distribute excess wares from station (aka "warehouse"). There three groups of recipient station, each group with own threshold. If warehouse has some wares above certain threshold then excess of it would be traded to random recipient station.

Infrastructure courier
This trader would serve any build or ressuply demands of your stations.

How to quickly configure large fleet of traders?
Every script fully supports mimic command. So you need to configure only one ship then choose any number of additional ships and order them to mimic behavior of the configured ship. If requirements are met then ships will fully copy order from the ship.

Problems, issues, design drawbacks
This is very early version, expect much to be changed.
Please report any problems or bugs with the scripts.
Currently scripts require some skill from pilot (1 star or 2 star), this should not be a problem as basic and 1-star seminars are easy to buy. If you have another opinion, please, comment about this.
No support of language files. Currently all text is hardcoded -- to change this is my current priority.
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!