[MOD] AutoTrader with Options ver. 0.8 Jan. 20, 2023

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

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

Post Reply
Kadatherion
Posts: 1021
Joined: Fri, 25. Nov 05, 16:05
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by Kadatherion » Sun, 16. Dec 18, 05:16

Osbot wrote:
Sun, 16. Dec 18, 03:40
Is this mod supposed to create wares out of thin air?

Been watching my traders. They fly up to a station, fill their cargo hold with say engine parts, but don't actually draw engine parts out of the factory. Is this intended behavior? Or am I missing something?
Yep, this is what happened to me too. Trader took a couple hundred medical supplies (I didn't check the source station cargo hold before/after though), went to delivery station. Delivery station only had a buy offer for 95 medical supplies. I was already disappointed, "Ah, too bad, even with this mod traders do these derps", but nope, trader magically sells all of his medical supplies, the target station is filled, and I magically make more than ONE MILLION credits. One million, out of a handful of supplies. Completely, totally out of the actual game supply/demand and ware values.

Uninstalled immediatly after. Nothing wrong with that, mind me, to each his own, but this is just not for me, I don't want auto traders for money - not right now at least - I want them to help the otherwise broken economy by moving goods.

Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by Requiemfang » Sun, 16. Dec 18, 06:19

Kadatherion wrote:
Sun, 16. Dec 18, 05:16
Osbot wrote:
Sun, 16. Dec 18, 03:40
Is this mod supposed to create wares out of thin air?

Been watching my traders. They fly up to a station, fill their cargo hold with say engine parts, but don't actually draw engine parts out of the factory. Is this intended behavior? Or am I missing something?
Yep, this is what happened to me too. Trader took a couple hundred medical supplies (I didn't check the source station cargo hold before/after though), went to delivery station. Delivery station only had a buy offer for 95 medical supplies. I was already disappointed, "Ah, too bad, even with this mod traders do these derps", but nope, trader magically sells all of his medical supplies, the target station is filled, and I magically make more than ONE MILLION credits. One million, out of a handful of supplies. Completely, totally out of the actual game supply/demand and ware values.

Uninstalled immediatly after. Nothing wrong with that, mind me, to each his own, but this is just not for me, I don't want auto traders for money - not right now at least - I want them to help the otherwise broken economy by moving goods.
Gotta agree with this assessment, cheating the system in no way fixes the economy, that's like putting a band-aid over a gash and expecting it to stem the bleeding when the band-aid isn't even large enough to cover the gash at all.

o-papaya-o
Posts: 42
Joined: Sun, 29. Mar 09, 11:53
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by o-papaya-o » Sun, 16. Dec 18, 11:30

TaL_81 wrote:
Sun, 16. Dec 18, 02:06
First: Thanks for the great mod, I really enjoy it. :)

But I noticed something strange:
After 2-3 trades my trader (3 currently) keep moving in the highway and couldn't get out, so I have to restart them (quit auto-Trader, move to a neutral position, start again).
They then will trade as intended till they trapped in the highway again. Someone else got these issue?

Mod-settings are jump = false, prefer player stations = true, know all trades = false, trade all wares = false.

It's the same for me, after a while, they cling to highways.

Could you create T files to facilitate translations ...
C’est en voyant un moustique se poser sur ses coui**** que l’on s’aperçoit qu’on ne peut pas régler tous les problèmes par la violence.

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by euclid » Sun, 16. Dec 18, 14:40

Osbot wrote:
Sun, 16. Dec 18, 03:40
Is this mod supposed to create wares out of thin air?

Been watching my traders. They fly up to a station, fill their cargo hold with say engine parts, but don't actually draw engine parts out of the factory. Is this intended behavior? Or am I missing something?
Hi Osbot :-)

They do not dock to avoid problems when many NPC trader queue up waiting for free docking slots. But they should transfer wares. Have you checked the station's storage for engine parts? The script should add them to the station and remove it from the ship:

Code: Select all

 <add_cargo object="$Buyer" ware="$Ware" exact="$TrueAmount"/>
 <remove_cargo object="this.ship" ware="$Ware" exact="$TrueAmount"/>
Similar when wares are bought by the autotrader:

