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

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

Post by euclid » Sat, 18. Feb 23, 15:25

If jump is enabled then an AutoTrader will jump close to a station to buy/sell wares. In your case it means that there is a non-enemy station in a Xenon sector which they attempt to trade with. If this station is under attack by Xenons or Xenon patrols are close to the station then it is possible that the AutoTrader will be attacked.

I'm running the same version of the AutoTrader mod for some time now in a relative new game (meaning Xenon and Khaak are still around and active) but I never lost an AutoTrader due to a Xenon (or Khaak) attack. However, I did lose a few AutoTraders to marauder attacks OOS (which still is a mystery to me).

If this happens to you again then please upload a saved game (dropbox for example) preferable just before the AutoTrader is attacked and provide a list of all mods you are using. Then I'm happy to take a look.

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: 305
Joined: Thu, 20. Feb 03, 07:08
x4

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

Post by iniochos » Sat, 18. Feb 23, 15:41

I think I know what causes all these issues :headbang: :headbang: :headbang:

I had forgotten to correct the false to true after the clarification. :evil: :evil: :evil:

Sorry Euclid the mathematician

Caffeinated
Posts: 2
Joined: Tue, 28. Mar 23, 19:11

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

Post by Caffeinated » Tue, 28. Mar 23, 19:19

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
If one wanted to remove the free, copied this into the "stationautotrade.xml" and there was still a fee what do you think would cause that ?

Code: Select all

<!-- skill check start -->	
		  <set_value name="$Level" exact="[this.assignedcontrolled.combinedskill,90].min" />	
		  <set_value name="$ComCharge" exact="100"/>
I do have all the crew slots filled with high level members.
Other modifications I have made like "<set_value name="$Tmax" worked in game.

Love the script, Thank you for your work.

Caffeinated
Posts: 2
Joined: Tue, 28. Mar 23, 19:11

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

Post by Caffeinated » Tue, 28. Mar 23, 20:35

Euclid,

I apologize. I wasn't thinking critically or reading what the text was actually saying.

I understand that changing $ComCharge value to 100.

Removes the $ComCharge value and the "/100" from all of the equations later in the script by removing the common factor.

Where I'm lost is how it is still being calculated and reported in game.

Image

The Output of trade report and its reporting to the log book comes from

Code: Select all

<set_value name="$Olist1" exact="'\n Last trade from cargo: Sold %,s of %2 to %3 for %,s Cr including my fee.'.[$TrueAmount,$Ware,$Buyer.knownname,($ComCharge*$Bprice*$TrueAmount/100)/100]" operation="add"/>
<write_to_logbook category="upkeep" money="$ComCharge*$Bprice*$TrueAmount/100" title="'AutoTrader'" text="$Olist1" />
When modified for our usage and to show how the code is running with $ComCharge =100. It would look like this

Code: Select all

<set_value name="$Olist1" exact="'\n Last trade from cargo: Sold %,s of %2 to %3 for %,s Cr including my fee.'.[$TrueAmount,$Ware,$Buyer.knownname,($Bprice*$TrueAmount)/100]" operation="add"/>
<write_to_logbook category="upkeep" money="$Bprice*$TrueAmount" title="'AutoTrader'" text="$Olist1" />
I'll probably remove "including my fee" but other than that everything is functioning perfectly.

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

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

Post by euclid » Wed, 29. Mar 23, 00:23

Well, the comm charge is included but actually zero but feel free to remove that part of the message. ;-)

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

CockyFinch
Posts: 4
Joined: Sat, 6. May 23, 04:07

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

Post by CockyFinch » Sat, 6. May 23, 04:12

Are there any know Incompatibilities with other mods or requirements or special installation instructions (I used vortex to install)? I’m trying to initiate the auto trader, my trader is in space with the wait command and it is not in the comm choices.

Edit: I have all dlc except kingdom end. Just installed it a last week so running versions 6.0 I believe and 0.9 in your mod

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

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

Post by euclid » Sat, 6. May 23, 15:00

CockyFinch wrote:
Sat, 6. May 23, 04:12
Are there any know Incompatibilities with other mods or requirements or special installation instructions (I used vortex to install)? I’m trying to initiate the auto trader, my trader is in space with the wait command and it is not in the comm choices.

Edit: I have all dlc except kingdom end. Just installed it a last week so running versions 6.0 I believe and 0.9 in your mod
I am not aware of any compatibility issues. However, if there is any other mod that changes the com (player to ship) options it might cause problems. Concerning the installation please check the corresponding section of the OP. I do not use Vortex (or any other installer) so I'm not sure what that is doing. Just make sure
  • The AutoTraderOptions folder is in your extensions folder.
  • The mod is activated which you can check in the content.xml located in Documents>Egosoft>X4>"your steam number" or in the X4 main menu under Extensions.
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

CockyFinch
Posts: 4
Joined: Sat, 6. May 23, 04:07

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

Post by CockyFinch » Sun, 7. May 23, 02:35

Thank you I’ll give I a try. I’ve got like 15 mods “installed” through nexus but only one is showing under extensions. Looks like I’ve got some work to do. Lol

CockyFinch
Posts: 4
Joined: Sat, 6. May 23, 04:07

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

Post by CockyFinch » Tue, 9. May 23, 20:54

Thank you Euclid! Your Mod and a bunch of others I installed are now working great. So one of my ships was off autotrading and got blowed up. I had it on only stations known with no jump. I have no idea where it happened or the cause, i had recently saved so i just reloaded. However, is there plans to institute sector blacklist or maybe a way to manually set sectors in an xml file so that it only traverses "safe" sectors. Also are there any ai mods that tell the ship to run the other way if they see a pirate? Just curious. Thank you.

CockyFinch
Posts: 4
Joined: Sat, 6. May 23, 04:07

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

Post by CockyFinch » Tue, 9. May 23, 21:07

Also is there a way to get a trade route printed up, like in the log book so i could benefit from the work that autotrader is already doing?

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

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

Post by euclid » Tue, 9. May 23, 23:12

I'm sorry you lost a trader. They do get attacked (in my game) quite frequently by marauders even with jump enabled.

As it is for now the AutoTrader/Miner do not use the blacklist and I'm not sure yet how to implement it. The best advise (unless you enable jump) I can provide is to set a fighter on protect ship. Concerning the path he is taking, it should be possible to write the route (as he goes) to he player log or to a file. However, that could amount to a lot of info in particular if you have several AutoTraders going. I'm not sure it's worth to add that option to a future version.

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”