[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

Invasion
Posts: 212
Joined: Tue, 11. Dec 18, 10:14

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

Post by Invasion »

siath70 wrote: Wed, 19. Dec 18, 06:31 Just noticed, that tatertraders do not pay attention if you have a station set to restrict trade with other factions ticked.

I have a station making hull parts for my other projects and there is a tater trader happily selling those hull parts to other faction stations.
Yikes. Not using this then
<Blunt Threadslayer>
Making you sweat today, so you won't have to bleed tomorrow
siath70
Posts: 459
Joined: Sun, 11. Jan 04, 03:03
x4

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

Post by siath70 »

Invasion wrote: Wed, 19. Dec 18, 06:35
siath70 wrote: Wed, 19. Dec 18, 06:31 Just noticed, that tatertraders do not pay attention if you have a station set to restrict trade with other factions ticked.

I have a station making hull parts for my other projects and there is a tater trader happily selling those hull parts to other faction stations.
Yikes. Not using this then
It's intermittant, but it's there. I shouldn't have made it sound like a huge problem as I really haven't had that much of an issue with it. I have seen it sell three loads of hull parts to other factions when set on restrict. Then it starts filling my orders, I don't know if this is a glitch in the base code or a glitch in my game.

But I thought I would mention it so it gets looked into.

Honestly this is a great trader code, I just wish you could set the trader to which factions you want to trade with. I have no idea why that isn't in the game. Like you select wares, that way you can tailor your traders.
Invasion
Posts: 212
Joined: Tue, 11. Dec 18, 10:14

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

Post by Invasion »

siath70 wrote: Wed, 19. Dec 18, 06:38 It's intermittant, but it's there. I shouldn't have made it sound like a huge problem as I really haven't had that much of an issue with it. I have seen it sell three loads of hull parts to other factions when set on restrict. Then it starts filling my orders, I don't know if this is a glitch in the base code or a glitch in my game.

But I thought I would mention it so it gets looked into.
I believe this happens because of how 'Restrict faction trading' works. That setting is actually meant for traders assigned to the station, because assigned traders are part of the station's AI and can ensure the wares are not being taken to other factions.

Autotraders work differently. They work for themselves. However they can also buy from your station that has turned on restrict faction trading. The station won't say no because all it sees is another trader from the player faction, and is not aware of who the autotrader intends to sell to.
<Blunt Threadslayer>
Making you sweat today, so you won't have to bleed tomorrow
Kamuchi_
Posts: 174
Joined: Fri, 7. Dec 18, 05:04
x4

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

Post by Kamuchi_ »

Invasion wrote: Wed, 19. Dec 18, 06:48
siath70 wrote: Wed, 19. Dec 18, 06:38 It's intermittant, but it's there. I shouldn't have made it sound like a huge problem as I really haven't had that much of an issue with it. I have seen it sell three loads of hull parts to other factions when set on restrict. Then it starts filling my orders, I don't know if this is a glitch in the base code or a glitch in my game.

But I thought I would mention it so it gets looked into.
I believe this happens because of how 'Restrict faction trading' works. That setting is actually meant for traders assigned to the station, because assigned traders are part of the station's AI and can ensure the wares are not being taken to other factions.

Autotraders work differently. They work for themselves. However they can also buy from your station that has turned on restrict faction trading. The station won't say no because all it sees is another trader from the player faction, and is not aware of who the autotrader intends to sell to.
You are right.
I used my galaxy traders in my previous save like that, restrict the station and set minimum price, no npc can trade with the station but your own galaxy traders will prefer buying from your own station.
This has nothing to to with TaterTrader or any other trader mod out there as it's a game mechanic.
You could however add a check to the trader to only look at player owned stations when setting up a trade route, why I suggested the "player station" checkbox so you have a galaxy trader for distributing your own wares :)

But that is something for ludsoe as this xml editing makes me scream in horror :lol:
reqw
Posts: 101
Joined: Sat, 13. Jan 07, 15:23
x4

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

Post by reqw »

Might have found an issue with this trader.

When you do not have credits it can withdraw credits anyway and you will end up with a negativ balance.
XTC0R
Posts: 401
Joined: Sat, 1. Dec 18, 19:58
x4

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

