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

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

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

Scoob
Posts: 10071
Joined: Thu, 27. Feb 03, 22:28
x4

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

Post by Scoob » Mon, 20. Apr 20, 23:13

DeadAirRT wrote:
Mon, 20. Apr 20, 21:02
So I went against my own thinking because I didn't want to deal with complaints.

V1.03 - Added % penalty per jump param, changed faction names to t file references (for auto translation), added new factions to faction ban list, and changed distance calculation penalty to account for blacklist sensitive travel route.
Cool, reverse psychology successful :)

Downloading now...

Scoob.

Scoob
Posts: 10071
Joined: Thu, 27. Feb 03, 22:28
x4

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

Post by Scoob » Tue, 21. Apr 20, 00:01

Query:

I want the Tater Trader to Buy EC's for my HQ. So, I've set it as follows:

HomeBound (HQ)
Max gates 6 for both
Station Trader
Wares #1 Energy Cells

And that's it, nothing else checked. The Trader does indeed Buy EC's, but it then tries to sell them elsewhere, not to my HQ - which has ample funds and Storage. EC's limit it set to 25k and I'm about half way there.

Shouldn't it prioritise bringing the EC's it finds back to the HQ before it tries to sell them? If the HQ was FULL of EC's this behaviour would be fine, but it's not.

Note: using a vanilla trader to do this, results in it buying 46 (or a very small number) of EC's each run - this is a BUG I reported during the beta.

Note 2: HQ's Trader offers look just fine.

Scoob.

DeadAirRT
Posts: 1022
Joined: Fri, 25. Jan 19, 03:26
x4

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

Post by DeadAirRT » Tue, 21. Apr 20, 02:11

Scoob wrote:
Tue, 21. Apr 20, 00:01
Query:

I want the Tater Trader to Buy EC's for my HQ. So, I've set it as follows:

HomeBound (HQ)
Max gates 6 for both
Station Trader
Wares #1 Energy Cells

And that's it, nothing else checked. The Trader does indeed Buy EC's, but it then tries to sell them elsewhere, not to my HQ - which has ample funds and Storage. EC's limit it set to 25k and I'm about half way there.

Shouldn't it prioritise bringing the EC's it finds back to the HQ before it tries to sell them? If the HQ was FULL of EC's this behaviour would be fine, but it's not.

Note: using a vanilla trader to do this, results in it buying 46 (or a very small number) of EC's each run - this is a BUG I reported during the beta.

Note 2: HQ's Trader offers look just fine.

Scoob.
Tater prioritizes profit most of the time. I honestly don't know 100% what differences that Ludsoe put in for station trading but I did see some manipulation to prioritize something else in that part.

If you have it set on auto price, most likely it just doesn't view your trade as good as another station. I'm not a fan of homebound or station trader myself, so my recommendation would be to use the owned station buy modifier and/or set the price of EC at your HQ.

tntnfred
Posts: 3
Joined: Tue, 21. Apr 20, 11:28
x4

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

Post by tntnfred » Wed, 22. Apr 20, 04:19

Hi !

Just started to use this mod to supply my stations, and might very well roll it out to my traders as well, this really looks like CAG/CLS rolled into one !
DeadAirRT wrote:
Tue, 21. Apr 20, 02:11
I'm not a fan of homebound or station trader myself, so my recommendation would be to use the owned station buy modifier and/or set the price of EC at your HQ.
Would you mind sharing why you don't like homebound/station trader ? I am currently using station trader while banning non-player faction to make sure the freighters only move wares between my own stations. Would there be an advantage doing it through the price modifiers ?

A couple comments on the mod :

1) while it is surprisingly straightforward to setup (and yet powerful), I can suggest one more quality of life improvement : in the faction list, there should be a "select/deselect all" toggle, or perhaps a dedicated button to restrict trade to player faction. In the scenario above where the traders only deal with my stations, I need to click on restrict trade, then click on every NPC faction one by one, for each trader. Such a toggle would save a lot of clicks !

2) Similarly, being able to save/restore entire configurations would be awesome once you start expanding your trading fleet (the ware presets are already helping in that respect).

3) I've also noticed that TaterTraders assigned to a station appear in the subordinate list as tasked to "Defence" ; it doesn't seem to affect their job, just a cosmetic thing.

Thanks again for maintaining & expanding this script !

DeadAirRT
Posts: 1022
Joined: Fri, 25. Jan 19, 03:26
x4

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

