[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
Misunderstood Wookie
Posts: 377
Joined: Mon, 15. Mar 04, 08:07
x4

Re: [MOD] AutoTrader ver. 0.2 Dec 13, 2018

Post by Misunderstood Wookie » Thu, 13. Dec 18, 13:34

Depleted wrote:
Thu, 13. Dec 18, 09:20
I don't know if this mod works correctly for me, i have the option for autotrade in the comm menu but there is no * behind their names once activated, and a few of the ships assigned to autotrade spend a lot of time going into hostile territory then derping out when engaged by xenon or khaak fighters, I've lost four large freighters as the ai decided a xenon defensive platform had the best wares or something.
Also i'm noticing that the profits due on the info panel does not reflect what is actually due, a freighter will spend up to 150m on a load and as they sell off bits n bobs i'll see large chunks of profit but it's not displayed at the top left.

Great mod none the less.
Check the extension is enabled in the game menu, auto trade is a thing in X4 this just replaces that feature with an arguably more superior function.
If the extension does not exist and enabled, Try making an extension folder inside the EgoSoft X4 Documents folder and placing the mod in that.
*modified*
*X3 LiteCube User*
MOD GemFX Real Space Shaders
MOD Variety and Rebalance Overhaul Icon Pack
I lost my Hans and should not be flying Solo.
Image

Senubius
Posts: 1
Joined: Mon, 10. Dec 18, 19:32

Re: [MOD] AutoTrader ver. 0.2 Dec 13, 2018

Post by Senubius » Thu, 13. Dec 18, 13:42

I have found one problem.
When you sell a trader ship and don't stop the auto trade before, the ship will trade again and again and again, in the log there are the trades, the ships I didnt find but I think the auto trader is anywhere :gruebel:

Osbot
Posts: 108
Joined: Sun, 10. Jan 10, 19:49
x4

Re: [MOD] AutoTrader ver. 0.2 Dec 13, 2018

Post by Osbot » Thu, 13. Dec 18, 17:03

Hey guys. If you want a cheat mod, do yourselves a favor.

Go to game settings. Uncompress save. Open save with notepad++

On line 6 look at money="bunchofnumbers" I recommend you select 13,000,000,000. There. You've accomplished exactly what this teleporting instant trader does, and you've saved yourself the powerbill of running the game for 3 hours to do it for you!

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

Re: [MOD] AutoTrader ver. 0.2 Dec 13, 2018

Post by euclid » Thu, 13. Dec 18, 17:09

Raith_Sienar wrote:
Wed, 12. Dec 18, 22:43
.....
So there is a time delay of 10 minutes (or even more since his waiting was cut short), aka long enough for a pirate Behemoth to get in close and annihilate my trader in a single volley because it's just sitting there over a SCP Space Weed Farm not doing anything?
I don't think the time delay should be that long, that's a bit excessive.
Hi Raith_Sienar :-)
It's a trade-off: If you reduce the wait times then they do trades even faster. Also an attack can and will happen even for a vanilla trader on their long journey (as they do not jump). The waiting position for the AutoTraders is close to the station they trade with. That should provide a certain protection as "normal" (not pirates) stations will take actions when enemies show up. If you are not happy with the wait times then feel free to adjust the code to your liking. However, I will look into this and may add an interrupt for an emergency jump to a future version.

sdfgwrtetyryr wrote:
Wed, 12. Dec 18, 23:20
Hello, Euclid. Just wanted to let you know, that the mod is running fine, but it seems to me that it's not suited for a huge number of auto-traders. ....
Hi sdfgwrtetyryr :-)
Yes, you are absolute right. It is not meant to be for a huge fleet of traders and, actually, you do not need it. I just have 2 or tops 3 autotraders (Pelicans) and maybe 2 or 3 miners for minerals and gas/liquid each (Cranes). Please note that all these autotraders work the entire galaxy in contrast to the XR AutoTrader mod where you could choose the range from sector via cluster to galaxy.

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

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

Re: [MOD] AutoTrader ver. 0.2 Dec 13, 2018

Post by FalconGrey » Fri, 14. Dec 18, 21:51

Love this mod and the AutoTrader on my little Mercury is doing awesome! Where I'm not sure I'm understanding I sat this up right is the 'AutoMiner' part that you described.
AutoMiner: If the ship has gas or liquid storage then the captain becomes an Autominer.
AutoTrader: If the ship has container storage then the captain becomes an Autotrader.
As stated above, placed on my Mercury which was attached to my Power Station in Argon Prime. It seemed to ask me to set up what wares it wanted me to have it 'shop for' so I selected them and then let it go on its own. It seems to be doing awesome and making a fair profit for its small size.

Made the 'call' to my gas and mineral miners to start the AutoTrader Script. The ' * ' appeared after the names just as the Mercury did. Only they didn't do anything but showed 'Hold Position'. I selected 'AutoMine' manually and selected Silicon for the mineral and then Hydrogen for the gas. Both seemed to run good for a short time but now they just are sitting and doing nothing.

