[WIP/MOD] Supply And Trade Routes (including build supply and mining)

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

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

TheDeliveryMan
Posts: 257
Joined: Sat, 10. Dec 11, 04:10
x4

Re: [WIP] Default Order: Trade Route

Post by TheDeliveryMan » Sun, 16. Dec 18, 18:19

reqw wrote:
Sun, 16. Dec 18, 13:14
I might be stupid
Mumbels " you are no question asked "

Were can i get this trade route add on plz PRITY PLEAS
I haven't released it yet. The prototype is basically working, but there are stil some issues I need to fix.

User avatar
Paddyy
Posts: 138
Joined: Sun, 12. Feb 06, 20:25
x3ap

Re: [WIP] Default Order: Trade Route

Post by Paddyy » Tue, 18. Dec 18, 08:30

Would be cool if you could add an option to only create a trade route for a specific station. Basically a buy x for y. And maybe Buy x from y for z.

I am currently trying to supply some wharfs with engine parts in v1.32, but you can do it only manually in an efficient way.
"Import wares" looks at all stations and their shortages in that sector, and distribute wares ("Waren verteilen" in german) will also trade with other stations in the whole universe, that need the selected ware, because it has no gate limit.

Th3_0utKa5T
Posts: 3
Joined: Mon, 10. Dec 18, 19:21

Re: [WIP] Default Order: Trade Route

Post by Th3_0utKa5T » Wed, 19. Dec 18, 12:29

Paddyy wrote:
Tue, 18. Dec 18, 08:30
Would be cool if you could add an option to only create a trade route for a specific station. Basically a buy x for y. And maybe Buy x from y for z.

I am currently trying to supply some wharfs with engine parts in v1.32, but you can do it only manually in an efficient way.
"Import wares" looks at all stations and their shortages in that sector, and distribute wares ("Waren verteilen" in german) will also trade with other stations in the whole universe, that need the selected ware, because it has no gate limit.
yes sure you can, once you set the import wares on right clicking, go in to the ship behavior and at the bottom of the wares list you can set the max sell and buy range, make sure the trade ship is in the right sector first, it works fine for me until the station no longer needs the wares, then just change what you sell, works the same for exporting too.

having more than one med hauler doing this per sector will eventually cause the ware you are trading to no longer be required by the station you sell to.

User avatar
Paddyy
Posts: 138
Joined: Sun, 12. Feb 06, 20:25
x3ap

Re: [WIP] Default Order: Trade Route

Post by Paddyy » Wed, 19. Dec 18, 15:15

Th3_0utKa5T wrote:
Wed, 19. Dec 18, 12:29
Paddyy wrote:
Tue, 18. Dec 18, 08:30
Would be cool if you could add an option to only create a trade route for a specific station. Basically a buy x for y. And maybe Buy x from y for z.

I am currently trying to supply some wharfs with engine parts in v1.32, but you can do it only manually in an efficient way.
"Import wares" looks at all stations and their shortages in that sector, and distribute wares ("Waren verteilen" in german) will also trade with other stations in the whole universe, that need the selected ware, because it has no gate limit.
yes sure you can, once you set the import wares on right clicking, go in to the ship behavior and at the bottom of the wares list you can set the max sell and buy range, make sure the trade ship is in the right sector first, it works fine for me until the station no longer needs the wares, then just change what you sell, works the same for exporting too.

having more than one med hauler doing this per sector will eventually cause the ware you are trading to no longer be required by the station you sell to.
Thanks!

TheDeliveryMan
Posts: 257
Joined: Sat, 10. Dec 11, 04:10
x4

Re: [WIP] Default Order: Trade Route

Post by TheDeliveryMan » Thu, 20. Dec 18, 00:15

An alpha version of the trade route order script is now available at: https://github.com/TheDeliveryMan/TDM_S ... radeRoutes

Use at your own risk and back up your saves.

As it is an alpha version, there are still issues, especially with the route setup via the UI. But once setup it usally runs fine.

A brief quick start:
  • have an empty freighter ready
  • look at the map and find a profitable deal from factory A to factory B (these can be NPC or player factories)
  • open the Behaviours menu of the freighter
  • change Default Behaviour to SnTR Trade (Alpha 0)
  • set the ware you want to trade
  • max amount is fine for now, you might need to reduce min amount
  • you can adjust buying and selling price, but give it some margin for price variations
  • set Vendor 1 to the factory you want to buy from (click on blue button next to Vendor 1, zoom to the factory and right click -> Select on it)
  • set Customer 1 to the factory you want to sell to (click on blue button next to Customer 1, zoom to the factory and right click -> Select on it)
  • set Enable vendors to 1
  • set Enable customers to 1
  • click Confirm
