[BONUS Plug-In] Trade Command Software MK3

The place to discuss scripting and game modifications for X²: The Threat.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
Posts: 4585
Joined: Wed, 6. Nov 02, 21:31

[BONUS Plug-In] Trade Command Software MK3

Post by ticaki » Mon, 19. Jul 04, 01:05

Trade Command Software MK3.

1. pilots now display ranks in names
2. traders will no longer fly through xenon sectors
3. bugfix regarding traders removing equipment from AI equipment docks

There has been a small update. Details in the change log - nothing critical but it is recommended that you download and install the latest version over the previous one. It will upgrade your existing traders automatically.

Mini-FAQ wrote: Q: I updated directly from 1.2, do I need to install previous versions of the software?

A: No, if you have an older version of the Trading scripts these will either be replaced by the new version or become obsolete - all you need to do is extract the archive to your game folder and let it replace existing files.

Q: I installed the new Trade Scripts, do I need to do anything else?

A: Yes, please restart the Trading Command for each Trader. Your ships will then be upgraded to the latest version. They will keep their experience!

Q: Do I need to re-install the Upgrade in my ships / buy additional software?

A: No, the Universe Trader option is a free upgrade to the Sector Trader. Except for the Universe Trader requirements (see below) all you have to do is install the scripts.

Q: I installed everything but the command option(s) are/is grayed out, why can't I activate the command?

A: If your ship does not meet the requirements for Trading the Commands will be inactive (for the Universe Trader you need good shielding and Fight Software - see below for details)

The Trade Command Software MK3 now contains:

1) The Sector Trader, which remains within one sector.
2) The Universe Trader which will look in other sectors over increasing distances for wares to trade.

The Trade Command Software MK3 is a software upgrade that allows a hired pilot to automatically look for good prices and trade. The pilot is ordered automatically from the local jobcenter once the software is run for the first time. (A jobcenter where you can hire experienced pilots is in preparation.)

The pilot learns to interpret the output from the MK3 software and earns experience. Every 50,000 earned credits the pilot advances by one level.

Firstly he learns to trade better.

From level 4 onwards he is intelligent enough to check the product of the station he is located in before flying to other stations to trade, avoiding empty trade runs.

From level 7 onwards he will recognise the chance to make a profit if the selling price is above the buying price. Before he only bought wares where the selling price was above average price.

From level 9 onwards the pilot will steer his ship to the closest shipyard if it has been damaged.

Additionally from level 8 onwards the pilot is able to check neighbouring sectors for good trade opportunities. This requires you to start the "Universe Trader" command though. The downside is that this also means higher upkeep. The pilot demands better payment and a well-equipped ship as his journeys can be rather dangerous.

1) at least one 25MW shield or the maximum shield strength the current ship supports.
2) Fight Software Mk1 and MK 2

Level 8 allows the trader to use the jump drive, if the ship is not equipped with a jump drive the pilot will simply order one as soon as he reaches level 12. If the pilot order the jumps drive the price is 10% higher than the normal price as the drive will be delivered to the trader. You may take this literally as there is an actual ship that delivers the drive to your trader. Of course the risk for the ordered ware is on the buyers' side, so if that delivery service goes "boom" it's your problem. Additionally the trader will order up to 12 Fighter Drones over time which he will use in emergencies to distract attackers.

In such emergencies the pilot will try to escape to the nearest station or use the jump drive for an emergency jump to get away from the danger zone. A Universe Trader will never head for systems that have Khaak present - so you'll have to make sure the Khaak don't block all the trade routes of your ships. Xenon and Pirates are NOT considered lethal enemies which makes them the most common threat for your Traders obviously.

If a Trader is attacked he will tell you the ID of the attacker so you know who to look for should you feel the need for revenge.

The jump distance for buying and selling increases with the Trader achieving higher levels until the ship covers nearly the whole universe. For reasons of rationality the buying-range is limited to a max. of 5 jumps (level 21+) otherwise the ship would require too much jump energy.

Up to level 12 the selling-range is 1 sector - the pilot is learning to check his neighbourhood.

Level 13+: 5 sectors
Level 17+: 15 sectors
Level 21+: 25 sectors

As said before, the buying-range is smaller.

Up to level 15: 1 sector
Level 16+: 3 sectors
Level 17+: 5 sectors