Code: Select all

 <add_cargo object="this.ship" ware="$Ware" exact="$TrueAmount"/>
 <remove_cargo object="$Seller" ware="$Ware" exact="$TrueAmount"/>
So I'm not sure why in your version (and apparently a few other players here) that does not work.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

TaL_81
Posts: 3
Joined: Sun, 16. Dec 18, 01:58
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by TaL_81 » Sun, 16. Dec 18, 15:51

I can confirm, that the trader moves the cargo from station to ship and backwards, so this isn't a problem for me (perhaps an other mod?)

But what I saw was, that the storage of the destination station was already full and the trader sell the items anyway.
Storage
before sell: 1338/1338
after sell: 1877/1877

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by euclid » Sun, 16. Dec 18, 16:53

siath70 wrote:
Sat, 15. Dec 18, 20:41
................
Any chance you could make it so traders look at player owned properties for what is needed for building, hull parts, energy cells, claytronics… Then if a player station being built needs those ware look for a player station that makes those parts or has extra sitting in the build storage and move them to the station that needs them?
................
Hi siath70 :-)

If you start the station buildig process (i.e. have a builder ship assigned and credits added for the contruction resources) then there should be trade offers issued from you build storage. These will show on the map (provided you set the filers accordingly) with a symbol preceeding the buy offer. Autotraders will take into account those trade offers and, if you have set "Prefer Player Stations" to 1 (true), they will serve those with priority.
siath70 wrote:
Sat, 15. Dec 18, 20:41
Edit: Also is there a way to blacklist races, like SCA so a trader will not consider trading to them, or a way to just make them not trade with someone under say +5 rep (maybe settable in settings).
Autortraders/miners will not trade with any station that is enemy to the player. It is possible to add another setting for a minimum reputation. I'll consider that ;-)
Matalus wrote:
Sat, 15. Dec 18, 22:58
Should we see orders in their queue, I installed the new version .3 running on 1.5 beta

I cleared all orders and set a mercury vanguard to hold position, then commed them and turned on autotrader after turning off jumps and all trades known.

After a few min the ship started moving, but I don't see any order or buy orders happening.
Hi Matalus :-)

Short answer: No.

Tad longer answer: It is not possible to add any such orders via XML script because a commands added to the autotrade calles a corresponding vanilla script and interfers with the autotrader script. It is possible to add that via the UI but I will not touch UI modding ever again. :p

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

TR0LL
Posts: 45
Joined: Tue, 6. Jan 04, 04:12
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by TR0LL » Sun, 16. Dec 18, 19:08

Would you please consider making a version without the convenience functions? No knowledge that the player doesn't know (trade deals and anomalies) and no jump drive, I know I can disable these things, but they are on be default and I make a list of suggested mods for others to use with what I feel are good, balanced additions to the game, to increase difficulty and immersion.

User avatar
FalconGrey
Posts: 440
Joined: Thu, 22. Apr 04, 01:53
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by FalconGrey » Sun, 16. Dec 18, 20:55

TR0LL wrote:
Sun, 16. Dec 18, 19:08
Would you please consider making a version without the convenience functions? No knowledge that the player doesn't know (trade deals and anomalies) and no jump drive, I know I can disable these things, but they are on be default and I make a list of suggested mods for others to use with what I feel are good, balanced additions to the game, to increase difficulty and immersion.
Or at least, have them 'off' by default...

When I did the comm, 'autotrader setup', 'Jump' ; is there supposed to be more to that to let you know that it is sat to 'true' or 'false'? It's hard to know if you sat it on or off... Unless I'm missing something or the script isn't running right on my system.

