[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

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.7 Feb. 18, 2019

Post by euclid » Tue, 9. Apr 19, 12:19

Kalypzo wrote:
Tue, 9. Apr 19, 09:32
Noticed an issue with the traders fee.
I'll have to look closer but at current over half of my profits are unaccounted for.

E.g

Bought wares for 795,000
Sold wares for 1,950,000
Your profit is 525,000


No fee should be 1.2mil. how much does he take?

And is there a way to lower his commission fee in the coding? What would I be looking for?
Hi Kalypso :-)

The commission charges are calculated as:

Code: Select all

 <set_value name="$Level" exact="[this.assignedcontrolled.combinedskill,90].min" /> 
 <set_value name="$ComCharge" exact="100-$Level/4"/> 
which means at most 22.5% of the profit. In your case the profit displayed is not right. It should be at least about 860k. I'll check the code.

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

Kalypzo
Posts: 5
Joined: Tue, 9. Apr 19, 09:28

Re: [MOD] AutoTrader with Options ver. 0.7 Feb. 18, 2019

Post by Kalypzo » Wed, 10. Apr 19, 03:34

So what value would I change to drop the commission to say 10%

Kalypzo
Posts: 5
Joined: Tue, 9. Apr 19, 09:28

Re: [MOD] AutoTrader with Options ver. 0.7 Feb. 18, 2019

Post by Kalypzo » Thu, 11. Apr 19, 04:12

Euclid?

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.7 Feb. 18, 2019

Post by euclid » Thu, 11. Apr 19, 14:55

I've checked the code and can't see anything obvious that could cause that. Will need to do some in-game testing.

Concerning your question: Just put $Level = 0 for no fee.

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

Kalypzo
Posts: 5
Joined: Tue, 9. Apr 19, 09:28

Re: [MOD] AutoTrader with Options ver. 0.7 Feb. 18, 2019

Post by Kalypzo » Thu, 11. Apr 19, 15:25

euclid wrote:
Thu, 11. Apr 19, 14:55
I've checked the code and can't see anything obvious that could cause that. Will need to do some in-game testing.

Concerning your question: Just put $Level = 0 for no fee.

Cheers Euclid
Don't mind the fee, it doesn't break the game
Thanks for the info, and well done

kyrnn
Posts: 7
Joined: Thu, 15. Oct 09, 05:58
x4

Re: [MOD] AutoTrader with Options ver. 0.7 Feb. 18, 2019

Post by kyrnn » Fri, 12. Apr 19, 14:42

I wanted to stop AutoMiner, so I can upgrade its ship but every time I try comm to the AutoMiner, there's no Autotrader options in comm menu? What am I missing? My AutoMiner is still carrying on and have an asterisk by name so obviously, the mod is still working but I can't find a way to stop it for a moment.

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.7 Feb. 18, 2019

Post by euclid » Fri, 12. Apr 19, 20:50

There should be an option "Stop Auto Trade". It works in my game.

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

kyrnn
Posts: 7
Joined: Thu, 15. Oct 09, 05:58
x4

Re: [MOD] AutoTrader with Options ver. 0.7 Feb. 18, 2019

Post by kyrnn » Fri, 12. Apr 19, 22:55

That's odd, see my screenshots below and as you can see, there's no option to stop AutoTrader?

https://imagebin.ca/v/4dTuyr2xUldk
https://imagebin.ca/v/4dTvKi4aeX0O

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.7 Feb. 18, 2019

Post by euclid » Sat, 13. Apr 19, 15:45

Do you have any other ship on AutoTrade? If so, please try this:

Select the ship from the property menu and select "Comm". Do you see the "Auto Trade Option" ?

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

kyrnn
Posts: 7
Joined: Thu, 15. Oct 09, 05:58
x4

Re: [MOD] AutoTrader with Options ver. 0.7 Feb. 18, 2019

Post by kyrnn » Sat, 13. Apr 19, 18:13

Yeah, I have 3 or 4 on AutoTrader and all show same as the screenshot that I posted. Also, when I made a new trading ship, the AutoTrader is not even on the comm so I couldn't start AutoTrader with the new trading ship either.

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.7 Feb. 18, 2019

Post by euclid » Sat, 13. Apr 19, 20:18

I've tested it with the latest version (2.21) of X4 and it works fine with existing AutoTraders and also with new ships.

It seems you had no problems when starting the AutoTrade on your 3-4 ships initially, which mean you had the option (otherwise you could not have started them). At some point the option did not show anymore which bares the question what has changed. To narrow down the problem could you please check if any other mod you may have installed after starting up the last AutoTrader is causing this? Just disable the "other" mod(s) and see if you still cannot get the option on "Comm".

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: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

