[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

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

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

Post by DeadAirRT » Thu, 7. May 20, 06:44

Phiolin wrote:
Wed, 6. May 20, 19:59
Yes, in both blacklists. That should work, shouldn’t it? :)
It should but the caveat is that the vanilla blacklist functions are very complex and not the most reliable. L traders in particular love to take whatever random path they feel like that day.

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

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

Post by Scoob » Fri, 8. May 20, 00:00

DeadAirRT wrote:
Thu, 7. May 20, 06:44
Phiolin wrote:
Wed, 6. May 20, 19:59
Yes, in both blacklists. That should work, shouldn’t it? :)
It should but the caveat is that the vanilla blacklist functions are very complex and not the most reliable. L traders in particular love to take whatever random path they feel like that day.
There are also some weird issues in Vanilla in regards to routes picked by AI-Controlled ships. I've noticed my ships showing a perfectly acceptable route on the map when you view their orders. However, they DON'T always follow that route and take same very odd detours. The area where Teladi and Split space meet (Ianamus Zura / Thuruk's Demise) is particularly problematic. Ordering ships to fly from Ianamus Zura to Thuruk's Demise will see them try to go through the nearby Xenon sector. Very much a longer and much more dangerous route.

This, combined with less than reliable Black Lists, can cause various weirdness. I also wonder if Blacklists sometimes get corrupted somehow. I had my set a three Blacklists to protect my Civilian ships, but it simply stopped working, even though it looked fine. I then DELETED all of them, re-applied and they're working fairly reliably once more.

Basically, there are certainly some underlying vanilla issues that might make it look like other things aren't working properly.

Scoob.

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

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

Post by Scoob » Mon, 18. May 20, 23:35

Hi,

Tatertrader works well, however I have a slight issue that might just be me setting it up wrong.

I wanted to use Tater Trader to Sell Hull Parts from my Station in Argon Prime, so I set them up to just trade Hull Parts with a zero Sector range, so they only sell to the Shipyard, Wharf and any build sites. Works great, however the profit goes into my personal account, not the stations.

So, I set the Trader Home to my station - but it remains as Argon Prime - and I checked the Station Trader box. Initially, when I did this, the Ship in question moved to be listed as a Station subordinate, so I thought it'd worked, however, it quickly lost that assignment.

Basically, what I tried seemed to work in that the ship was showing as a subordinate to my Station, but then it went back to showing in the unassigned ship list. What am I missing here?

Edit: I think I've sorted it, though it can be a bit temperamental. I configured two TT the same, and this time the home Station assignment stuck and didn't revert to the Sector. One then proceeded to trade Hull parts as instructed, the other started BUYING refined metals for the station - it produces those. It appeared to have imported the full trade ware list, despite my leaving "Copy Presets" unchecked. Removing all assignments and re-configuring it seems to have worked.

Scoob.

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

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

Post by DeadAirRT » Tue, 19. May 20, 00:52

Scoob wrote:
Mon, 18. May 20, 23:35
Hi,

Tatertrader works well, however I have a slight issue that might just be me setting it up wrong.

I wanted to use Tater Trader to Sell Hull Parts from my Station in Argon Prime, so I set them up to just trade Hull Parts with a zero Sector range, so they only sell to the Shipyard, Wharf and any build sites. Works great, however the profit goes into my personal account, not the stations.

So, I set the Trader Home to my station - but it remains as Argon Prime - and I checked the Station Trader box. Initially, when I did this, the Ship in question moved to be listed as a Station subordinate, so I thought it'd worked, however, it quickly lost that assignment.

Basically, what I tried seemed to work in that the ship was showing as a subordinate to my Station, but then it went back to showing in the unassigned ship list. What am I missing here?

Edit: I think I've sorted it, though it can be a bit temperamental. I configured two TT the same, and this time the home Station assignment stuck and didn't revert to the Sector. One then proceeded to trade Hull parts as instructed, the other started BUYING refined metals for the station - it produces those. It appeared to have imported the full trade ware list, despite my leaving "Copy Presets" unchecked. Removing all assignments and re-configuring it seems to have worked.

Scoob.
Now you see why i don't like station trading :D

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

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

Post by Scoob » Tue, 19. May 20, 01:34

DeadAirRT wrote:
Tue, 19. May 20, 00:52
Now you see why i don't like station trading :D
Yeah, it was really troublesome to get working, perhaps I just screwed up. However, it's working great now.

Scoob.

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

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

Post by DeadAirRT » Fri, 22. May 20, 07:14

Spent about 8 hours working on blacklist stuff.

Annoyed at your precious TaterTraders entering sectors you've banned to reach that precious trade they can't safely reach? Testing my solution that should prevent that from ever happening again.

Cedric_FP
Posts: 189
Joined: Thu, 13. Apr 06, 17:56
x4

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

Post by Cedric_FP » Fri, 22. May 20, 09:17

DeadAirRT wrote:
Fri, 22. May 20, 07:14
Spent about 8 hours working on blacklist stuff.

Annoyed at your precious TaterTraders entering sectors you've banned to reach that precious trade they can't safely reach? Testing my solution that should prevent that from ever happening again.
Legend.

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

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

Post by bbn » Sun, 24. May 20, 00:51

While checking other things I found that TaterTrader is spamming my logs with 2 kind of messages. It's 3.20 beta, so I am not sure if something change or not... or even if those errors are "real errors".

First one:

Code: Select all

[=ERROR=] 24549.48 Error in AI script tatertrade on entity 0x705ed1b: Property lookup failed: $foundselloffer.restriction.faction
* $foundselloffer == trade.{0x43bc4L} (ware=smartchips, buyer=[0x0], seller=[0x10e9c47], bundle=false, unbundle=false, available=true)
* Expression: not ($foundselloffer.restriction.faction == $stationbuyoffer.buyer.owner) and not ($stationbuyoffer.restriction.faction == $foundselloffer.seller.owner) and not ($stationbuyoffer.restriction.faction == $foundselloffer.restriction.faction)
* Action: <do_if>, line 916
Second one:

Code: Select all

[=ERROR=] 24549.18 Error in AI script tatertrade on entity 0x705ed1b: Warning: Loss of data while converting floating point number to a money value! 64.5062f + 15ct
* Expression: $offerpriority + $costdiff / 2

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

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

Post by DeadAirRT » Sun, 24. May 20, 04:13

bbn wrote:
Sun, 24. May 20, 00:51
While checking other things I found that TaterTrader is spamming my logs with 2 kind of messages. It's 3.20 beta, so I am not sure if something change or not... or even if those errors are "real errors".

First one:

Code: Select all

[=ERROR=] 24549.48 Error in AI script tatertrade on entity 0x705ed1b: Property lookup failed: $foundselloffer.restriction.faction
* $foundselloffer == trade.{0x43bc4L} (ware=smartchips, buyer=[0x0], seller=[0x10e9c47], bundle=false, unbundle=false, available=true)
* Expression: not ($foundselloffer.restriction.faction == $stationbuyoffer.buyer.owner) and not ($stationbuyoffer.restriction.faction == $foundselloffer.seller.owner) and not ($stationbuyoffer.restriction.faction == $foundselloffer.restriction.faction)
* Action: <do_if>, line 916
Second one:

Code: Select all

[=ERROR=] 24549.18 Error in AI script tatertrade on entity 0x705ed1b: Warning: Loss of data while converting floating point number to a money value! 64.5062f + 15ct
* Expression: $offerpriority + $costdiff / 2
I'm not supporting the beta because it would break 3.1 but thanks for the report.

I'll take a look into the second one, it's harmless usually. What settings are you using on trader?

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

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

Post by bbn » Sun, 24. May 20, 11:04

DeadAirRT wrote:
Sun, 24. May 20, 04:13
I'm not supporting the beta because it would break 3.1 but thanks for the report.
Sure, it's seems like it's related to the new trade rules somehow...

I'm guessing that I cannot count on TaterTraders to obey restriction in this save ^^.
DeadAirRT wrote:
Sun, 24. May 20, 04:13
I'll take a look into the second one, it's harmless usually. What settings are you using on trader?
Fortunately, this was quite early in new save, so I have just 4 TaterTraders setup. Don't know exactly which one, but they are set up similar way. I set trader home for 2 of them to ARG Wharf and for the other 2 to ARG Shipyard. Max gate distance to buy set to 10, checked station trader and added all wares to the list.

(now I'm wondering if I should continue 3.2b with mods, go back to my vanilla save, or maybe go back to 3.1...)

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

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

Post by DeadAirRT » Sun, 24. May 20, 14:59

bbn wrote:
Sun, 24. May 20, 11:04
DeadAirRT wrote:
Sun, 24. May 20, 04:13
I'm not supporting the beta because it would break 3.1 but thanks for the report.
Sure, it's seems like it's related to the new trade rules somehow...

I'm guessing that I cannot count on TaterTraders to obey restriction in this save ^^.
DeadAirRT wrote:
Sun, 24. May 20, 04:13
I'll take a look into the second one, it's harmless usually. What settings are you using on trader?
Fortunately, this was quite early in new save, so I have just 4 TaterTraders setup. Don't know exactly which one, but they are set up similar way. I set trader home for 2 of them to ARG Wharf and for the other 2 to ARG Shipyard. Max gate distance to buy set to 10, checked station trader and added all wares to the list.

(now I'm wondering if I should continue 3.2b with mods, go back to my vanilla save, or maybe go back to 3.1...)
The only problem the 3.2 will cause are traders ignoring "restrict trade to other factions" and the trade rules afaik

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

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

Post by bbn » Mon, 25. May 20, 16:33

DeadAirRT wrote:
Sun, 24. May 20, 14:59
bbn wrote:
Sun, 24. May 20, 11:04
DeadAirRT wrote:
Sun, 24. May 20, 04:13
I'm not supporting the beta because it would break 3.1 but thanks for the report.
Sure, it's seems like it's related to the new trade rules somehow...

I'm guessing that I cannot count on TaterTraders to obey restriction in this save ^^.
DeadAirRT wrote:
Sun, 24. May 20, 04:13
I'll take a look into the second one, it's harmless usually. What settings are you using on trader?
Fortunately, this was quite early in new save, so I have just 4 TaterTraders setup. Don't know exactly which one, but they are set up similar way. I set trader home for 2 of them to ARG Wharf and for the other 2 to ARG Shipyard. Max gate distance to buy set to 10, checked station trader and added all wares to the list.

(now I'm wondering if I should continue 3.2b with mods, go back to my vanilla save, or maybe go back to 3.1...)
The only problem the 3.2 will cause are traders ignoring "restrict trade to other factions" and the trade rules afaik
Just to double confirm for anyone on beta -> that's their behavior. Work perfectly fine for last couple of hours of gameplay, but ignore my travel restrictions.

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

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

Post by DeadAirRT » Mon, 25. May 20, 18:34

So i spent a few hours working on the code yesterday and found a few bugs/unintended behavior.

When using check distance, it will no longer view jumps past a certain number as negative but will instead scale properly with the percent.

When using check distance, it will no longer prefer dangerous trades over safer ones (trades that have no safe route to the destination)

There are some new delays that are skill based to prevent traders from grabbing the same trade at the same moment (the delay is not human noticable). This issue was especially prevalent with civ fleets.

If everything goes right in testing after i get off work, I'll upload version to all platforms today.

New version on GitHub for testing.

Cedric_FP
Posts: 189
Joined: Thu, 13. Apr 06, 17:56
x4

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

Post by Cedric_FP » Thu, 18. Jun 20, 03:37

Is there any way I can restrict my tatertraders to only trade with a certain faction?

I have tried a blacklist, selecting the faction checklist boxes, and also trying to only limit to "included sectors" but they seem to ignore it. I suspect it is me that is doing something wrong, so any guidance on this would be appreciated!

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

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

Post by DeadAirRT » Thu, 18. Jun 20, 08:51

Cedric_FP wrote:
Thu, 18. Jun 20, 03:37
Is there any way I can restrict my tatertraders to only trade with a certain faction?

I have tried a blacklist, selecting the faction checklist boxes, and also trying to only limit to "included sectors" but they seem to ignore it. I suspect it is me that is doing something wrong, so any guidance on this would be appreciated!
Which version are you running? They shouldn't be ignoring blacklist, trade rules, or faction restriction checklist so something definitely sounds off.

Cedric_FP
Posts: 189
Joined: Thu, 13. Apr 06, 17:56
x4

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

Post by Cedric_FP » Fri, 19. Jun 20, 04:26

DeadAirRT wrote:
Thu, 18. Jun 20, 08:51
Cedric_FP wrote:
Thu, 18. Jun 20, 03:37
Is there any way I can restrict my tatertraders to only trade with a certain faction?

I have tried a blacklist, selecting the faction checklist boxes, and also trying to only limit to "included sectors" but they seem to ignore it. I suspect it is me that is doing something wrong, so any guidance on this would be appreciated!
Which version are you running? They shouldn't be ignoring blacklist, trade rules, or faction restriction checklist so something definitely sounds off.
Yeah it was me doing something wrong. I had gotten my blacklist the wrong way around (i restricted from argon/antigone instead of from everybody else BUT argone and antigone, man I'm dumb). Thanks for taking the time to respond.

On the tatertrader setup for default behavior, in order for me to restrict trade without using a global blacklist, I would tick the "enable trade bans" box and then tick every box I *don't* want my trader to trade with, right?

Do I need to tick 'enable trade bans' if I want to do the included sector method of restricting?

Thanks for your time, Deadair!

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

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

Post by DeadAirRT » Fri, 19. Jun 20, 04:31

Cedric_FP wrote:
Fri, 19. Jun 20, 04:26
DeadAirRT wrote:
Thu, 18. Jun 20, 08:51
Cedric_FP wrote:
Thu, 18. Jun 20, 03:37
Is there any way I can restrict my tatertraders to only trade with a certain faction?

I have tried a blacklist, selecting the faction checklist boxes, and also trying to only limit to "included sectors" but they seem to ignore it. I suspect it is me that is doing something wrong, so any guidance on this would be appreciated!
Which version are you running? They shouldn't be ignoring blacklist, trade rules, or faction restriction checklist so something definitely sounds off.
Yeah it was me doing something wrong. I had gotten my blacklist the wrong way around (i restricted from argon/antigone instead of from everybody else BUT argone and antigone, man I'm dumb). Thanks for taking the time to respond.

On the tatertrader setup for default behavior, in order for me to restrict trade without using a global blacklist, I would tick the "enable trade bans" box and then tick every box I *don't* want my trader to trade with, right?

Do I need to tick 'enable trade bans' if I want to do the included sector method of restricting?

Thanks for your time, Deadair!
Enable trade bans activates the blocking of trade with the factions checked on the order screen

You can use included or excluded sector by just adding them

As long as you don't check "free trade" they will abide by trade bans and blacklistings

edit - no problem, glad to help

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

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

Post by Scoob » Mon, 22. Jun 20, 03:35

Hi,

I used Tater Trader with an ARG Drill Vanguard to have it sell my excess Nividium from my HQ. This worked great for a while, but after a couple of successful trades this ship CLEARED its TaterTrader task and was re-assigned as a normal Mining ship.

Basically, this TaterTrader was assigned to the Alpha Defence group at the HQ, buying Nividium from the station and selling it to various Trading Stations within five jumps. Now it's assigned its self to Delta Group and is going to mine.

Is this some thing you can investigate? I run multiple mods, so I don't know if a save would be of any use.

Scoob.

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

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

Post by DeadAirRT » Mon, 22. Jun 20, 14:47

Scoob wrote:
Mon, 22. Jun 20, 03:35
Hi,

I used Tater Trader with an ARG Drill Vanguard to have it sell my excess Nividium from my HQ. This worked great for a while, but after a couple of successful trades this ship CLEARED its TaterTrader task and was re-assigned as a normal Mining ship.

Basically, this TaterTrader was assigned to the Alpha Defence group at the HQ, buying Nividium from the station and selling it to various Trading Stations within five jumps. Now it's assigned its self to Delta Group and is going to mine.

Is this some thing you can investigate? I run multiple mods, so I don't know if a save would be of any use.

Scoob.
If you don't assign it to the station it should be fine.

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

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

Post by Scoob » Mon, 22. Jun 20, 15:37

DeadAirRT wrote:
Mon, 22. Jun 20, 14:47
If you don't assign it to the station it should be fine.
Thanks for replying, I appreciate it.

Do you mean don't assign it as a station trader? I just ordered the ship from the Wharf and, once built, set it up as a Tater Trader trading only Nividium. I thought assigning it to the station was essential for this to work correctly? Perhaps I'm missing some nuance of the configuration? I know it worked perfectly for at least two runs, then reset. The second time it didn't even make a single sale, it idled for a bit, then re-assigned its self to the Mining group.

I will play around some more this evening.

If at all possible, could you perhaps screen-shot the exact options I should be using for this role? Basically, selling Nividium from the HQ.

Scoob.

Post Reply

Return to “X4: Foundations - Scripts and Modding”