Also, Still on the gas and mineral miner... if I try to turn on Autotrader, they immediately jump to where they were stuck before and just sit there in the same map spot. Once I turn off the Autotrader script they immediatly go work as normal so not sure if those 2 are bugged (I don't have other miner ships yet to test) or if I ran into a bug. And yes, sat them to 'hold position' as you stated in previous post and then sat the 'autotrader'. After a few moments they jumped and sat there in the place they were stuck at, not in a mining place, just empty space doing nothing but saying they are mining. Holds are empty and not collecting anything. Once I build up enough for either the larger mining mineral or gas ship I could test with that and a new pilot to see if it is just those 2 bugged if you like and get back to you on this.
It's not if we win or lose that matters, it's that we stood and faced it.

ranykt
Posts: 9
Joined: Mon, 27. Apr 15, 21:28
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by ranykt » Sun, 16. Dec 18, 21:17

BUG!

Can't start autominer unless i follow these steps:
1. Comm in and tell them they can't "Know all Trade"
2. Wait 5+ seconds in the map
3. Comm in and tell them to AutoTrade

And that's if it works at first. If it doesn't, then I have to add more 5 second waits:
1. Comm in and tell them to stop AutoTrade
2. Wait 5+ seconds in the map
3. Comm in and tell them that they can "Know all Trade"
4. Wait 5+ seconds in the map
5. Comm in and tell them they can't "Know all Trade"
6. Wait 5+ seconds in the map
7. Comm in and tell them to AutoTrade

And that's if I'm lucky, because one took me 3 attempts to launch.

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7406
Joined: Mon, 15. Dec 03, 18:53
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by BlackRain » Sun, 16. Dec 18, 21:19

FalconGrey wrote:
Sun, 16. Dec 18, 20:55
TR0LL wrote:
Sun, 16. Dec 18, 19:08
Would you please consider making a version without the convenience functions? No knowledge that the player doesn't know (trade deals and anomalies) and no jump drive, I know I can disable these things, but they are on be default and I make a list of suggested mods for others to use with what I feel are good, balanced additions to the game, to increase difficulty and immersion.
Or at least, have them 'off' by default...

When I did the comm, 'autotrader setup', 'Jump' ; is there supposed to be more to that to let you know that it is sat to 'true' or 'false'? It's hard to know if you sat it on or off... Unless I'm missing something or the script isn't running right on my system.

Also, Still on the gas and mineral miner... if I try to turn on Autotrader, they immediately jump to where they were stuck before and just sit there in the same map spot. Once I turn off the Autotrader script they immediatly go work as normal so not sure if those 2 are bugged (I don't have other miner ships yet to test) or if I ran into a bug. And yes, sat them to 'hold position' as you stated in previous post and then sat the 'autotrader'. After a few moments they jumped and sat there in the place they were stuck at, not in a mining place, just empty space doing nothing but saying they are mining. Holds are empty and not collecting anything. Once I build up enough for either the larger mining mineral or gas ship I could test with that and a new pilot to see if it is just those 2 bugged if you like and get back to you on this.
It will send a message to your log to tell you if it is off or on when you do the command. 0 for off, 1 for on

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

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by NightlinerSGS » Sun, 16. Dec 18, 21:29

euclid wrote:
Sun, 16. Dec 18, 14:40

They do not dock to avoid problems when many NPC trader queue up waiting for free docking slots.
Could you add docking as an option as well? Waiting for a free dock beats just sitting over the station and teleporting wares in my opinion. It could also mean that M traders stay docked (or get stowed) until they find a new trade, which would be a bonus.

I also saw some irregularities with the trades. My L trader didn't make anything for a while, then transferred over 7m at once (!), then made several trades with 100-200k profits and a few with 100k losses.

I also saw an M trader getting stuck on the ring... but without the trade being visible in the order window, it's impossible to see where he's supposed to go or what his actual order is. :(

o-papaya-o
Posts: 42
Joined: Sun, 29. Mar 09, 11:53
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by o-papaya-o » Sun, 16. Dec 18, 23:31

Good evening Euclide,
we proposed to translate this mod in French (guild Xchange) if you could create a file T to translate it more easily.
I would also like to know how to translate the text contained in the logbook, because if I translate this sentence (parameters: jump =% 6, prefer the stations of player =% 7, to know all the exchanges =% 8, to exchange all the merchandise =% 9 \ n Total profit I made for you, Sir :), it appears in the form "null".
it could also be written Enable or disable instead of "1" or "0"
cordially
C’est en voyant un moustique se poser sur ses coui**** que l’on s’aperçoit qu’on ne peut pas régler tous les problèmes par la violence.

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by euclid » Mon, 17. Dec 18, 00:01

ranykt wrote:
Sun, 16. Dec 18, 21:17
BUG!

Can't start autominer unless i follow these steps:
1. Comm in and tell them they can't "Know all Trade"
2. Wait 5+ seconds in the map
3. Comm in and tell them to AutoTrade

And that's if it works at first. If it doesn't, then I have to add more 5 second waits:
1. Comm in and tell them to stop AutoTrade
2. Wait 5+ seconds in the map
3. Comm in and tell them that they can "Know all Trade"
4. Wait 5+ seconds in the map
5. Comm in and tell them they can't "Know all Trade"
6. Wait 5+ seconds in the map
7. Comm in and tell them to AutoTrade

And that's if I'm lucky, because one took me 3 attempts to launch.
Hi ranykt :-)

Except your even step numbers this is exactly how you start the AutoTrader and set the options (see OP). So I do not understand A) why you think you need to wait at least 5 seconds and B) why you think it takes "3 attempts to launch" ? How do you know "if it works"?