The pilot will refuse to do trade runs that only bring minimal profit. There is no point doing a trade run to make a profit of 300 credits when the cost for fuel (energy cells) is some 1900 credits! He'll leave such trade runs to the Sector Traders, the "newbies". Only under extreme circumstances and with no good trade options at all he might do such "lower work" so he doesn't have to fly with empty pockets.

Extremely high-level Traders (level 23+) will additionally co-ordinate their trade runs with each other to avoid multiple Traders heading for the same stations. ATTENTION! These radio communications can be intercepted by high-tech pirates (equipped with jump drives and specialising in expensive goods - currently under development :D ) who will await your Trader at his destination. So better have your mobile task force on stand by.


The jumping Trader will get the necessary energy cells from the surrounding stations. This includes player-owned SPPs. If there are no energy cells available anywhere near these will be ordered from the delivery service - causing extra costs of course.

A Trader will always reserve at least 20 per cent of his cargo space for fuel. The exact amount depends on the distance between start and target system and includes an additional 110 energy cells as reserve. A Trader will ALWAYS restock his reserve to be able to do emergency jumps in case of attacks. If there is enough energy available and the target system is close by the Trader won't refuel.


Every 50.000 credits profit that he makes the pilot receives a fee of 4.500Cr at max. (level 25) following this formula:
(level * 100) + 2000
Over time a pilot would be able to afford his own ship this way....

Error Handling:

No ware found - the Universe Trader will simply wait for the next good opportunity to appear.

No profit made during the last trade run - again the Universe Trader will wait some time and tries again later.

Not all wares were sold (not even in a second attempt) - Universe Trader doesn't care and continues trading - sooner or later he'll be able to sell superfluous wares. Temporarily this decreases available cargo bay size but there is no real point in bothering the player with such minor problems. Sector Traders however will stop their actions and ask for assistance.

No free space in the cargo bay - well there's no free space so listen to what the Trader has to say

Cannot trade here, no docking rights - "so what, let's move on" will be the motto of the Universe Trader. Again a Sector Trader will stop here.

Ship too damaged. You get this message after an attack or, should the situation arise, in continuing use in "acid fogs" which "guzzle" the ships hull.From stage 9 on the pilot jumps into the next shipyard. Then the player can decide whether to order a new ship and transfer the pilot (look for "Transfer into another ship"), or to repair the ship if it's not too badly damaged. Naturally, ship repairs are expensive and are hard on the players' money. :D

After the ship is repaired the trader is able to be restart trading in his sector, just like after transferring into another sector. The experienced pilot then continues trading.


More than I can even list.

I will mention the most notable ones.

-- Experience levels limited on 10 (Sector Trader) and on 25 (Universe Trader). This was causing the payment to get bigger and bigger.
-- Small negative payments were possible if another ship was faster. The trader just sold without taking note of the profit.
-- Ship waits if no products are found.
-- Ship doesn't take ware from Equipment dock <-> Trading Station back and forth. :D Just from Trading Station to Equipment dock, which is intentional.
-- Upgrade routine doesn't buy complete cargo bay extensions, (thank goodness, this is too expensive!) 70% Sector Trader, 80% Universe Trader
-- Upgrade routine first buys engine tunings now. Speed rules!
-- Experience system is changed to internal variable. Salvage Insurance will ALL be transferred to player account, after all he paid for it.
-- Description corrected. Pilots should be always on board. In the new version this really applies. The pilots are visible in the name field.
-- Experience level is shown in the start message as well.
-- In the property list, what the trader is doing is now shown, and also what it carries.
-- A few infinite loops removed. If it wasn't able to sell the products, it went round in circles!
-- Traders will no longer buy wares from your stations that are set not to trade with other races. This ensures that production loops are not adversely affected.
-- The move pilot script will no longer rename pilots to Julian instead of the correct player name.


The logging

In the new MK3 trader there's an additional "Trader" folder. Within this folder there are two sub directories "Logging on" and "Logging off". If you want to activate the log, which is deactivated as standard, you have to copy the "plugin.autotrade.logging" located in the corresponding folder "Logging on" into your "scripts" folder inside your game folder. If you want to turn Logging of again, you have to choose the corresponding file located in the "Logging off" folder. Note that the logging only changes when the trader starts a new selling series. So delays for turning on or off of the logging are possible!

This feature was deactivated by default because the expenditure could have no direct relation to the save game. And because it is, in principle an "abuse" (I say sensible use) of the debug output of X2 to produce a very detailed report. In the XML-Logfiles there are also entries which contain a "load game", located so that a very precise analysis of the save game is possible.