Re: [MOD] AutoTrader with Options ver. 0.7 Feb. 18, 2019

Post by euclid » Sat, 13. Apr 19, 20:27

Kalypzo wrote:
Thu, 11. Apr 19, 15:25
euclid wrote:
Thu, 11. Apr 19, 14:55
I've checked the code and can't see anything obvious that could cause that. Will need to do some in-game testing.

Concerning your question: Just put $Level = 0 for no fee.

Cheers Euclid
Don't mind the fee, it doesn't break the game
Thanks for the info, and well done
I've tested it in-game with version 2.21 of X4 and found no problems. For example one of my AutoTraders bought spaceweed for Cr 114,928 and sold it for Cr 229,203 for a profit of Cr 107,398 where the commission charge of Cr 6,877 was already deducted. If you still encounter that problem please feel free to load up your saved game (for example dropbox) and let me know the link. I'm happy to take a closer look. Please also mention all other mods you are using.

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

kyrnn
Posts: 7
Joined: Thu, 15. Oct 09, 05:58
x4

Re: [MOD] AutoTrader with Options ver. 0.7 Feb. 18, 2019

Post by kyrnn » Sun, 14. Apr 19, 04:35

I went to the extensions menu in the game and noticed that there are 2x AutoTrader on the list, I'm not sure how that happened. :gruebel: So, I delete the mod and reinstall the mod and now it's working fine. Sorry for all of the trouble!

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.7 Feb. 18, 2019

Post by euclid » Sun, 14. Apr 19, 13:01

No problem, I'm glad you've found it ;-)

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

Endeavour79
Posts: 287
Joined: Fri, 29. Nov 13, 23:14
x4

Re: [MOD] AutoTrader with Options ver. 0.7 Feb. 18, 2019

Post by Endeavour79 » Mon, 10. Jun 19, 03:57

Hi Euclid,
Have you tested SETA mode with Autotrader? I'm noticing a large number of negative profit trades (substantial) when having say 10 Trader running and staying in SETA.
Do you have a recommendation how to avoid the trades at loss?
Cheers, End

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.7 Feb. 18, 2019

Post by euclid » Mon, 17. Jun 19, 01:32

Hi Endeavour79,

I have not tested how SETA and AutoTraders work together in particular but I did many overnight SETA runs to test the economy while several AutoTraders were active and did not notice any losses. Did you receive negative profit messages in the player's logbook?

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

Endeavour79
Posts: 287
Joined: Fri, 29. Nov 13, 23:14
x4

Re: [MOD] AutoTrader with Options ver. 0.7 Feb. 18, 2019

Post by Endeavour79 » Mon, 17. Jun 19, 02:28

Yes, I judged by checking the logbook only.
I noticed a lot of red coloured entries showing losses.
In many cases (but not exclusively) the trades involved illegal goods.

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.7 Feb. 18, 2019

Post by euclid » Mon, 17. Jun 19, 11:39

Endeavour79 wrote:
Mon, 17. Jun 19, 02:28
Yes, I judged by checking the logbook only.
I noticed a lot of red coloured entries showing losses.
In many cases (but not exclusively) the trades involved illegal goods.
Hmm ... that is strange because the script is not using any colour formatting when writing the trade report to the player's logbook. Are you sure there is no other mod involved?

Edit: Just to be sure we are talking about the same logbook reports, it should be something like this:

"Last trade: Bought 2350 of Spaceweed from Alexandria Drugs for 1,250,000 Cr
and sold it to Norad Trading Outpost for 3,450,000 Cr for a profit (including my fee) of 1,980,000 Cr."

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

zerobaha
Posts: 1
Joined: Mon, 17. Jun 19, 15:50

Re: [MOD] AutoTrader with Options ver. 0.7 Feb. 18, 2019

Post by zerobaha » Mon, 17. Jun 19, 15:53

Any Idea why the Trader is making only really low profit trades ? Like medical supplies for 5k profit or graphene for 7k etc. I guess they sell really low and buy high but still the margin on them is super low.
I assumed it was the sector satellites mod but even with it disabled the numbers are that low. (trader level is high too)
https://imgur.com/OiQIaMd

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.7 Feb. 18, 2019

Post by euclid » Tue, 18. Jun 19, 02:21

Hi zerobaha,

Switch off "prefer player station" and observe the trades for a few hours. Did that solve the low-profit problem?

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

Post Reply

Return to “X4: Foundations - Scripts and Modding”