[WIP][Mod]TaterTrader v4- An Autotrade Alternative

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

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

NightlinerSGS
Posts: 116
Joined: Tue, 30. Aug 05, 23:07
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by NightlinerSGS »

mellimell wrote: Sun, 23. Dec 18, 10:14
ludsoe wrote: Sun, 23. Dec 18, 02:21
mellimell wrote: Sun, 23. Dec 18, 01:28 I can get 3 or 4 traders to work but any additional stay around doing nothing....
What kind of settings are you using? If you have large search ranges and a lot of enabled wares it can take time to calculate trade routes. But it seems you're problem is more in the realm that your first 3/4 traders might be snatching up all the deals before the others can react.
I'm using them all on max buy/sell distance and 'all wares'.

I have about 30 trade vessels and most of them use the regular auto trade (all wares + max distance).
Instead of all traders trying to trade everything, try to split the traders up into categories, e.g. High-Tech traders, Food traders, Refined goods traders,...

I have done this and performance increased a bit. Profits went up by a huge amount and almost all traders are constantly busy now, presumably since they stopped competing against each other.

It's also easier to set up since you don't have to click all wares every time... :mrgreen:
User avatar
OneOfMany
Posts: 448
Joined: Thu, 15. May 14, 14:25
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by OneOfMany »

ludsoe wrote: Sun, 23. Dec 18, 02:21
OneOfMany wrote: Sat, 22. Dec 18, 22:43 Wonderful addition to the game.

As the trader finds a run he logs a msg regarding potential profit from the 2 trades lined up Any chance you could colour either the msg or the title in the log. Just to make it easier to pick out.
I don't believe I can color the log, unless you know of a example somewhere I can peek at.

Elephant42 wrote: Sun, 23. Dec 18, 01:27 Using this mod nicely, thanks for sharing.

Noob question: what do the options "Owned Station Buy Mod:" and "Owned Station Sell Mod:" do?
Those affect the prices the traders see at player owned stations.

mellimell wrote: Sun, 23. Dec 18, 01:28 I can get 3 or 4 traders to work but any additional stay around doing nothing....
What kind of settings are you using? If you have large search ranges and a lot of enabled wares it can take time to calculate trade routes. But it seems you're problem is more in the realm that your first 3/4 traders might be snatching up all the deals before the others can react.
The only thing I've found where colour is involved is this https://www.nexusmods.com/x4foundations/mods/26 - However this might be a default option for the game.
Guest242
Posts: 86
Joined: Sun, 12. Feb 17, 19:11
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by Guest242 »

Thank you for the mod. It makes the game fun again :)

1. I have a suggestion. I want to push a shipyard with hullparts but in the same sector (Argon Prime) is a wharf. The trader sometimes sell to the wharf. It is possible to make a "only sell/buy from traderhome"-button. See screenshot:
https://i.ibb.co/b545LKh/1.jpg

2. I have a engine part factory and one of my traders buy refined metals from this factory and sell it also to the same factory again. The trade log show a profit. Because I have so much ships trading/mining I can't check if this is correct. See screenshots:
https://i.ibb.co/SnGQBn7/1.jpg
https://i.ibb.co/XbT9s2C/2.jpg
daego
Posts: 36
Joined: Tue, 2. Sep 08, 20:07
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by daego »

is it possible to add a button like "Add all Trade Wares" ?
maybe in the wares list, a button top of it, colored maybe red or green ?

or a checkbox under Freetrade
- Trade all Wares
- Trade all but only Legal
ludsoe
Posts: 21
Joined: Fri, 13. Nov 09, 03:12
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by ludsoe »

daego wrote: Sun, 23. Dec 18, 16:56 is it possible to add a button like "Add all Trade Wares" ?
maybe in the wares list, a button top of it, colored maybe red or green ?

or a checkbox under Freetrade
- Trade all Wares
- Trade all but only Legal
Ive been working on some ware-list presets, since shortly after the release of V2. They will be available in V3 when it releases. The preview below might make you happy. (Assuming the image loads properly.)
Preview Of Upcoming Feature
Show
Image
You can select multiple "presets" at once and it adds all the wares of that category to the ware-list. I'm open to suggestions to add a few more category's if people provide lists.
Guest242 's Post
Show
Guest242 wrote: Sun, 23. Dec 18, 14:23 Thank you for the mod. It makes the game fun again :)

