[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, 19. May 20, 18:32

AutoTrader and TaterTrader are quite different approaches to automatic trading. I'm not familar with the TaterTrader mod but my mod (AutoTrader) has no effect on the right-click (context) menu.

Anyway, I do not recommend to run both. Unfortunately there is no video tutorial (certainly not for running both of them). However, the OP of this thread explains in detail the setup and the features
of the AutoTrader mod. If you have any particular problems with this mod then please do not hesitate to post it here.

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
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

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

Post by alexalsp » Thu, 1. Apr 21, 14:53

Does this work with 4.0 + 2DLC ?

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, 1. Apr 21, 21:22

I'm running it without problems.

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

ChristopherS
Posts: 17
Joined: Wed, 21. Jul 21, 14:25

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

Post by ChristopherS » Wed, 21. Jul 21, 14:33

Does anyone know what the percentage is that a 5* captain will charge in their fees?

I have recently started playing this game, so every penny is really needed. The mod works, that's not the issue, it's really just the fee.

For example, my trades look something like this (this is a true trade amount)
Bought for: 375,000
Sold for: 859,425
Profit after fee was: 295,351

Quick maths show that without the fee, there was a profit of 484,425, meaning they took 189,074. This means they took more than 39% for their fee, and every one of my traders are doing this also.

I read in a previous reply that someone else was experiencing this also, and that you can change a line on the mod where levels are found, but I do not know how to change this. If the >39% figure is working as intended, then obviously I'd leave it, but if it's not working, I'd be happy to change that line, but I'm not 100% sure I know which file to change that on.

Thanks for your time on this one!
Christopher.


EDIT: Just incase there is a known conflict, my mods used are
All DLC

AutoTrader
Better Tractor Beam
Data Leak Scan Range Increase
EquipNoRNG
Event Driven News
Jump start reduction
LearningAllTheThings
Mod Support APIs
More generous mission rewards
SETA_Everywhere
SectorSatellites
Syn Mk2
TerShipModPack
VTurretBoost
Xenon Proliferation
kuertee: Friendly fire tweaks
kuertee: More generic missions
kuertee: Surface element targeting
Thought provoking signature.

Christopher - Sometimes sarcastic, sometimes grumpy, always pedantic.

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 » Wed, 21. Jul 21, 16:07

Hi ChristopherS,

The commission charge is calculated in the aiscripts folder, stationautotrade.xml for traders and stationautominer.xml for miners. Check the lines after <!-- skillcheck start -->. It's not only based on the skills of the captain but on the combined skills of the entire crew. If the commission charge is to high for you then you want to change the "$ComCharge" value. Hope that helps.

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

ChristopherS
Posts: 17
Joined: Wed, 21. Jul 21, 14:25

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

Post by ChristopherS » Wed, 21. Jul 21, 18:39

Thank you so much for getting back to me so quickly. I've been doing some testing with the level changed to 2, and that's introduced me to a fun thing. It's now taking more.

Real trade:-
Bought for: 481,825
Sold for: 1,047,500
Profit after fee: 94,300
Fee = more than 83%

What I've done now though is change the level to 0 to see if that removes the fee altogether. I'll do some testing then edit this post with my results.

EDIT: Hmm. I am unsure of these figures.
Bought for: 570,875
Sold for: 1,047,500
Profit after fee: 5,250
Fee = Almost 99%

EDIT#2: I've changed the level back to 4, and edited the 100 on that same row to 0. Maybe I changed the wrong thing from misunderstanding an earlier post.
EDIT#3: Not sure if changing the "$ComCharge" exact="0-$Level/4"/> to zero was a good idea. All of my miners are now selling things they have mined for a loss.
Thought provoking signature.

Christopher - Sometimes sarcastic, sometimes grumpy, always pedantic.

ChristopherS
Posts: 17
Joined: Wed, 21. Jul 21, 14:25

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

Post by ChristopherS » Fri, 23. Jul 21, 14:04

Unfortunately, I don't think I'm able to debug this issue anymore.

I decided that it may be worth re-installing the mod, but when I did this, everything stopped working.

I did:
Use the comm to speak with every auto-trader ship and stop auto-trades,
Saved then stopped the game,
Removed and re-installed a fresh file,
Started the game (making sure it was enabled in extentions).

Even doing this, my ships were sat doing nothing for more than 1hr 30m after asking them to auto trade again.

Sorry I'm unable to check any further, but thank you for the time you spent thinking and replying to me.
Christopher.
Thought provoking signature.

Christopher - Sometimes sarcastic, sometimes grumpy, always pedantic.

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, 23. Jul 21, 15:24

I'm not sure anymore what you are trying to do. From your initial post my impression was that you are not happy with the 40% commission charge. Again, if you want to reduce that then just set the percentage directly via the value for $ComCharge. But maybe I misunderstood what you are trying to do.

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

ChristopherS
Posts: 17
Joined: Wed, 21. Jul 21, 14:25

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

Post by ChristopherS » Fri, 23. Jul 21, 15:28

euclid wrote:
Fri, 23. Jul 21, 15:24
I'm not sure anymore what you are trying to do. From your initial post my impression was that you are not happy with the 40% commission charge. Again, if you want to reduce that then just set the percentage directly via the value for $ComCharge. But maybe I misunderstood what you are trying to do.

Cheers Euclid
I was trying to remove it, but I read a post from a few month ago when someone said to change the number after level on that line. I changed it from 4 to 0 and the fee went up. So I changed it back to 4 and changed the 100 to 0. That then landed me with a 99% fee, so then I decided to just re-install the mod and cut my losses, but that's when everything ground to a halt.

I will return to this mod when I start a new game, but for this save, it seems it doesn't want to get going again.

Thank you so much for the time you've spent talking to me about this though,
Christopher.
Thought provoking signature.

Christopher - Sometimes sarcastic, sometimes grumpy, always pedantic.

ChristopherS
Posts: 17
Joined: Wed, 21. Jul 21, 14:25

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

Post by ChristopherS » Tue, 3. Aug 21, 23:42

I'm really sorry to ask for this, I hope people don't take this as me being rude.

My knowledge of editing these files is obviously useless, so can I ask. Would someone be able to make a config that completely removes the commission charge from this mod. I have attempted to do this myself quite a few times, but I manage to mess it up each attempt. Each time I attempt to adjust the commission fee, I end up increasing it, not removing it and I seemingly cannot do this.

If no-one has time to do this, I fully understand.

Christopher.
Thought provoking signature.

Christopher - Sometimes sarcastic, sometimes grumpy, always pedantic.

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 » Wed, 4. Aug 21, 20:37

Hi ChristopherS,

Sorry you have trouble with this. Just set the comcharge to 100. Should look like this:

Code: Select all

<set_value name="$ComCharge" exact="100"/> 
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

ChristopherS
Posts: 17
Joined: Wed, 21. Jul 21, 14:25

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

Post by ChristopherS » Thu, 5. Aug 21, 14:20

euclid wrote:
Wed, 4. Aug 21, 20:37
Hi ChristopherS,

Sorry you have trouble with this. Just set the comcharge to 100. Should look like this:

Code: Select all

<set_value name="$ComCharge" exact="100"/> 
Cheers Euclid
Oohh, that's what I got wrong! Please don't apologise for my stupidity. I really appreciate your time and help. I changed the level= figure to zero, I did not remove it. To confirm, removing that HAS removed the charge!

Thank you so much for the clarification. I really really do appreciate it!
Christopher.
Thought provoking signature.

Christopher - Sometimes sarcastic, sometimes grumpy, always pedantic.

User avatar
alexalsp
Posts: 1820
Joined: Fri, 18. Jul 14, 05:28
x4

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

Post by alexalsp » Tue, 23. Nov 21, 16:33

How does this mod work with game versions 4.1 - 4.2?

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, 23. Nov 21, 21:59

Fine for me. Bare in mind that I'm not using any XML editing of vanilla scripts so the only thing that could cause problems are any script command changes and afIk there are none of those yet.

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.8 Jan. 20, 2023

Post by euclid » Sun, 22. Jan 23, 14:24

New version (0.8 ) uploaded. See changelog 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
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13289
Joined: Sun, 15. Feb 04, 20:12
x4

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

Post by euclid » Mon, 30. Jan 23, 17:23

New version 0.9 fixes a bug (see changelog 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
iniochos
Posts: 304
Joined: Thu, 20. Feb 03, 07:08
x4

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

Post by iniochos » Mon, 6. Feb 23, 12:06

I am a bit of a loss here.
On the first page "Questions and Answers" you mentioned ..."two values "true" (or 0) and "false" (or 1)".
On the same page, you refer to ...

"Changelog Version 0.9 February 30, 2023:

1# Fixed a bug that allows trades unknown to the player although "Know All Trades" was set to 0 (false)."


Finally, what is the right?
"true" is 0 or "false" is 0? :gruebel:

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.8 Jan. 20, 2023

Post by euclid » Mon, 6. Feb 23, 14:04

Ooops, that's a rather old typo, thanks for spotting it. Of course 1 = true and 0 = 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

User avatar
iniochos
Posts: 304
Joined: Thu, 20. Feb 03, 07:08
x4

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

Post by iniochos » Mon, 6. Feb 23, 16:11

No problem at all. :)

Now that I am "here", is it possible to change the ship's current status icon?
The one that appears, regardless if it stays still or moves, is the icon of "hold position".

Thanks

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.8 Jan. 20, 2023

Post by euclid » Tue, 7. Feb 23, 00:12

Well, that is THE one thing I've spent a lot of time on back then when coding the AutoTrader. Problem was (and still is I think) that icons are set via jobs, commands and missions and any of those will prevent the AutoTrader script to run on the pilot (captain). Actually creating a mission called "AutoTrade" (or "AutoMine") may work but then you have that mission as a mission icon and in your mission log all the time.

AfaIk there is no way to create a custom command/icon for an own script. And hijacking the trade/mining icon to substitute it for the "Wait"/"Hold Position" would replace it everywhere. However, it's some time ago I've looked into that and if anyone knows how to do that then I'm happy to look into it again. ;-)

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”