Post by XTC0R »

So using this Mod and 1.50 Beta 3 I finally managed to slowly get the production of the wharfes running again. I'm still confused about the information provided by the wharfes. Because in the ship production queue the ships are green but still missing resources. So yellow color + info what is missing is the way it should be.

But back to the mod. It works great. So thank you very much. I have the following proposals if you want to improve it further:

- check box which factions should be delivered (I really like the idea to influence the war economy between different factions)
- preset of trading goods. e.g. preset for wares which are needed to build ships
- select all wares check box / buttons / option ...
- Option to update current order. Currently if you want to add a ware you have to completely re-do the complete order.

Thanks again for you excellent mod.
Grabowski
Posts: 5
Joined: Mon, 17. Dec 18, 10:12

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

Post by Grabowski »

reqw wrote: Wed, 19. Dec 18, 10:33 Might have found an issue with this trader.

When you do not have credits it can withdraw credits anyway and you will end up with a negativ balance.
hmm, the other autotrader did this to me too.
reqw
Posts: 101
Joined: Sat, 13. Jan 07, 15:23
x4

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

Post by reqw »

i havent encouterd this except with this trader but i can be wrong
Varien101
Posts: 63
Joined: Fri, 7. Dec 18, 02:08

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

Post by Varien101 »

I haven't had that issue, but I always have spare change.

Now the mod DOES trade with undiscovered stations and some can see this as cheaty.

I see it as saving me to explore the entire galaxy for an 8th or 9th time lol. It also means I don't have 600 sats in my game. And I can take off the satellite mods, less is more in this case.
ludsoe
Posts: 21
Joined: Fri, 13. Nov 09, 03:12
x4

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

Post by ludsoe »