1. I have a suggestion. I want to push a shipyard with hullparts but in the same sector (Argon Prime) is a wharf. The trader sometimes sell to the wharf. It is possible to make a "only sell/buy from traderhome"-button. See screenshot:
https://i.ibb.co/b545LKh/1.jpg

2. I have a engine part factory and one of my traders buy refined metals from this factory and sell it also to the same factory again. The trade log show a profit. Because I have so much ships trading/mining I can't check if this is correct. See screenshots:
https://i.ibb.co/SnGQBn7/1.jpg
https://i.ibb.co/XbT9s2C/2.jpg
Your first suggestion, is actually a feature I want to add. (Hopefully for V4, don't want to delay V3 too long.) Currently station traders arn't actually station traders, so Ill be adding a toggle that makes the trader focus entirely on the TraderHome's buy and sell offers.

Also the buying and selling at the same station thing is hilarious, but ultimately a error on my end. I never expected the trader to actually find deals like that, Ive already patched this behavior out in V3.
OneOfMany 's Post
Show
OneOfMany wrote: Sun, 23. Dec 18, 13:44
ludsoe wrote: Sun, 23. Dec 18, 02:21
OneOfMany wrote: Sat, 22. Dec 18, 22:43 Wonderful addition to the game.

As the trader finds a run he logs a msg regarding potential profit from the 2 trades lined up Any chance you could colour either the msg or the title in the log. Just to make it easier to pick out.
I don't believe I can color the log, unless you know of a example somewhere I can peek at.
The only thing I've found where colour is involved is this https://www.nexusmods.com/x4foundations/mods/26 - However this might be a default option for the game.
Looking at that mod, it uses one of the logs built in features. Where you can attach a money value to to logs for display, but which value do I put here? Probably the profit returns expected.

Edit: Hows this.
Image
Let me explain it, It displays total cost and then the total profit as the bonus. Also I added one of those clickable arrows to let you go to the ship directly from the log.
Last edited by ludsoe on Sun, 23. Dec 18, 18:12, edited 1 time in total.
daego
Posts: 36
Joined: Tue, 2. Sep 08, 20:07
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by daego »

Thx a lot !
NightlinerSGS
Posts: 116
Joined: Tue, 30. Aug 05, 23:07
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by NightlinerSGS »

ludsoe wrote: Sun, 23. Dec 18, 17:52 - lots of stuff -
Oh boy! :D

The checkboxes look nice. As a suggestion, can you add tiered presets? What I mean is Refined, High-Tech, Ship-Tech, Agricultural,...
Mostly because I like setting my traders up this way to trade a specific group of wares so they don't trip over each others feet.

Or just let us make presets ourselves. Drop some commented lines explaining how and an example into the XML, problem solved. ;)

Excluding sectors is nice as well. However, M ships are fine trespassing through forbidden sectors along the Ring, as long as they don't leave the highway. On the other hand, L ships shouldn't to that.
Maybe you can set it up so M and L ships will behave differently? Otherwise, pathfinding is going to be a nightmare...

Buying/Selling only from specified stations would be nice. Autotrader, Station Logistics and possibly Supply Routes in one mod? Insanity!

The color coding looks nice as well.
User avatar
Da_Vinci
Posts: 17
Joined: Sun, 16. Dec 18, 11:55
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by Da_Vinci »

i had to disable this mod after 1.5 update coz after a while, when i go in map-view it slow the view when i move the map, also the game starts to be slowed
NightlinerSGS
Posts: 116
Joined: Tue, 30. Aug 05, 23:07
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by NightlinerSGS »

Da_Vinci wrote: Sun, 23. Dec 18, 20:55 i had to disable this mod after 1.5 update coz after a while, when i go in map-view it slow the view when i move the map, also the game starts to be slowed
If you haven't done it yet, turn off the lines showing the orders of your ships. This is the single heaviest resource drain on the map.

Apart from that, some slowdown is to be expected when your fleet gets bigger.
daego
Posts: 36
Joined: Tue, 2. Sep 08, 20:07
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by daego »

