sector trader wont work: terran space

General discussions about the games by Egosoft including X-BTF, XT, X², X³: Reunion, X³: Terran Conflict and X³: Albion Prelude.

Moderator: Moderators for English X Forum

idgar
Posts: 17
Joined: Thu, 15. Jun 06, 14:56
x4

Post by idgar »

idgar wrote:plugin.autotrade.sector (v36)
147 if $productprice >= $avgprice ...

plugin.autotrade.local (v24)
242 if $productprice > $avgprice ...
For completeness I decided to check the universe trader script too (plugin.autotrade.galaxy) but it only calls the local trader script with the range parameter set to null (I think).

So anyway...

Since the lines following the if statement in the quotes in both the sector and local trader scripts are..

$buystation = null ...
goto label selectware

.. the sector trader will get caught in a loop when trying to buy from a place that sells the "best" ware at average price, like a trading station. This loop will be broken when a better deal is found which could take a while.


@Catra
Traders learn to trade at trading stations at level 2 I believe, and I'm pretty sure that part is caught in the "selectware" part of the scripts.


Edit:
Ok, it was level 3. But yes, that part is covered in the "selectware" part of the scripts, which for the normal sector trader always calls plugin.autotrade.getroute.short (dock/level check is on line 18 of this script). Hmm, lots of scripting stuff here from me, maybe the thread belongs in the scripting forum now. :D

Sorry for the posting spam and late edit... Now I'll just wait until someone lets me know if I can safely just fix the bug and save the script.
idgar
Posts: 17
Joined: Thu, 15. Jun 06, 14:56
x4

Post by idgar »

I finally got the time to make a save where the bug is clearly in play and try fixing it. First instructions on how to easily recreate it if you want to verify that it exists:


Recreating the bug:

The bug appears in vanilla X3:TC 2.5. (I have the steam version)

Download this save: right click -> save as
Load the game and start up the Baldric as a sector trader in Mars, then see step 10-11 below for an explanation on how the bug manifests itself.

Or if you want to do it yourself follow these instructions:
(basically what I did to get the save, but skipping some unimportant stuff)

1. Start a game as USC Commander
2. Dock at the Orbital Defense Station and sell one of your weapons
3. Fly to Saturn and buy a fully upgraded (at least engine) Rapier from the shipyard
4. Sell the Scimitar and fly to the PTNI Headquarters equipment dock in the Rapier
5. Buy a mk3 trading software (if it's not for sale there just save and reload until it is)
6. Fly to the Mars shipyard and buy a Baldric
7. Transfer the mk3 to the Baldric and start it up as a sector
8. Leave the sector and start SETA
9. After two energy trades the traders should be level 3 and the bug will appear

The steps might play out differently if you don't use the save, but at some point the Baldric *will* get stuck if you have the same version as I do.

10. Your Baldric should now get the order "Buy ware... C-Ration" and dock at the Orbital Supply base
11. It will stay docked for a very long time, possibly forever. I SETA'd to about an hour of game time after the save and it was still stuck



The fix:

Warning! This fix will make your game ***modified***

Download this .spk and install it using the Plugin Manager.

If you used my save and restart the sector trader command on the Baldric he will immediately buy his C-Rations and go sell them.



Edit:
Removed unnecessary sidetrack and updated the fix info.

I guess my obsession for bug stomping made me find the time needed. It took a few hours to track down the needed info and experiment with various tools and editors. In the end I took the contents of the .xml file you get when you save the script from the game and copy->pasted it into the .pck file (leaving the signature in the bottom) using the X3 Editor 2.

Surely there's a better way to replace vanilla scripts?
Tenebrys
Posts: 4
Joined: Tue, 11. Nov 08, 06:46
x3tc

Post by Tenebrys »

Currently having the same issue in Argon territory. Sector trader in Home of Light scoops up a small quantity of quantum tubes and tows them to the Free Argon Trading Station in the same sector.

Docks, sells the tubes.

"Current Order" changes to

Buy ware... Stott Spices
Stott Spices: 0


An hour later the "Current Order" is still the same, and the sector trader still hasn't undocked.

It's... annoying.

For clarity, 387 Stott Spices are currently available at the station.
Starlight_Corporation
Posts: 1360
Joined: Thu, 17. Feb 05, 16:51
x4

Post by Starlight_Corporation »

I can confirm I got this bug as well.

I tend to train up my Terran sector traders in the Terran Sectors. In most of the times it goes fine, but I know the moment they head to a support base with an order to buy Protein paste or C-Rations they get stuck on that order till a better offer comes along.
Note, the base always tends to have the goods, sometimes in large quantities even, but he doesn't seem to get around actually buying it, even tho he has the order.

This is solved the moment they hit lvl 6 (the moment they can become a local trader).
User avatar
EmperorJon
Posts: 9378
Joined: Mon, 29. Dec 08, 20:58
x3tc

Post by EmperorJon »

As Baddieus pointed out neare the beggining:


They seem to have JDs/Drones etc. delivered by Goner courier. (Tear apart the scripts and you find it, seriously)

So they'll be waiting for them to get through.
______
I'm Jon. I'm mostly not around any more. If you want to talk, please message me! It's cool.
______

Return to “X Trilogy Universe”