Hey guys, Just Just posted V2 on nexus-mods. (Hopefully the script didn't break in-between me testing it and uploading it.)

Its got some neat improvements and bug fixes, you guys might like.
  • I Fixed the issues with The traders taking money you didn't have out of your account, It was cute but very exploitable.
  • The Traders now properly filter out deals the player doesn't know about. (Sorry if that was a 'feature' you liked.)
  • Fixed a problem with the trader always perceiving deals done at player stations as 0, The sliders now change the price properly. Unfortunately its now scaled off the average price for the ware. (May Tweak this more in the future.)
  • The Traders now follow trade restrictions, when searching for deals. I added a FreeTrade option you can toggle to disable this behavior.
  • The Traders now have log reports when they setup their trade deals, telling you how much profit they expect to earn in an run.
I couldn't implement a profit over time tracker, so here's the best I could do in the meantime.
Image

Disclaimer: This update wont magically fix any traders locked up by poor move commands, as the order doesn't run while another is in queue. Sorry about that, just cancel it and the trader should start up again.
Also I haven't properly fixed the home sector move order, I haven't a clue how to properly set that up so if anybody has some know-how or a fix Id very much appreciate it.

Varien101 Quote
Show
Varien101 wrote: Wed, 19. Dec 18, 20:34 I haven't had that issue, but I always have spare change.

Now the mod DOES trade with undiscovered stations and some can see this as cheaty.

I see it as saving me to explore the entire galaxy for an 8th or 9th time lol. It also means I don't have 600 sats in my game. And I can take off the satellite mods, less is more in this case.
That is unfortunately not the goal of this mod, that was actually the side effect of a bug I just fixed in the latest version. You can re-enable this functionality by editing the xml code yourself though.
Just by deleting all instances of the following code.

Code: Select all

<match tradesknownto="this.owner"/>
Grabowski Quote
Show
Grabowski wrote: Wed, 19. Dec 18, 12:59
reqw wrote: Wed, 19. Dec 18, 10:33 Might have found an issue with this trader.

When you do not have credits it can withdraw credits anyway and you will end up with a negativ balance.
hmm, the other autotrader did this to me too.
This was the result of the script not checking if you still had the money for a trade when it got around to actually arranging and paying for it, It should be hopefully solved.
XTC0R Quote
Show
XTC0R wrote: Wed, 19. Dec 18, 10:51 So using this Mod and 1.50 Beta 3 I finally managed to slowly get the production of the wharfes running again. I'm still confused about the information provided by the wharfes. Because in the ship production queue the ships are green but still missing resources. So yellow color + info what is missing is the way it should be.

But back to the mod. It works great. So thank you very much. I have the following proposals if you want to improve it further:

- check box which factions should be delivered (I really like the idea to influence the war economy between different factions)
- preset of trading goods. e.g. preset for wares which are needed to build ships
- select all wares check box / buttons / option ...
- Option to update current order. Currently if you want to add a ware you have to completely re-do the complete order.

Thanks again for you excellent mod.
I believe you can add new wares to the order while its running, it just doesn't search for them until the next time the order runs. You can force it to restart by jiggling the search range modifiers.

As for the rest of your suggestions,
Ill look into a way to let you set which factions the trader trades with. But I cant make any promises.
And Preconfigured ware lists are on my to-do list, as soon as I figure out how to cleanly set them up Ill set some up.
Varien101
Posts: 63
Joined: Fri, 7. Dec 18, 02:08

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

Post by Varien101 »

Your awesome! Downloading and deleting code!!!!!!



"The Traders now follow trade restrictions, when searching for deals. I added a FreeTrade option you can toggle to disable this behavior."

I'm not sure what this is though. The only trade restriction I know of is the one's you set on your stations.
Spacecop42
Posts: 26
Joined: Fri, 14. Dec 18, 18:45
x4

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

Post by Spacecop42 »

Hey man. Best mod for this game hand down.

One thing I don't understand though, the Own Station Price modifiers

How do they work exactly?

If I want a trader to buy my wares and sell them to the universe each time how do I set the sliders? Do I set them to 0 or 200?
siath70
Posts: 459
Joined: Sun, 11. Jan 04, 03:03
x4

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

Post by siath70 »

Spacecop42 wrote: Thu, 20. Dec 18, 04:17 Hey man. Best mod for this game hand down.

One thing I don't understand though, the Own Station Price modifiers

How do they work exactly?

If I want a trader to buy my wares and sell them to the universe each time how do I set the sliders? Do I set them to 0 or 200?
It's how it sounds:
Buy is how the traders think of the price from your station when buying from it and sell is how they see selling to your station.
So buy set at 50 is like 50% discount in the traders eyes (if it sells for 20 the trader sees it selling at 10)
Sell at 150 is like 150% sell increase (if it sells for 20 the trader will see it selling for 30).
That's the basics as I understood it...
Kamuchi_
Posts: 174
Joined: Fri, 7. Dec 18, 05:04
x4

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

Post by Kamuchi_ »

Thanks for the update! :D

Setting system as homebound works great now, ship flies back to the actual spot where you first initiated the trade command, it still gives the big questionmark but when it parks the autotrade command kicks in.
Having it's home as the station and making it a subordinate had me scratching my had for a few seconds, but resetting them all to system home fixed that.
The new player owned station pricing is great, already set up a galaxy trader to avoid buying and selling to my own stations, but when starting to seperate production over multiple stations this will be great as an "external" station trader moving wares between owned stations when setting both buy and sell prices to 0, please keep it like this :mrgreen:

Right, made a mistake, the sell to own stations should be 0 so it will never sell it there without a profit lol
Spoiler
Show
Image
siath70 wrote: Thu, 20. Dec 18, 06:32
Spacecop42 wrote: Thu, 20. Dec 18, 04:17 Hey man. Best mod for this game hand down.

One thing I don't understand though, the Own Station Price modifiers

How do they work exactly?

If I want a trader to buy my wares and sell them to the universe each time how do I set the sliders? Do I set them to 0 or 200?
It's how it sounds:
Buy is how the traders think of the price from your station when buying from it and sell is how they see selling to your station.
So buy set at 50 is like 50% discount in the traders eyes (if it sells for 20 the trader sees it selling at 10)
Sell at 150 is like 150% sell increase (if it sells for 20 the trader will see it selling for 30).
That's the basics as I understood it...
Correct.
You can limit to trade with npc exclusively, "external" gaaxy trader buying from your own stations for 0 and set homebound to your home system to force it even more to buy locally and sell to npc with 200% markup on own station sell or set buy/sell on own station to 0 to make it prefer doing player owned station trades as a galaxy trader.
Another option is to have it as a galaxy station supplying with buy from own stations at 200 and sell to own stations at 0, ofcourse that will use the player money, but if you sell stuff you get the profit from that same station later on, no more stupid station manager need besides it controlling the miners :)
You can do some interesting things with this new update :P
Last edited by Kamuchi_ on Thu, 20. Dec 18, 11:38, edited 2 times in total.
Kalantris
Posts: 137
Joined: Mon, 10. Dec 18, 10:56

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