I have tried telling them to manually dock but that goes ignored. I've dried calling and deactivating 'AutoTrader' but again ignored. Teleported to the offending miners and manually docked them back to my HQ. Restarted the AutoTrader and they returned to where they were stuck (Same exact spots in space). Any suggestion? :gruebel:

Also, was that how the miners are supposed to be sat up?
It's not if we win or lose that matters, it's that we stood and faced it.

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

Re: [MOD] AutoTrader ver. 0.2 Dec 13, 2018

Post by euclid » Sat, 15. Dec 18, 11:58

FalconGrey wrote:
Fri, 14. Dec 18, 21:51
...................
Made the 'call' to my gas and mineral miners to start the AutoTrader Script. The ' * ' appeared after the names just as the Mercury did. Only they didn't do anything but showed 'Hold Position'. I selected 'AutoMine' manually and selected Silicon for the mineral and then Hydrogen for the gas. Both seemed to run good for a short time but now they just are sitting and doing nothing.

I have tried telling them to manually dock but that goes ignored. I've dried calling and deactivating 'AutoTrader' but again ignored. Teleported to the offending miners and manually docked them back to my HQ. Restarted the AutoTrader and they returned to where they were stuck (Same exact spots in space). Any suggestion? :gruebel:

Also, was that how the miners are supposed to be sat up?
Hi FalconGrey :-)

It takes a while, depending on the average skill of the captain and the crew, until the miner or trader starts to move. There is not need to add any wares or issue any commands. In fact, there have been reports here that any additional command can cause problems.

Ideally the ship should be in space without any command (default: wait, hold position). Only then comm the captain and start the AutoTrader. Everything else is fully automatic, a miner will mine and a trader will trade. After you have done that just "forget" the ship. You can add it as subordinate to a station but it won't make a difference. The manager's orders will be ignored. The only way to interrupt the AutoTrader script is if you remove the captain or comm and then stop the autotrade (that's the clean way).

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

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

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

Post by euclid » Sat, 15. Dec 18, 19:13

New version uploaded with setup options meeting almost all requests made (see OP for details).

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

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

Re: [MOD] AutoTrader ver. 0.2 Dec 13, 2018

Post by FalconGrey » Sat, 15. Dec 18, 19:30

euclid wrote:
Sat, 15. Dec 18, 11:58

Hi FalconGrey :-)

It takes a while, depending on the average skill of the captain and the crew, until the miner or trader starts to move. There is not need to add any wares or issue any commands. In fact, there have been reports here that any additional command can cause problems.

Ideally the ship should be in space without any command (default: wait, hold position). Only then comm the captain and start the AutoTrader. Everything else is fully automatic, a miner will mine and a trader will trade. After you have done that just "forget" the ship. You can add it as subordinate to a station but it won't make a difference. The manager's orders will be ignored. The only way to interrupt the AutoTrader script is if you remove the captain or comm and then stop the autotrade (that's the clean way).

Cheers Euclid
Thanks for the clarification! That may have been the issue. I will try the miners again with the script but will this time not issue them any commands!
It's not if we win or lose that matters, it's that we stood and faced it.

siath70
Posts: 459
Joined: Sun, 11. Jan 04, 03:03
x4

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

Post by siath70 » Sat, 15. Dec 18, 20:41

Since you have made this great script.

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?

Even if said trader is a different type of trader, Build Supply Trader or something, where it might just sit around docked waiting for something that needs those parts.


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).

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 » Sat, 15. Dec 18, 22:02

euclid wrote:
Sat, 15. Dec 18, 19:13
New version uploaded with setup options meeting almost all requests made (see OP for details).

Cheers Euclid
And you just made it perfect! 10/10! :D

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 » Sat, 15. Dec 18, 22:13

Question - if you turn off jumping so that the trader is now flying to do trades, does it still suffer from the long delay that was included to offset the instant jumps?

Edit: Also I noticed gas miners will happily venture deep into xenon territory when two of my gas miners went three xenon sectors deep to Atiya's Misfortune III to get some gas.
Can there be an option to avoid Xenon sectors entirely?

(Love the work)
Last edited by desius on Sun, 16. Dec 18, 00:28, edited 1 time in total.

Matalus
Posts: 1
Joined: Thu, 4. Oct 18, 19:07

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

Post by Matalus » 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.

reqw
Posts: 101
Joined: Sat, 13. Jan 07, 15:23
x4

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

Post by reqw » Sun, 16. Dec 18, 00:26

You ain't geting my first born but you are close

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, 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.

Osbot
Posts: 108
Joined: Sun, 10. Jan 10, 19:49
x4

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

Post by Osbot » 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?

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: 13299
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

Post Reply

Return to “X4: Foundations - Scripts and Modding”