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

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

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

TheDeliveryMan
Posts: 687
Joined: Sat, 10. Dec 11, 03:10
x4

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

Post by TheDeliveryMan » Tue, 11. Dec 18, 21:20

Default Order: Trade Route

This is work in progress and still needs a lot of testing, but it's looking good so far. Especially the UI part was way easier than expected :)

Features:
  • trade one ware
  • set max buying price
  • set min selling price
  • set max amount to trade
  • set min amount to trade
  • buy from up to ten sellers (depends on skill)
  • sell to up to ten buyers (depends on skill)
Screenshot

Update:

An alpha version of this MOD is now available at: https://github.com/TheDeliveryMan/TDM_S ... radeRoutes
  • SnTR Trade:
    • buy one ware from a number of NPC or player stations
    • sell that ware to a number of NPC or player stations
    • focus is on profit
  • SnTR Build:
    • buy one ware from a number of NPC or player stations
    • sell that ware to a number of NPC or player station build storages
    • focus is on getting the job done (ie. deliver that one missing Hull Part)
  • SnTR Mine:
    • mine one resource at a number of locations marked by resource probes
    • sell mined resource to a number of NPC or player stations
    • focus is on profit
    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, set default behaviour to Hold position and clear any remaining orders from Order Queue
    • 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
    For build supply:
    • basically like above
    • the station you are building should already have a working dock and manager, otherwise you cannot select it
    • for Default Behaviour select SnTR Build
    For mining:
    • basically like above
    • mark resource deposits with a resource probe and select that probe just like a vendor station
    • for Default Behaviour select SnTR Mine
Last edited by TheDeliveryMan on Sat, 22. Dec 18, 18:15, edited 3 times in total.

idragon
Posts: 39
Joined: Fri, 17. Mar 17, 15:37
x4

Re: [WIP] Default Order: Trade Route

Post by idragon » Wed, 12. Dec 18, 04:51

TheDeliveryMan wrote:
Tue, 11. Dec 18, 21:20
Default Order: Trade Route

This is work in progress and still needs a lot of testing, but it's looking good so far. Especially the UI part was way easier than expected :)

Features:
  • trade one ware
  • set max buying price
  • set min selling price
  • set max amount to trade
  • set min amount to trade
  • buy from up to ten sellers (depends on skill)
  • sell to up to ten buyers (depends on skill)
Screenshot
Nice man, one of the things we really need. GL:)

lavak9
Posts: 43
Joined: Thu, 6. Dec 18, 23:38
x4

Re: [WIP] Default Order: Trade Route

Post by lavak9 » Wed, 12. Dec 18, 08:35

Nice work. Very much will appreciate having this.

User avatar
nidaren
Posts: 66
Joined: Wed, 27. Nov 13, 14:33
x4

Re: [WIP] Default Order: Trade Route

Post by nidaren » Wed, 12. Dec 18, 09:08

Great idea!

Would you consider doing the miner edition as well? In the current build, AutoMine can be very hectic, oftentimes going all over the map.

It would be great to have selection similar to your Trader: Gather Area 1, Seller 1 etc.

If the above is not to viable, maybe command limiting the mining zone to X km from sector centre and selling to one selcted buyer.

2m0re
Posts: 3
Joined: Sat, 8. Dec 18, 09:57
x4

Re: [WIP] Default Order: Trade Route

Post by 2m0re » Wed, 12. Dec 18, 11:00

nidaren wrote:
Wed, 12. Dec 18, 09:08
Great idea!

Would you consider doing the miner edition as well? In the current build, AutoMine can be very hectic, oftentimes going all over the map.

It would be great to have selection similar to your Trader: Gather Area 1, Seller 1 etc.

If the above is not to viable, maybe command limiting the mining zone to X km from sector centre and selling to one selcted buyer.
yeah thats what i want to see, a comma d line works as loop(mine, trade , fly to).

greetz

TheDeliveryMan
Posts: 687
Joined: Sat, 10. Dec 11, 03:10
x4

Re: [WIP] Default Order: Trade Route

Post by TheDeliveryMan » Wed, 12. Dec 18, 11:16

nidaren wrote:
Wed, 12. Dec 18, 09:08
Great idea!

Would you consider doing the miner edition as well? In the current build, AutoMine can be very hectic, oftentimes going all over the map.

It would be great to have selection similar to your Trader: Gather Area 1, Seller 1 etc.

If the above is not to viable, maybe command limiting the mining zone to X km from sector centre and selling to one selcted buyer.
Yes, a mining variant of the trade route script is already on my list of future possible additions. Semi-automated mining will probably even work right out of the box with the current trade route order. Set up a default route to a couple of stations buying the resource, then issue a one time minging order to the miner. If it has completed it will switch to default behaviour and look for a place to sell.

2m0re
Posts: 3
Joined: Sat, 8. Dec 18, 09:57
x4

Re: [WIP] Default Order: Trade Route

Post by 2m0re » Wed, 12. Dec 18, 11:26

TheDeliveryMan wrote:
Wed, 12. Dec 18, 11:16
nidaren wrote:
Wed, 12. Dec 18, 09:08
Great idea!

Would you consider doing the miner edition as well? In the current build, AutoMine can be very hectic, oftentimes going all over the map.

It would be great to have selection similar to your Trader: Gather Area 1, Seller 1 etc.

If the above is not to viable, maybe command limiting the mining zone to X km from sector centre and selling to one selcted buyer.
Yes, a mining variant of the trade route script is already on my list of future possible additions. Semi-automated mining will probably even work right out of the box with the current trade route order. Set up a default route to a couple of stations buying the resource, then issue a one time minging order to the miner. If it has completed it will switch to default behaviour and look for a place to sell.
nice to hear