NightlinerSGS wrote: Sun, 23. Dec 18, 21:20
Da_Vinci wrote: Sun, 23. Dec 18, 20:55 i had to disable this mod after 1.5 update coz after a while, when i go in map-view it slow the view when i move the map, also the game starts to be slowed
If you haven't done it yet, turn off the lines showing the orders of your ships. This is the single heaviest resource drain on the map.

Apart from that, some slowdown is to be expected when your fleet gets bigger.
This is why i use the Trade Reciever Sat Mod
https://www.nexusmods.com/x4foundations/mods/120
all ships in view range from standard sat are calculated in realtime (more ships more lag)
so this sat has range of 0 but your ships see all trades in sector just with 1 trade reciever :wink:
User avatar
Da_Vinci
Posts: 17
Joined: Sun, 16. Dec 18, 11:55
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by Da_Vinci »

NightlinerSGS wrote: Sun, 23. Dec 18, 21:20
If you haven't done it yet, turn off the lines showing the orders of your ships. This is the single heaviest resource drain on the map.

Apart from that, some slowdown is to be expected when your fleet gets bigger.
Thank you for the suggest.
User avatar
Da_Vinci
Posts: 17
Joined: Sun, 16. Dec 18, 11:55
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by Da_Vinci »

daego wrote: Sun, 23. Dec 18, 22:34

This is why i use the Trade Reciever Sat Mod
https://www.nexusmods.com/x4foundations/mods/120
all ships in view range from standard sat are calculated in realtime (more ships more lag)
so this sat has range of 0 but your ships see all trades in sector just with 1 trade reciever :wink:
Well.. Now i understand why it slowed so much.. i ordered a trade to a station that doesn't support even trading yet.. so maybe the mod get confused and fill my memory of a lot of useless orders.. it's anyway something that should be avoid by a fix.
Kamuchi_
Posts: 174
Joined: Fri, 7. Dec 18, 05:04
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by Kamuchi_ »

daego wrote: Sun, 23. Dec 18, 22:34
NightlinerSGS wrote: Sun, 23. Dec 18, 21:20
Da_Vinci wrote: Sun, 23. Dec 18, 20:55 i had to disable this mod after 1.5 update coz after a while, when i go in map-view it slow the view when i move the map, also the game starts to be slowed
If you haven't done it yet, turn off the lines showing the orders of your ships. This is the single heaviest resource drain on the map.

Apart from that, some slowdown is to be expected when your fleet gets bigger.
This is why i use the Trade Reciever Sat Mod
https://www.nexusmods.com/x4foundations/mods/120
all ships in view range from standard sat are calculated in realtime (more ships more lag)
so this sat has range of 0 but your ships see all trades in sector just with 1 trade reciever :wink:
The problem with that is that you can't see hostile ships.
Now we need a mod that adds hostile ships in faction space we are allied with (+20) lol
daego
Posts: 36
Joined: Tue, 2. Sep 08, 20:07
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by daego »

Kamuchi_ wrote: Mon, 24. Dec 18, 01:17 The problem with that is that you can't see hostile ships.
hmm i think there was also a mod who a sat only is active when a hostile ship is near...
mellimell
Posts: 31
Joined: Wed, 30. Mar 16, 18:28
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by mellimell »

mellimell wrote: Sun, 23. Dec 18, 01:28 I can get 3 or 4 traders to work but any additional stay around doing nothing....
What kind of settings are you using? If you have large search ranges and a lot of enabled wares it can take time to calculate trade routes. But it seems you're problem is more in the realm that your first 3/4 traders might be snatching up all the deals before the others can react.
[/quote]

Can you give us a recommendation on how to set up a tatertrader who aims to trade multiple wares over a great distance?

As far as I understand my settings buy/sell 30/30 plus all wares is making the ship staying idle and doing nothing.

Or what would be the max settings recommended?
TearsInRain
Posts: 73
Joined: Fri, 30. Nov 18, 00:32
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by TearsInRain »

How do we upgrade from TaterTrader 1 to 2? Just copy the files over ? What do we do with existing taters?
Spacecop42
Posts: 26
Joined: Fri, 14. Dec 18, 18:45
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by Spacecop42 »