This logging gives very precise information about every step the trader takes. Profits, costs, sector changing by jump drive - even attacks, waiting period, and the "death" of a pilot are recorded there.

The file itself is in XML. There are already XSL-converters for HTML, which you view as an Event-Log, and CSV-converters for import into Excel/Open Office. We have produced some analysis of our own with surprising results, but we leave it to the analysts to discover it for themselves.

If logging is activated then in the game folder, a file named log1500.txt will be produced. In the trader-directory a log2xml.bat is generated, which copyies log1500.txt into the trader folder, adds footers and headers and renames it to x2trade.xml. Players wantint to archive and delete log1500.txt files will need to sort this out for themselves.

So the MK3 trader has now become more transparent than a factory. Every step it takes is now comprehensible and it is no longer an anonymous thing in the background, making money without you knowing how.

Yes, the analysis of Sector Traders is in my opinion essential, because you can see if it is still worth using it in a particular sector, or whether it would be better to find a new sector. If the trader is waiting all the time it would be better to change sectors.

Also, because it doesn't loose experience anymore as a result of the new transfer system, the player has always the chance to send the trader somewhere else. Even the maximum profit that the pilot has made is recorded by the script.

The enclosed programs (saxxon, etc.) were added to it by me. EGOSOFT has nothing to do with the analysis of the files and the XML officially. As already mentioned, some of them are not happy about the abuse of the debug-function.

In my opinion this is a great way to save large volumes of data, e.g. the production data's of the factories. Correctly used, you would be able to see which factories are running and which are only visited once in a blue moon.

Back to the logging. The following points should be noted:

1) Anyone activating logging does so at his or her own risk. Although a 250 hour SETA test has shown nothing more dangerous than some rather large XML-files. :D

2) Anyone not activating it is missing out. :D

3) For people who want to everything clearly set out, it is a must-have!

4) For people who just want to have the trader running in the background, it is not necessary.

Transfer into another ship.

With the new version it is possible to transfer the pilot into another ship. To do this, a special menu a script is available, where you have to fill in the start and target ship as well as the station where the ships should meet. Because of the limitations of the script engine, both ships have to be in space. *Grumble*. Also, both ships should be in the same sector to prevent accidents (crossing enemy sectors).

The new ship, which has to be "empty", i.e. no pilot must be on board, gets the name of the old ship, all important items are transferred, and the pilot is placed into the new ship with all his experience. After this the trader can be started as normal and resumes at the current level. It is not possible to preserve the experience level of the pilot through simple transferring of the MK3 software. If you transfer the MK3 in the normal way, the pilot stays and you take on a new inexperienced pilot when you start the MK3 software.

The old ship gets the name '---'.

General effect of the traders on factories

The traders, especially the Universe Trader take care of crisis regions, ensuring that they are provided with all products. Since they deliver resources everywhere very fast, the following effects have been observed.

1) The AI gradually stops running its own transports. If a Sector Trader works in a sector, then you will only see external transports after a while. If you out 10 Universe Trader there as well, even these will get rarer. This effect is only noticeable over a long time.

a) This results in the player being attacked more frequently, just because of simple probability
b) The game performance will become better, because fewer objects are underway.

2) The maximum profit in the universe is limited by time. In some cases it wouldn't make sense to take on more traders, because they wouldn't be able to make any more money and would spend most of their time waiting.

3) Al; AI factories always have enough goods to produce, and almost no-one trades. This boosts industry in general, but it at the same time worsens your ability to sell your own products. The traders spoil their own business eventually.


Job exchange

Wing men for trader

Mobile strike force which takes care of attacked traders