Then why not creating a default route, where u can add stations with warez(like station button , wares button, buy or sell button and a add button for the next row),
same for miner select area, ressource and the station to sell or refill owned station.

TheDeliveryMan
Posts: 687
Joined: Sat, 10. Dec 11, 03:10
x4

Re: [WIP] Default Order: Trade Route

Post by TheDeliveryMan » Wed, 12. Dec 18, 11:32

2m0re wrote:
Wed, 12. Dec 18, 11:00
nidaren wrote:
Wed, 12. Dec 18, 09:08
Great idea!

Would you consider doing the miner edition as well? In the current build, AutoMine can be very hectic, oftentimes going all over the map.

It would be great to have selection similar to your Trader: Gather Area 1, Seller 1 etc.

If the above is not to viable, maybe command limiting the mining zone to X km from sector centre and selling to one selcted buyer.
yeah thats what i want to see, a comma d line works as loop(mine, trade , fly to).

greetz
Fully programmable loops need a different approach. For now, I want to keep it simple.

TheDeliveryMan
Posts: 687
Joined: Sat, 10. Dec 11, 03:10
x4

Re: [WIP] Default Order: Trade Route

Post by TheDeliveryMan » Wed, 12. Dec 18, 11:38

2m0re wrote:
Wed, 12. Dec 18, 11:26
TheDeliveryMan wrote:
Wed, 12. Dec 18, 11:16
nidaren wrote:
Wed, 12. Dec 18, 09:08
Great idea!

Would you consider doing the miner edition as well? In the current build, AutoMine can be very hectic, oftentimes going all over the map.

It would be great to have selection similar to your Trader: Gather Area 1, Seller 1 etc.

If the above is not to viable, maybe command limiting the mining zone to X km from sector centre and selling to one selcted buyer.
Yes, a mining variant of the trade route script is already on my list of future possible additions. Semi-automated mining will probably even work right out of the box with the current trade route order. Set up a default route to a couple of stations buying the resource, then issue a one time minging order to the miner. If it has completed it will switch to default behaviour and look for a place to sell.
nice to hear

Then why not creating a default route, where u can add stations with warez(like station button , wares button, buy or sell button and a add button for the next row),
same for miner select area, ressource and the station to sell or refill owned station.
Not sure if that is possible with the current UI.

AlienM1nd
Posts: 25
Joined: Sun, 2. Dec 18, 23:38
x4

Re: [WIP] Default Order: Trade Route

Post by AlienM1nd » Thu, 13. Dec 18, 20:37

This is exactly what I needed the other day and it wasn't in the game. And now it's here. Wohoo!

aerojet029
Posts: 78
Joined: Tue, 20. Aug 13, 14:36
x4

Re: [WIP] Default Order: Trade Route

Post by aerojet029 » Fri, 14. Dec 18, 08:02

I like the idea of tighter control, but what happens when none of your listed buyers happens to want to buy microchips (because of a stalled economy)

I would mostly be interested in a sector limiter. my traders keep going into hostile pirate space and I have to keep coming to their rescue

TheDeliveryMan
Posts: 687
Joined: Sat, 10. Dec 11, 03:10
x4

Re: [WIP] Default Order: Trade Route

Post by TheDeliveryMan » Sun, 16. Dec 18, 01:28

Alright, I made progress. The prototype of the mining route default order is basically working. The miner requires a list of deployed resource probes and a list of stations to sell to.

One thing I have not yet figured out is how to fully automate the supply of construction materials to a build storage. Using the trade route to buy the materials works just fine, but the transfer to the build storage has to be ordered manually.

ApoxNM
Posts: 777
Joined: Wed, 5. Dec 18, 06:17
x4

Re: [WIP] Default Order: Trade Route

Post by ApoxNM » Sun, 16. Dec 18, 11:34

That's great (should be in the base game :evil: ).

Could please, pretty please add the ability to add and remove sectors?

reqw
Posts: 101
Joined: Sat, 13. Jan 07, 15:23
x4

Re: [WIP] Default Order: Trade Route

Post by reqw » Sun, 16. Dec 18, 12:14

I might be stupid
Mumbels " you are no question asked "

Were can i get this trade route add on plz PRITY PLEAS

barra
Posts: 25
Joined: Tue, 31. Jan 17, 07:58
x4

Re: [WIP] Default Order: Trade Route

Post by barra » Sun, 16. Dec 18, 13:01

looks promising, please release it :)

TheDeliveryMan
Posts: 687
Joined: Sat, 10. Dec 11, 03:10
x4

Re: [WIP] Default Order: Trade Route

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

reqw wrote:
Sun, 16. Dec 18, 12: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: 141
Joined: Sun, 12. Feb 06, 19:25
x3ap

Re: [WIP] Default Order: Trade Route

Post by Paddyy » Tue, 18. Dec 18, 07: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, 18:21

Re: [WIP] Default Order: Trade Route

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

Paddyy wrote:
Tue, 18. Dec 18, 07: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: 141
Joined: Sun, 12. Feb 06, 19:25
x3ap

Re: [WIP] Default Order: Trade Route

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

Th3_0utKa5T wrote:
Wed, 19. Dec 18, 11:29
Paddyy wrote:
Tue, 18. Dec 18, 07: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: 687
Joined: Sat, 10. Dec 11, 03:10
x4

Re: [WIP] Default Order: Trade Route

Post by TheDeliveryMan » Wed, 19. Dec 18, 23: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.

Post Reply

Return to “X4: Foundations - Scripts and Modding”