And this is for everyone: Please, don't get me wrong. I do appreciate bug reports/feedback but it will be very difficult for me to find the bug or change anything if the information provided is rather vague.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

desius
Posts: 281
Joined: Mon, 21. Jun 04, 18:06
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by desius » Mon, 17. Dec 18, 00:04

TaL_81 wrote:
Sun, 16. Dec 18, 02:06
First: Thanks for the great mod, I really enjoy it. :)

But I noticed something strange:
After 2-3 trades my trader (3 currently) keep moving in the highway and couldn't get out, so I have to restart them (quit auto-Trader, move to a neutral position, start again).
They then will trade as intended till they trapped in the highway again. Someone else got these issue?

Mod-settings are jump = false, prefer player stations = true, know all trades = false, trade all wares = false.
I'm seeing the same behavior here. I have 3 Gas Autominers , 1 Mineral Autominer, and 4 Autotraders (3 of which are little couriers)
All of them are now stuck in the large highway loop, going around and around, never leaving.

They are set to:
Jumps: No
Prefer Player: Yes
Know Galaxy: No
Illegal Wares: No

I don't know if this is is because of the 1.5(beta) bugginess or something else.

TR0LL
Posts: 45
Joined: Tue, 6. Jan 04, 04:12
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by TR0LL » Mon, 17. Dec 18, 00:13

What values in the scripts do I need to change to make Jumps and Know galaxy set to off by default?

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by euclid » Mon, 17. Dec 18, 00:17

NightlinerSGS wrote:
Sun, 16. Dec 18, 21:29
...............
I also saw some irregularities with the trades. My L trader didn't make anything for a while, then transferred over 7m at once (!), then made several trades with 100-200k profits and a few with 100k losses.

I also saw an M trader getting stuck on the ring... but without the trade being visible in the order window, it's impossible to see where he's supposed to go or what his actual order is. :(
Hi NightlinerSGS :-)

Are you running the latest version 0.3? I'm asking because there was a bug that could cause a temporary profit loss if you have many autotrader running. But this has been fixed in 0.3. It may also be a conflict with some other mod. And concerning ".....didn't make anything for a while....." this can have many reasons. There is a wait time (cooldown) between consecutive trades which decreases with increasing average skill of the autotrader's crew. And then there simply may be no trade available which causes another wait. This may happen rather frequently if you have set "Known" to false.

The "stuck on the ring" thing sounds interesting. Could you please provide more info?

And finally, you cannot "see" what he is doing but he will send regular reports to your player log. As long as there is a star "*" behind the captain's name the autotrader is active even if you do not see any command, no order or for many minutes no activity.

Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786

ranykt
Posts: 9
Joined: Mon, 27. Apr 15, 21:28
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by ranykt » Mon, 17. Dec 18, 00:42

ranykt wrote:
Sun, 16. Dec 18, 21:17
BUG!

Can't start autominer unless i follow these steps:
1. Comm in and tell them they can't "Know all Trade"
2. Wait 5+ seconds in the map
3. Comm in and tell them to AutoTrade

And that's if it works at first. If it doesn't, then I have to add more 5 second waits:
1. Comm in and tell them to stop AutoTrade
2. Wait 5+ seconds in the map
3. Comm in and tell them that they can "Know all Trade"
4. Wait 5+ seconds in the map
5. Comm in and tell them they can't "Know all Trade"
6. Wait 5+ seconds in the map
7. Comm in and tell them to AutoTrade