Post by DeadAirRT » Wed, 22. Apr 20, 08:26

tntnfred wrote:
Wed, 22. Apr 20, 04:19
Hi !

Just started to use this mod to supply my stations, and might very well roll it out to my traders as well, this really looks like CAG/CLS rolled into one !
DeadAirRT wrote:
Tue, 21. Apr 20, 02:11
I'm not a fan of homebound or station trader myself, so my recommendation would be to use the owned station buy modifier and/or set the price of EC at your HQ.
Would you mind sharing why you don't like homebound/station trader ? I am currently using station trader while banning non-player faction to make sure the freighters only move wares between my own stations. Would there be an advantage doing it through the price modifiers ?

A couple comments on the mod :

1) while it is surprisingly straightforward to setup (and yet powerful), I can suggest one more quality of life improvement : in the faction list, there should be a "select/deselect all" toggle, or perhaps a dedicated button to restrict trade to player faction. In the scenario above where the traders only deal with my stations, I need to click on restrict trade, then click on every NPC faction one by one, for each trader. Such a toggle would save a lot of clicks !

2) Similarly, being able to save/restore entire configurations would be awesome once you start expanding your trading fleet (the ware presets are already helping in that respect).

3) I've also noticed that TaterTraders assigned to a station appear in the subordinate list as tasked to "Defence" ; it doesn't seem to affect their job, just a cosmetic thing.

Thanks again for maintaining & expanding this script !
I have always disliked station traders because the code is unfortunately much more complicated and prone to breaking. I also think it is inefficient since i tend to build multiple stations in a sector (that only has my stations in them).
Homebound in my opinion will never add any benefit. If the ship completes a sale then has to return home, if it then wants to buy where it just left to sell at home... This distance travelled has essentially doubled. If it wants to buy something elsewhere, it will never take a longer route than the route returning home + to destination. If it wants to sell, then the only difference is where it calculated the trade.

I could try to look into making a select all toggle but it would probably require some tweaking. If i find out a way to set up a dynamic list selection like sectors for example, then i should be able to. One thing to note, you could always set up a trade restriction blacklist through vanilla but don't set it as a default for civilian. You could then apply that blacklist to a ship so it would save you a few clicks.

For the order copying, i recommend civilian fleets mod which will apply the same orders to all trader ships in the same fleet. Right now it's the best option available in my opinion (as my expertise so to speak is more on the Galaxy scale modding than aiscripts)

goodgimp
Posts: 81
Joined: Fri, 13. Mar 09, 04:44
x3tc

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

Post by goodgimp » Wed, 22. Apr 20, 18:25

I'm tempted to try this mod out as I'm getting a little frustrated with the vanilla traders. Is this something that can be enabled/disabled during a save, or once enabled in a save does it need to stay on? I'm pretty new to X4, so sorry if the question sounds dumb. :)

Thanks!

Vectorial1024
Posts: 224
Joined: Mon, 30. Jul 18, 04:16
x4

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

Post by Vectorial1024 » Wed, 22. Apr 20, 19:30

goodgimp wrote:
Wed, 22. Apr 20, 18:25
I'm tempted to try this mod out as I'm getting a little frustrated with the vanilla traders. Is this something that can be enabled/disabled during a save, or once enabled in a save does it need to stay on? I'm pretty new to X4, so sorry if the question sounds dumb. :)

Thanks!
This can be enabled anytime. However, if you are using this mod (as in, some ships are using the TaterTrade order), you gotta first stop all those ships, remove their TaterTrade orders, and then you can safely remove this mod.
The future awaits.

X4 Foundations mods:
Civilian Fleets: Managing your civilian ships has never been easier.
Station Logistics: Managing your station networks has never been easier.
Scrap Delivery Coordination: No more starving scrap processors.

User avatar
bbn
Posts: 88
Joined: Mon, 31. Jan 11, 18:30
x4

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

Post by bbn » Wed, 22. Apr 20, 19:46

I've read though full thread but one thing is not 100% clear to me. If I set on my station to restrict trade for let's say refined metals with other factions and set minimum sell price than TateTraders will not trade in refined metals from this station (and vanilla autotraders will just ignore the setting and empty my inventory for little profit), correct?

Now if I'm thinking right I can do proper CLS with TateTrader and station traders, right? E.g., build multiple stations that supply each others, my station-assigned traders will move wares between them and only the end product I want to sell will go to NPCs...