Intelligent pirates which have the high level trader as preferred victims, because they carry very expensive things. The trader has the chance to save itself by ejecting products if its shields are almost down. The pirates will be adapted as AI Routine and act independently of the real trader. They will get experience levels as well and will get more intelligent by the time. (hey, yes - we're evil, didn't you know? That's why we can plan. :D )
Last edited by ticaki on Mon, 29. Nov 04, 11:51, edited 3 times in total.
Zur Zeit nicht aktiv

Posts: 8474
Joined: Tue, 12. Nov 02, 01:26

Post by The_Abyss » Mon, 19. Jul 04, 01:11

It rocks.

Strung out on Britain's high, hitting an all time low

Posts: 248
Joined: Sat, 10. Jul 04, 17:27

Post by Criminal_Colt » Mon, 19. Jul 04, 01:12

Erm, wow!

So this is designed to replace the current trade software MK3?

Colt :D

Posts: 11554
Joined: Sat, 9. Nov 02, 12:45

Post by Xenon_Slayer » Mon, 19. Jul 04, 01:16

Where can I download?
Come watch me on Twitch where I occasionally play several of the X games

User avatar
Posts: 130
Joined: Thu, 20. May 04, 00:52

Post by CLN » Mon, 19. Jul 04, 01:16

How do we get this?

Is the a easy install?

User avatar
Posts: 533
Joined: Wed, 29. Jan 03, 19:39

Post by zoleeboy » Mon, 19. Jul 04, 01:18

Gee that´s some great work!
:thumb_up: :thumb_up: :thumb_up: :thumb_up: :thumb_up: :thumb_up: :thumb_up: :star:
SAS - Proud Protector of Split

Honoured Strong Arm of Family Thi

User avatar
Posts: 809
Joined: Wed, 31. Dec 03, 21:15

Post by Circumcisor » Mon, 19. Jul 04, 01:19

Uh, Wow!
If at first you don't succeed - better not try parachuting

Professional Magnate
Ace of Aces 1st Grade

Posts: 8474
Joined: Tue, 12. Nov 02, 01:26

Post by The_Abyss » Mon, 19. Jul 04, 01:19

CLN wrote:How do we get this?

Is the a easy install?
Look in the Downloads section of the main page

Yes - it's easy.
Strung out on Britain's high, hitting an all time low

Posts: 41460
Joined: Tue, 29. Apr 03, 00:56

Post by CBJ » Mon, 19. Jul 04, 01:20

Xenon_Slayer wrote:Where can I download?
From the downloads page.

User avatar
Posts: 130
Joined: Thu, 20. May 04, 00:52

Post by CLN » Mon, 19. Jul 04, 01:21

down loading now

what a weekend. :) :)

Posts: 357
Joined: Fri, 2. May 03, 00:03

Post by StevesX2 » Mon, 19. Jul 04, 01:24

Every 50.000 credits profit that he makes the pilot receives a fee of 4.500Cr at max. (level 25) following this formula:
(level * 100) + 2000
Over time a pilot would be able to afford his own ship this way....
Call me dumb but this I don't get..

1: I thought the ship was automated

2: why pay 500,000 for software if theres a guy flying it.. :D
Braben - 30 years of faith lost. Enjoy my money

User avatar
Posts: 3153
Joined: Tue, 12. Nov 02, 15:22

Post by Brianetta » Mon, 19. Jul 04, 01:26

StevesX2 wrote:Call me dumb but this I don't get..

1: I thought the ship was automated

2: why pay 500,000 for software if theres a guy flying it.. :D
1. You learn somethign new every day.

2. That includes the pilot's initial fee. He demands a wage, too.
PGP fingerprint: FA3D CA2F 38D3 BA69 87E1 D52E C204 FB5C 430A 0BFA

Posts: 8474
Joined: Tue, 12. Nov 02, 01:26

Post by The_Abyss » Mon, 19. Jul 04, 01:26

Call it a 'signing on fee' :wink:

Edit - BurnIt!'s explanation was superior :wink:
Last edited by The_Abyss on Mon, 19. Jul 04, 01:34, edited 1 time in total.
Strung out on Britain's high, hitting an all time low

User avatar
Posts: 4858
Joined: Wed, 6. Nov 02, 21:31

Post by BurnIt! » Mon, 19. Jul 04, 01:26

StevesX2 wrote: Call me dumb but this I don't get..

1: I thought the ship was automated

2: why pay 500,000 for software if theres a guy flying it.. :D
Think of it this way:
the software gives a lot of trading data to the pilot - and the pilot needs to understand this data - you need both for it to work.

EDIT: pick the explanation you like best ;)
In der Ruhe liegt die Kraft. / In peace lies strength.

Posts: 362
Joined: Sun, 20. Jun 04, 19:22

Post by Mobile » Mon, 19. Jul 04, 01:31

Will existing sector traders loose their level once they are reset for the galaxy trader?

Also had a sector trader who stopped trading after a 3.5mil profit. strane isn't it?

T.Rank: Advanced Magnate
C.Rank: Combat Ace 2nd
Stations: 563
FLeet: M1: 1, M2: 1, M3: 2, M4: 0, M5: 2, M6: 47, TL: 2, TS: 545, TP: 170

Last Update:30/07/04

Post Reply

Return to “X²: The Threat - Scripts and Modding”