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

Re: [MOD] AutoTrader with Options ver. 0.5 Dec 17, 2018

Post by euclid » Sun, 30. Dec 18, 14:30

Was close korvyr ;-)

To modify the default settings to non-cheat you need to change all "true" in lines 43 to 67 of EuclidsAutoTraderAlt.xml to "false".

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.5 Dec 17, 2018

Post by Endeavour79 » Wed, 9. Jan 19, 10:46

@Euclid, Could you rework your mod to make it less spammy in the logbook and provide little more clear and usable information about trades and performance?
I love the mod, already did in XR, but the log is been flooded with a little useless info right now.

Cheers!

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

Re: [MOD] AutoTrader with Options ver. 0.5 Dec 17, 2018

Post by euclid » Wed, 9. Jan 19, 13:36

Hi Endeavour79 :-)

I'm not happy about the current report myself but it's a trade-off. It is possible to add info on the last finalized trade, like "bought x wares form y for z credits and sold them to p for q credits for a total profit of w credits". However, this would lead to even more spam in the player's logbook. I'll think about adding an option to enable/disable detailed trade reports. What kind of "information about trades and performance" would you like to see?

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.5 Dec 17, 2018

Post by Endeavour79 » Wed, 9. Jan 19, 18:46

Thanks for the quick response.

I could see a few ways for reporting:

1. Regular status update in Log
- Classified as Upkeep or Squad or something "not general", for easier filtering
- Providing overall info like profit total, average time on a trade, distance travelled, AT config option values, top 3 goods sold most

2. Detailed report - ad hoc - via comms menu
- All of the above
- Plus what you mentioned for current trade
- Status of current task/activity

Lastly, a whole analytics and charting UI for the AT performance would be awesome but I'd think that's likely a whole new project itself :)

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

Re: [MOD] AutoTrader with Options ver. 0.5 Dec 17, 2018

Post by euclid » Thu, 10. Jan 19, 17:43

Thanks for the feedback Endeavour79 :-)

The current periodic info is already submitted to the "Upkeep" tab of the player's logbook. I've added info on the last trade to it (just one or two more lines). Testing it atm and will hopefully upload an update soon™ ;-)

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

Midge690
Posts: 2
Joined: Sat, 8. Dec 18, 12:02
x4

Re: [MOD] AutoTrader with Options ver. 0.6 Jan. 11, 2019

Post by Midge690 » Sat, 12. Jan 19, 19:19

doesnt seem to be working on the 1.51 beta

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

Re: [MOD] AutoTrader with Options ver. 0.6 Jan. 11, 2019

Post by euclid » Sun, 13. Jan 19, 14:18

Midge690 wrote:
Sat, 12. Jan 19, 19:19
doesnt seem to be working on the 1.51 beta
It works fine for me. What exactly is the 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

ROMB
Posts: 5
Joined: Mon, 9. Mar 09, 09:41
x4

Re: [MOD] AutoTrader with Options ver. 0.6 Jan. 11, 2019

Post by ROMB » Mon, 21. Jan 19, 22:12

Hi Euclid. After some debugging I finally able to find what is the issue in your script, and why it goes into negative profits.
In Version 0.6, File: AutoTraderOptions\aiscripts\stationautotrade.xml Line: 209 you set buyoffer to new offer each time you analyze new ware. Because of this you loosing actual profitable buyoffer. I fixed this by renaming $byoffer to $byoffertmp on lines 209, 226-229, 232 and adding after line 232

Code: Select all

<set_value name="$buyoffer" exact="$buyoffertmp" />
Hope that helps :)

SyNTHETyC3456
Posts: 1
Joined: Fri, 11. Jan 19, 06:04
x4

Re: [MOD] AutoTrader ver. 0.1 Dec 10, 2018

Post by SyNTHETyC3456 » Wed, 6. Feb 19, 01:07