DeadAirRT
Posts: 1022
Joined: Fri, 25. Jan 19, 03:26
x4

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

Post by DeadAirRT » Wed, 22. Apr 20, 20:06

bbn wrote:
Wed, 22. Apr 20, 19:46
I've read though full thread but one thing is not 100% clear to me. If I set on my station to restrict trade for let's say refined metals with other factions and set minimum sell price than TateTraders will not trade in refined metals from this station (and vanilla autotraders will just ignore the setting and empty my inventory for little profit), correct?

Now if I'm thinking right I can do proper CLS with TateTrader and station traders, right? E.g., build multiple stations that supply each others, my station-assigned traders will move wares between them and only the end product I want to sell will go to NPCs...
If you want your stations to only supply your own stations you have two options. Restrict trade to other factions on the good at both stations, set sell price to minimum at the supplying station and set buy price to maximum on the receiving station.

The other option is a bit more complicated but would allow your supplying station to still sell to other factions. Restrict trade to other factions on the good at the receiving station. Leave the settings automated at the supplying station without messing with restriction or auto price. Raise the traders owned station buy modifier and lower the sell modifier as needed. Note: the sell modifier would apply to calculation on trades from your supplying station to any station (not just your own) and the buy modifier would apply to calculation on trades for your receiving station (which is why you restrict the resources to your own faction)

You don't need to assign trader to station for either option to work.

User avatar
bbn
Posts: 88
Joined: Mon, 31. Jan 11, 18:30
x4

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

Post by bbn » Wed, 22. Apr 20, 20:38

Thank you for your detailed explanation!

User avatar
klaatu
Posts: 316
Joined: Fri, 21. Nov 03, 17:23
x4

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

Post by klaatu » Thu, 23. Apr 20, 03:18

I know this should be self-evident, but I'm still confused. Could you (DeadAirRT, as I'm using your fork) perhaps expand on the explanation of the "Owned Station Sell Mod" setting? If I set it at 10 is the trader more or less likely to sell to my own stations? Likewise, if it's set at 200 is the trader more or less likely to sell to my own stations? I would assume the opposite of 10, but who knows. TIA

I guess the same could be asked about the "Owned Station Buy Mod" setting. It I set it at 10 is the trader more or less likely to buy from my own stations? And the same at 200. TIAA :)
"It's so simple. No, wait--it's needlessly complex!"
- Homer Simpson
You need this!: Cargo Delivery Service

DeadAirRT
Posts: 1022
Joined: Fri, 25. Jan 19, 03:26
x4

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

Post by DeadAirRT » Thu, 23. Apr 20, 03:25

klaatu wrote:
Thu, 23. Apr 20, 03:18
I know this should be self-evident, but I'm still confused. Could you perhaps expand on the explanation of the "Owned Station Sell Mod" setting? If I set it at 10 is the trader more or less likely to sell to my own stations? Likewise, if it's set at 200 is the trader more or less likely to sell to my own stations? I would assume the opposite of 10, but who knows. TIA

I guess the same could be asked about the "Owned Station Buy Mod" setting. It I set it at 10 is the trader more or less likely to buy from my own stations? And the same at 200. TIAA :)
Owned station sell mod = sell price * (number/100)
Setting above 100, would make the price to buy look more expensive (worse trading margin, less likely to take)
Setting below 100, would make the price to buy look less expensive (better trading margin, more likely to take)

Owned station buy mod = buy price * (number/100)
Setting above 100, would make the price to sell look more expensive (better trading margin, more likely to take)
Setting below 100, would make the price to sell look less expensive (worse trading margin, less likely to take)

User avatar
klaatu
Posts: 316
Joined: Fri, 21. Nov 03, 17:23
x4

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

Post by klaatu » Thu, 23. Apr 20, 10:31

DeadAirRT wrote:
Thu, 23. Apr 20, 03:25
Owned station sell mod = sell price * (number/100)
Setting above 100, would make the price to buy look more expensive (worse trading margin, less likely to take)
Setting below 100, would make the price to buy look less expensive (better trading margin, more likely to take)

Owned station buy mod = buy price * (number/100)
Setting above 100, would make the price to sell look more expensive (better trading margin, more likely to take)
Setting below 100, would make the price to sell look less expensive (worse trading margin, less likely to take)
So I had it wrong all the way around. If "Owned station sell mod" is set to 10 the trader is more likely to buy from your own stations. If 200, the trader is less likely to buy from your own.