Post by Kalantris »

This is probably the most useful mod up to date with FOCW.

I would however recommend a slight upgrade. Since you already implemented a functionality forcing the traders to buy at player stations, you could also add one forcing them to sell them at player stations as well. This would allow us to create production chains to optimize goods transportation (like creating one ice refinery in an ice-rich region and then distributing water by traders to all stations for food production). Could you? :)
reqw
Posts: 101
Joined: Sat, 13. Jan 07, 15:23
x4

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

Post by reqw »

So if i whant my traders to buy from my stations and sell to the NPC stations i set

Owned Station Buy Mod at 200
Owned Station Sell Mod to 0

OR
Kamuchi_
Posts: 174
Joined: Fri, 7. Dec 18, 05:04
x4

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

Post by Kamuchi_ »

reqw wrote: Thu, 20. Dec 18, 11:20 So if i whant my traders to buy from my stations and sell to the NPC stations i set

Owned Station Buy Mod at 200
Owned Station Sell Mod to 0

OR
Set them up like this:
Spoiler
Show
Image
Fly the trader and park it near your station.
Set "homeBound": this will make the trader fly to this spot after each trade to make sure it buys from local.
Set max buy distane to 0: to force to buy in local.
Set own station buy at 0: just be carefull as it will get the wares free and if your station needs money to operate you could set it to like 50-75 to still make it preferd over npc stations if they are present.
FreeTrade: in case you have set the station to restrict other factions, no idea if this only is required as a station trader but I set it anyway.

That should do it :)
argon_emperor
Posts: 1225
Joined: Mon, 12. Dec 05, 07:41
x4

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

Post by argon_emperor »

Kalantris wrote: Thu, 20. Dec 18, 10:56 This is probably the most useful mod up to date with FOCW.

I would however recommend a slight upgrade. Since you already implemented a functionality forcing the traders to buy at player stations, you could also add one forcing them to sell them at player stations as well. This would allow us to create production chains to optimize goods transportation (like creating one ice refinery in an ice-rich region and then distributing water by traders to all stations for food production). Could you? :)
I would assume if you set both of the owned station parameters to 200, then your stations for both buying and selling would always get first priority. So set one trader up specifically for the good you want to transfer, set both settings to 200, and away it goes :)
[ 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
Kamuchi_
Posts: 174
Joined: Fri, 7. Dec 18, 05:04
x4

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

Post by Kamuchi_ »

argon_emperor wrote: Thu, 20. Dec 18, 11:32
Kalantris wrote: Thu, 20. Dec 18, 10:56 This is probably the most useful mod up to date with FOCW.

I would however recommend a slight upgrade. Since you already implemented a functionality forcing the traders to buy at player stations, you could also add one forcing them to sell them at player stations as well. This would allow us to create production chains to optimize goods transportation (like creating one ice refinery in an ice-rich region and then distributing water by traders to all stations for food production). Could you? :)
I would assume if you set both of the owned station parameters to 200, then your stations for both buying and selling would always get first priority. So set one trader up specifically for the good you want to transfer, set both settings to 200, and away it goes :)
I actually caught my mistake lol
Setting buying to 200 will make it not want to buy it from my station as the buy price is twice then normal.
Setting sell price to 0 will make the profit go negative so it never sells there.

I derped, updated the pic lol
argon_emperor
Posts: 1225
Joined: Mon, 12. Dec 05, 07:41
x4

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

Post by argon_emperor »

Are these traders regularly meant to take breaks? I had two going (one Mercury, one Helios), on all legal wares, and they at first did nothing for quite a while... Then they did a few runs each, now they're back to doing nothing again. I tried changing the Mercury to just handle E Cells (want to eventually get a few going for each product group), but still doing nothing :/
[ 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”