Kadatherion wrote:
Mon, 10. Dec 18, 19:15
Hey Euclid, you should add the other language ids to the content.xml.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<content id="AuT" name="AutoTrader" description="A Fire-and-Forget Trader or Miner" author="Euclid" version="0.1" date="2018-10-12" save="0" enabled="1">
  <text language="7" name="AutoTrader" description="The Universe Trader is back with a Vengeance" author="Euclid" />
  <text language="33" name="AutoTrader" description="The Universe Trader is back with a Vengeance" author="Euclid" />
  <text language="34" name="AutoTrader" description="The Universe Trader is back with a Vengeance" author="Euclid" />
  <text language="39" name="AutoTrader" description="The Universe Trader is back with a Vengeance" author="Euclid" />
  <text language="44" name="AutoTrader" description="The Universe Trader is back with a Vengeance" author="Euclid" />
  <text language="49" name="AutoTrader" description="The Universe Trader is back with a Vengeance" author="Euclid" />
  <text language="86" name="AutoTrader" description="The Universe Trader is back with a Vengeance" author="Euclid" />
  <text language="88" name="AutoTrader" description="The Universe Trader is back with a Vengeance" author="Euclid" />
 </content>
Otherwise, as it happens for all mods, the game crashes/freezes on load for those who don't have the game installed on English Steam (not sure if the same happens to GoG users). This is from the root game dir. If you install mods without the dummy language ids under /documents, the game loads, but it's also been reported that while the game interface recognizes the mods as active, they often won't work / don't work as intended.

On the Nexus, on the sector satellites mod first but on other ones too, it also seems to have been confirmed that new game content (not the case of this mod, but I've seen they reported something like this for your jump/anomaly mod) indeed needs to be placed into .cat files, as loose files will cause the game to crash on load for Win7 users. That's a behavior that isn't as confirmed as the language ids one, so it might not be 100% sure yet, but as a Win7 user myself I can testify it indeed seems to work like that for me.
This. All of this. Resolved the issues with the game locking up on launch with certain mods. Using Win 7 as well.

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

Re: [MOD] AutoTrader with Options ver. 0.6 Jan. 11, 2019

Post by Endeavour79 » Wed, 13. Feb 19, 06:48

Hi Euclid, any chance we could get an updated version that eliminates the negative profit trades?

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

Re: [MOD] AutoTrader with Options ver. 0.6 Jan. 11, 2019

Post by euclid » Mon, 18. Feb 19, 15:48

ROMB wrote:
Mon, 21. Jan 19, 22:12
Hi Euclid. After some debugging I finally able to find what is the issue in your script, and why it goes into negative profits.
In Version 0.6, File: AutoTraderOptions\aiscripts\stationautotrade.xml Line: 209 you set buyoffer to new offer each time you analyze new ware. Because of this you loosing actual profitable buyoffer. I fixed this by renaming $byoffer to $byoffertmp on lines 209, 226-229, 232 and adding after line 232

Code: Select all

<set_value name="$buyoffer" exact="$buyoffertmp" />
Hope that helps :)
Nice catch, thanks a lot :-)

I've uploaded a new version with the changes you've suggested. Please see changelog in the 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

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: [MOD] AutoTrader with Options ver. 0.6 Jan. 11, 2019

Post by graphicboy » Sat, 16. Mar 19, 18:46

euclid wrote:
Mon, 18. Feb 19, 15:48
There's still something awry with negative profit, and I think it's tied to pilot level. I have the "learn all the things" mod, so my pilots actually level up. After a while, and with 30+ traders running, I consistently start losing money. Replicated on more than one "new game".

graphicboy
Posts: 718
Joined: Wed, 3. Jul 13, 03:21
xr

Re: [MOD] AutoTrader with Options ver. 0.6 Jan. 11, 2019

Post by graphicboy » Sat, 16. Mar 19, 23:46

euclid wrote:
Mon, 18. Feb 19, 15:48
Update - left it running since that post, and now I'm well into the positive... not sure what's going on. :? Regardless, thank you for the mod :)

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

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

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

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

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

Post by Kalypzo » Tue, 9. Apr 19, 09:53

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. profits. how much does he take?

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

User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13291
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: 13291
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

Post Reply

Return to “X4: Foundations - Scripts and Modding”