Likewise, if "Owned station buy mod" is set to 10 the trader is less likely to sell to your own stations. If 200, the trader is more likely to sell to your own.

So, to give preference to your own stations to your (tater) traders, buy high, sell low. :)

Got it. Thanks DeadAirRT.
"It's so simple. No, wait--it's needlessly complex!"
- Homer Simpson
You need this!: Cargo Delivery Service

Scoob
Posts: 10071
Joined: Thu, 27. Feb 03, 22:28
x4

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

Post by Scoob » Fri, 24. Apr 20, 03:54

Hi,

My Tater Traders are constantly going into Xenon Sectors, despite Blacklists to tell them not to. They even manage to enter Xenon sectors I've not discovered yet. They enter, then instantly want to turn around - at least, that's what their route plan overlay says - but they'll usually just keep flying into the sector and die.

Any ideas what might be causing this? They generally work well, but they do this a little too often, I just reload when it occurs as they're large, expensive ships.

Scoob.

DeadAirRT
Posts: 1022
Joined: Fri, 25. Jan 19, 03:26
x4

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

Post by DeadAirRT » Fri, 24. Apr 20, 04:02

Scoob wrote:
Fri, 24. Apr 20, 03:54
Hi,

My Tater Traders are constantly going into Xenon Sectors, despite Blacklists to tell them not to. They even manage to enter Xenon sectors I've not discovered yet. They enter, then instantly want to turn around - at least, that's what their route plan overlay says - but they'll usually just keep flying into the sector and die.

Any ideas what might be causing this? They generally work well, but they do this a little too often, I just reload when it occurs as they're large, expensive ships.

Scoob.
Is that the only path to the destination? I'm not quite as familiar with vanilla stuff.

How do you have your blacklist's set up?

Scoob
Posts: 10071
Joined: Thu, 27. Feb 03, 22:28
x4

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

Post by Scoob » Fri, 24. Apr 20, 04:12

DeadAirRT wrote:
Fri, 24. Apr 20, 04:02

Is that the only path to the destination? I'm not quite as familiar with vanilla stuff.

How do you have your blacklist's set up?
No, not the only path, sometimes not even a path it seems. It's really weird. I just removed all my Black lists and re-did them, in case something had gone screwy. Will see if that helps.

Scoob.

ShiBDiB
Posts: 78
Joined: Mon, 7. May 07, 00:12
x4

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

Post by ShiBDiB » Sat, 25. Apr 20, 01:16

deadair do you have a github version of this somewhere? Was going to do a PR that adds a toggle avoiding supply ships as trade targets
-----
My Mods
Go Home Drone, Reaction Force, Disable Story, Pay The Builder, Landlord, Training Exercise
Github with the latest (Unstable) Versions
Nexus Page
Steam Workshop Page

Phiolin
Posts: 158
Joined: Wed, 26. May 04, 08:49
x4

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

Post by Phiolin » Sat, 25. Apr 20, 08:29

GitHub is here: https://github.com/DeadAirRT/TaterTrader

It is quite well hidden somewhere in the thread. Maybe it would be better starting a new thread or including it with the other deadAir mods, as it doesn’t look like OP is returning.

Phiolin
Posts: 158
Joined: Wed, 26. May 04, 08:49
x4

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

Post by Phiolin » Sun, 26. Apr 20, 11:08

When setting trader home to a station, I see it automatically assigns itself to that station, which is good for organization.
However, mine assigns itself into the "Defence" station fleet. Any reason why it does that? Wouldn't it make more sense to have it in the "Trader" fleet by default?

DeadAirRT
Posts: 1022
Joined: Fri, 25. Jan 19, 03:26
x4

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

Post by DeadAirRT » Sun, 26. Apr 20, 17:13

Phiolin wrote:
Sun, 26. Apr 20, 11:08
When setting trader home to a station, I see it automatically assigns itself to that station, which is good for organization.
However, mine assigns itself into the "Defence" station fleet. Any reason why it does that? Wouldn't it make more sense to have it in the "Trader" fleet by default?
It would make more sense. The problem is, i don't believe there is access to that code and part of the reason why i dislike assigning ships to stations. It is overly complicated for no benefit (other than ui stuff) imo.

Post Reply

Return to “X4: Foundations - Scripts and Modding”