Hey, setting buy cost to owned station to 0 fills my debug log with

Code: Select all

[=ERROR=] 64326.98 Script error: Division by zero! 2194602ct / 0ct
* Expression: [this.ship.cargo.{$buyoffer.ware}.free, $buyoffer.amount, $selloffer.amount, $spendablemoney / (2 * $sellcost)].min
I had 20000 lines in a few minutes with 5 traders, thought I might let you know
Kalantris
Posts: 137
Joined: Mon, 10. Dec 18, 10:56

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by Kalantris »

Spacecop42 wrote: Mon, 24. Dec 18, 11:42 Hey, setting buy cost to owned station to 0 fills my debug log with

Code: Select all

[=ERROR=] 64326.98 Script error: Division by zero! 2194602ct / 0ct
* Expression: [this.ship.cargo.{$buyoffer.ware}.free, $buyoffer.amount, $selloffer.amount, $spendablemoney / (2 * $sellcost)].min
I had 20000 lines in a few minutes with 5 traders, thought I might let you know
I was wondering yesterday if something like that's going to happen. I never set it below 5 just to be on the safe side and keep the universe from collapsing because someone divided by 0 ;).
ludsoe
Posts: 21
Joined: Fri, 13. Nov 09, 03:12
x4

Re: [WIP][Mod]TaterTrader v2- An Autotrade Alternative

Post by ludsoe »

I just Released V3, Its got a few bug fixes. (And knowing me probably 200% more bugs in their place.)
  • The latest version has preset ware lists you can copy into the warebasket. (They are based off the ones I found, in the vanilla NPC trader files.)
  • It has the updated Logs that I teased before.
  • Ive implemented a exclude sector feature, It prevents traders from trying to find deals within the selected sectors.
    But as I don't overwrite any base game files it doesn't actually prevent ships from flying through those sectors.
  • My favorite addition for this update though, [FastTrade]. Its a setting that tells the trader to cut down search times by taking shortcuts when calculating deals.
    This opens up Galaxy traders, and allows for far more wares to be selected at once without insane search times.
mellimell 's Post
Show
mellimell wrote: Mon, 24. Dec 18, 02:28 Can you give us a recommendation on how to set up a tatertrader who aims to trade multiple wares over a great distance?

As far as I understand my settings buy/sell 30/30 plus all wares is making the ship staying idle and doing nothing.

Or what would be the max settings recommended?
Try using TaterTrader v3 with Fasttrade Enabled. Hopefully it should drastically help.
TearsInRain 's Post
Show
TearsInRain wrote: Mon, 24. Dec 18, 05:20 How do we upgrade from TaterTrader 1 to 2? Just copy the files over ? What do we do with existing taters?
When upgrading TaterTrader just delete the old folder, and slap the new one in its place. As for existing traders in you're save, they should have no problem porting over to the new version.
I try to keep compatibility between my updates.
Spacecop42 's Post
Show
Spacecop42 wrote: Mon, 24. Dec 18, 11:42 Hey, setting buy cost to owned station to 0 fills my debug log with

Code: Select all

[=ERROR=] 64326.98 Script error: Division by zero! 2194602ct / 0ct
* Expression: [this.ship.cargo.{$buyoffer.ware}.free, $buyoffer.amount, $selloffer.amount, $spendablemoney / (2 * $sellcost)].min
I had 20000 lines in a few minutes with 5 traders, thought I might let you know
I Fixed this in V3. Not sure why I let a silly error like that pass when I released V3. (Hope nothing like that happens with V3, Ill cry. :oops: )
argon_emperor
Posts: 1225
Joined: Mon, 12. Dec 05, 07:41
x4

Re: [WIP][Mod]TaterTrader v3- An Autotrade Alternative

Post by argon_emperor »

Woo! More options XD

Though I'll probably stick with what I've started this save and go with 1 trader per ware and see how that goes, but nice to have preset lists to cut down on setup times if I want multiples :)
[ external image ]
***modified***
"You can get more of what you want with kind words and a gun, than you can with just kind words" - Al Capone

Return to “X4: Foundations - Scripts and Modding”