And that's if I'm lucky, because one took me 3 attempts to launch.
So in review, this only seems to work with a few miners. i was trying to set up 10 L and 20 M and it functioned like absolute crap, not to mention that after 25 it didn't work at all. I couldn't start the 26th after 20 minutes of trying the above. I sold everything and started anew after reinstalling the mod. There are still some issues with 2xG/S miners, but it's significantly faster that default.

With 25 miners, it scaled up gathering as their storage was filled. I.e., an empty vessel would gather 1-1-2-2-3-3-4-4-5-5-6-6, etc, every 10 ingame minutes. Once it was in the thousands, it would gather hundreds. But each of these are 10 ingame minutes, so it would take forever to fill.

I'm also noticing that everything seems to be based on 10 minute timers. Gathering and unload are both based on 10 minute timers. My miners will sit outside my PHQ for 10 minutes before returning to mining, and they don't always drop everything. Seems like there's a threshold, among other things. I've seen them return at 100% capacity, 50% capacity, and 40% capacity. I'm currently back up to 4 L miners for my PHQ. Is there a way to scale this timeframe down? If it transfers all/most of their inventory, why do they need to sit for so long?
Last edited by ranykt on Mon, 17. Dec 18, 00:50, edited 1 time in total.

ranykt
Posts: 9
Joined: Mon, 27. Apr 15, 21:28
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by ranykt » Mon, 17. Dec 18, 00:45

euclid wrote:
Mon, 17. Dec 18, 00:01
ranykt wrote:
Sun, 16. Dec 18, 21:17
BUG!

Can't start autominer unless i follow these steps:
1. Comm in and tell them they can't "Know all Trade"
2. Wait 5+ seconds in the map
3. Comm in and tell them to AutoTrade

And that's if it works at first. If it doesn't, then I have to add more 5 second waits:
1. Comm in and tell them to stop AutoTrade
2. Wait 5+ seconds in the map
3. Comm in and tell them that they can "Know all Trade"
4. Wait 5+ seconds in the map
5. Comm in and tell them they can't "Know all Trade"
6. Wait 5+ seconds in the map
7. Comm in and tell them to AutoTrade

And that's if I'm lucky, because one took me 3 attempts to launch.
Hi ranykt :-)

Except your even step numbers this is exactly how you start the AutoTrader and set the options (see OP). So I do not understand A) why you think you need to wait at least 5 seconds and B) why you think it takes "3 attempts to launch" ? How do you know "if it works"?

And this is for everyone: Please, don't get me wrong. I do appreciate bug reports/feedback but it will be very difficult for me to find the bug or change anything if the information provided is rather vague.

Cheers Euclid
You say that, but if i tried to do this faster, they would never launch. I'd sit there for 10 IRL minutes and none of them would never move. These steps are what it took to even get them started. My above post explains what I've experienced.

TearsInRain
Posts: 73
Joined: Fri, 30. Nov 18, 00:32
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by TearsInRain » Mon, 17. Dec 18, 02:02

just an idea here mate .... instead of the wait times built into the script to make the expert pilots better, why not try something like this

1 star pilots, ignore the top five trades that would be possible when it calculates what it should do..
2 star pilots, ignore the top four trades etc
5 star pilots, do the best trade it can do..

That stops the need for it to sit around and wait.. kicks the economy along a little, and still gives you some benefit for levelling up.

desius
Posts: 281
Joined: Mon, 21. Jun 04, 18:06
x4

Re: [MOD] AutoTrader with Options ver. 0.3 Dec 15, 2018

Post by desius » Mon, 17. Dec 18, 03:46

euclid wrote:
Mon, 17. Dec 18, 00:17
The "stuck on the ring" thing sounds interesting. Could you please provide more info?
I'd love to give more details but I don't have a debug client with the ability to look at running scripts like I used to have when I beta'd X:R. This time around I'm 'just a player'. :mrgreen:
I can say that I have a friend in the exact same boat. 1.5beta + 0.3 of this script and eventually every auto(miner/trader) gets stuck circling around the superhighway/gate loop.

I can send a savefile if you want to PM me a location to mail it.

Post Reply

Return to “X4: Foundations - Scripts and Modding”