Scripts for a mining route and a build supply route will follow in a couple of days.

Kryptos901
Posts: 38
Joined: Sat, 1. Dec 18, 07:25
x4

Re: [WIP] Default Order: Trade Route

Post by Kryptos901 » Thu, 20. Dec 18, 08:59

Shiny.

I'm just gonna add the following words here to make it easier for X3 players to find, as it took me an embarrassing amount of time.

CLS software Commodity Logistics

Thank you very much for making this.

alexringess
Posts: 40
Joined: Tue, 25. Sep 18, 23:57
x4

Re: [WIP] Default Order: Trade Route

Post by alexringess » Thu, 20. Dec 18, 15:03

I don't know why this feature wasn't implemented on the game by Egosoft.
It missed !
Gonna try it and giving you my feedback.
Thanks !

alexringess
Posts: 40
Joined: Tue, 25. Sep 18, 23:57
x4

Re: [WIP] Default Order: Trade Route

Post by alexringess » Thu, 20. Dec 18, 16:44

So, I tried you alpha mod.
For the UI, I have to say that it remember well what we'd got in X3. I like it !
But, the trader ship I assigned to do its job never gone to do its job. It just stay stucked at his place and never executed the orders.
I can't say why.
I followed the instruction.
I used a Mercury that I bought just for the test and it was never worked.

Anyway, I can't wait to see it working because I'll be able to see it at work and I'll be able to sending you a proper feedback. At this time, I can't ^^

Let's see the next version ;)

TheDeliveryMan
Posts: 257
Joined: Sat, 10. Dec 11, 04:10
x4

Re: [WIP] Default Order: Trade Route

Post by TheDeliveryMan » Thu, 20. Dec 18, 19:46

alexringess wrote:
Thu, 20. Dec 18, 16:44
So, I tried you alpha mod.
For the UI, I have to say that it remember well what we'd got in X3. I like it !
But, the trader ship I assigned to do its job never gone to do its job. It just stay stucked at his place and never executed the orders.
I can't say why.
I followed the instruction.
I used a Mercury that I bought just for the test and it was never worked.

Anyway, I can't wait to see it working because I'll be able to see it at work and I'll be able to sending you a proper feedback. At this time, I can't ^^

Let's see the next version ;)
Thanks for trying. I'll double check my uploaded files and see if they still work for me.

TheDeliveryMan
Posts: 257
Joined: Sat, 10. Dec 11, 04:10
x4

Re: [WIP] Default Order: Trade Route

Post by TheDeliveryMan » Thu, 20. Dec 18, 22:23

TheDeliveryMan wrote:
Thu, 20. Dec 18, 19:46
alexringess wrote:
Thu, 20. Dec 18, 16:44
So, I tried you alpha mod.
For the UI, I have to say that it remember well what we'd got in X3. I like it !
But, the trader ship I assigned to do its job never gone to do its job. It just stay stucked at his place and never executed the orders.
I can't say why.
I followed the instruction.
I used a Mercury that I bought just for the test and it was never worked.

Anyway, I can't wait to see it working because I'll be able to see it at work and I'll be able to sending you a proper feedback. At this time, I can't ^^

Let's see the next version ;)
Thanks for trying. I'll double check my uploaded files and see if they still work for me.
I just tested it, and for me it works. When testing I usually buy a couple of freighters and do not touch them before changing their default behaviour to SnTR Trade. After clicking confirm they undock and move around for a while. Target them and you should read something like "Command: Free Trading - Searching for trades" in the target info display. If there is an acceptable deal it should not take more than a couple of minutes before they head off to execute the trade.

For one freighter I tried something different. I ordered it to Fly to somewhere nearby and waited until it reached that position. Only then I did set up the trade route. In this case the freighter stayed in its waiting mode and never started the trade route. I had to manually cancel his wait order from the behaviour menu. Did you order your Mercury out of the wharf?

alexringess
Posts: 40
Joined: Tue, 25. Sep 18, 23:57
x4

