After my first round of testing, I have some feedback.
Quick overview of my setup : A few factories that only need miners and produce everything they need from raw resources. One trade station (
more on that later) that bought my factories' final products.
Everything set to exclude other factions, and I only used your scripts, no vanilla trader or other Tatertrade (only vanilla miners assigned to stations).
Overall, the scripts work absolutely great ! As you said, they do make trade runs with 0 profit when they have no better option, which is very useful, no other script will do it. Still *a little* too much idle time between runs, but light-years beyond vanilla behaviors
One caveat : this maybe linked to the the vanilla behavior of station managers, but I can't get your scripts to buy up any ware that the station uses. For ex. : My station produces a lot of E-cells, and consumes a few of them. Your traders will never buy e-cells from this station ever, they'll just idle if they have no other supplier. Probably because the wares are marked by the manager as 'must store' because they are used in production, even when the storage for them is full...
That behavior was consistent on every station : wares that were used were never sold, wares not used were sold without problem. Only exception : food and meds, sold without problem even though pops consumed it.
And I say 'sold', but I noticed something strange : the stations didn't get nor spend a dime for these trades (all happening between player-owned stations). My trade station bought everything my factories made but the budget never moved a single cent, even though I was selling nothing yet, only buying.
Also tried your script on a few mining ships : worked great. The only problem is that it uses resource probes, and they never worked right for me. Must have dropped 30 probes at various resource-filled spots in Nopileo's Fortune, only 3 ever gave me readings, so the other ones couldn't be used as 'vendors'. And they vastly underestimate available resources : one probe was showing almost 0 ice density, and my miner with your script was idling waiting for ice to be available at the probe. But a vanilla miner was happily mining a huge ice asteroid less than 3 km from the probe, and I saw a lot more ice around. So it would probably work a lot better if we could set a whole system as 'vendor' instead of a resource probe, as they are problematic.
One quality-of life request : it would be useful if the ships could get as commander the first player-owned station they find in their buyer and seller lists. That way they don't clutter the 'unassigned ships' section of the UI.
Your script work great to patch supply gaps : for instance, vanilla miners sometimes mine too much of one resource the station needs and not enough of another. If the price of raw resources fluctuates automatically in your factories, a few miners running your script will go to the station with the best price, thus the worse shortage, and avoid production stopping down the line.
But these scripts still THINK, check prices, idle a little, all that.
Sometimes that's what you need, but mostly I need something even simpler : a basic order loop.
Go to station A => Pick up ware => Go to station B => Drop ware => Back to station A. That's it, no idle time, no recrimination.
You can go a bit fancier :
Goto A => Check if enough ware to fill cargo => Wait until true, then pick up => Goto B => check if space in storage, then drop => Back to A.
Now the deluxe version, that's on top of my wishlist
Same as before, but with potentially several suppliers and buyers.
BUT : the script ALWAYS buys from vendor 1 if enough to fill cargo. If not, only then do you check vendor 2, then 3, etc.
Same with several customers : always sell to customer 1 if enough space to take the delivery. If not, only then do you check customer 2.
That way the script has almost no calculations involved, so can loop orders without lag, and most importantly it behaves in an entirely deterministic
manner. That would be just perfect.
As an added bonus, if those scripts can drop cargo into a station 'non-consensually', even if the station has no buy order for it, that can be enough to create a rudimentary trade station. Once you have a ware in inventory, you can set a sell offer and manage the price from the logistical overview. You then just need to keep force-feeding more wares into it, instead of having buy offers.
Now onto some feedback about the WIP Trade Station Mod, in a spoiler since it's a bit off-topic.
It works !!!! My god it's amazing, I could kiss you right now !
Sure, I couldn't find a way to change the buy price in-game, so I had to dig in the save's xml to edit the overrides myself. Not exactly user-friendly, i'll grant you that
But once that was done, it worked like a dream !
The wares only apprar in the logistical overview once there is at least one unit in stock though, but then you can set the sell prices from there as you want, add or remove auto pricing without affecting your buy prices.
Now all you need is a way to see the buy offers in the logistical overview, so you can set the prices there, and the mod will be ready in my opinion for a beta release.
The only small bug I encountered : when I asked my station to build itself some drones, the order my manager put in for drone parts, e-cells and smartchips overwrote my buy prices and deleted my sell order for these wares.
But really, given how AMAZING it is to finally have my trade station, it's a very minor annoyance.
Thanks so much ! And all this from repurposing an AI script. The greatest effect from the smallest of changes, a true master of code at work