Re: [WIP] Default Order: Trade Route

Post by alexringess » Fri, 21. Dec 18, 12:23

So, after a night (some says that the night is a good advisor) I think I forgot to mention some context related points.
On the vendor, I select a station I buit on Memorial of Antigone and ask the ship to pick the engine device I crafted and ask the ship to sell them to all the local stations that are supposed to needed it.

So maybe the ship was stuck only because the local market was full of engine devices ?

I'll do another test on another sector to check that.

alexringess
Posts: 40
Joined: Tue, 25. Sep 18, 23:57
x4

Re: [WIP] Default Order: Trade Route

Post by alexringess » Fri, 21. Dec 18, 12:25

TheDeliveryMan wrote:
Thu, 20. Dec 18, 22:23
TheDeliveryMan wrote:
Thu, 20. Dec 18, 19:46
alexringess wrote:
Thu, 20. Dec 18, 16:44
So, I tried you alpha mod.
For the UI, I have to say that it remember well what we'd got in X3. I like it !
But, the trader ship I assigned to do its job never gone to do its job. It just stay stucked at his place and never executed the orders.
I can't say why.
I followed the instruction.
I used a Mercury that I bought just for the test and it was never worked.

Anyway, I can't wait to see it working because I'll be able to see it at work and I'll be able to sending you a proper feedback. At this time, I can't ^^

Let's see the next version ;)
Thanks for trying. I'll double check my uploaded files and see if they still work for me.
I just tested it, and for me it works. When testing I usually buy a couple of freighters and do not touch them before changing their default behaviour to SnTR Trade. After clicking confirm they undock and move around for a while. Target them and you should read something like "Command: Free Trading - Searching for trades" in the target info display. If there is an acceptable deal it should not take more than a couple of minutes before they head off to execute the trade.

For one freighter I tried something different. I ordered it to Fly to somewhere nearby and waited until it reached that position. Only then I did set up the trade route. In this case the freighter stayed in its waiting mode and never started the trade route. I had to manually cancel his wait order from the behaviour menu. Did you order your Mercury out of the wharf?
Yes.
I waited the end of the undock procedure to be completed before sending my orders.

TheDeliveryMan
Posts: 257
Joined: Sat, 10. Dec 11, 04:10
x4

Re: [WIP] Default Order: Trade Route

Post by TheDeliveryMan » Fri, 21. Dec 18, 19:54

alexringess wrote:
Fri, 21. Dec 18, 12:23
On the vendor, I select a station I buit on Memorial of Antigone and ask the ship to pick the engine device I crafted and ask the ship to sell them to all the local stations that are supposed to needed it.
Ok, try this:
  • set max buy price as high as possible (it is your station, you will not lose money)
  • set max amount as high as possible
  • set min amount to 1
  • make sure Enable Vendors is set to 1
  • check again that Vendor 1 is set to your station and Ware is Engine Parts
It may take a couple of minutes, but if your station sells Engine Parts, the freighter should go and buy them.

If that does not work, I suspect your freighter is stuck on the previous command:
alexringess wrote:
Fri, 21. Dec 18, 12:25
TheDeliveryMan wrote:
Thu, 20. Dec 18, 22:23
For one freighter I tried something different. I ordered it to Fly to somewhere nearby and waited until it reached that position. Only then I did set up the trade route. In this case the freighter stayed in its waiting mode and never started the trade route. I had to manually cancel his wait order from the behaviour menu. Did you order your Mercury out of the wharf?
Yes.
I waited the end of the undock procedure to be completed before sending my orders.
Go to the Behaviours menu and cancel all orders in the Order Queue by clicking on the (X) button.

alexringess
Posts: 40
Joined: Tue, 25. Sep 18, 23:57
x4

Re: [WIP] Default Order: Trade Route

Post by alexringess » Fri, 21. Dec 18, 21:22

Many thanks.
Gonna try this :)

TheDeliveryMan
Posts: 257
Joined: Sat, 10. Dec 11, 04:10
x4

Re: [WIP] Default Order: Trade Route and Build Supply

Post by TheDeliveryMan » Sat, 22. Dec 18, 03:49

I added a default order for supplying station buildstorages. For details see the first post of this thread.

Some screenshots

I tested it by building three small solar power plants in parallel. My freighters served all stations equally well.

Post Reply

Return to “X4: Foundations - Scripts and Modding”