[SCR] OK Traders v1.7.1 (04-12-14)

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

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

Post Reply
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

[SCR] OK Traders v1.7.1 (04-12-14)

Post by Shimrod » Tue, 14. May 13, 00:47

OK Traders

OK Trade (trade command)
- Operates as a free trader when no homebase is set (like UT)
- When homebased it trades multiple wares for its homebase (like CAG)
- Coordinates with other OK Traders
- Monitors profitability and replans trade runs
- Scans for hostiles and escapes before getting attacked.
- No micromanagement, levels or special equipment requirements.

Configuration Options
- Broadcast settings to multiple ships
- Auto-rename (off by default)
- Trade illegal wares (free trader only, off by default)
- Sector blacklist (for station selection, not move-pathing)
- Equipment config
- Respects dockware manager ware limits
- Optionally tether a free trader to a sector and set a range it can trade in.
- Economy boost mode for free traders.

Requirements
- Trade command software MK2

Compatibility
- Terran Conflict and Albion Prelude

Format
- ZIP file containing T file and script files.

Download

Image

Release notes and details can be found in subsequent posts.

References
- Developed using X-Studio
- Hosted by XDownloads

Resources Used

The resource IDs have been selected based on available slots in the community script and download library thread. However this does not preclude the possibility of conflict as those IDs may only reflect resources used in the scripts that thread indexes.

Code: Select all

Text File
  9055
Trade Commands
  448: COMMAND_TYPE_TRADE_48

Edit: added working download link. X2-Illuminatus
Last edited by Shimrod on Thu, 4. Dec 14, 01:58, edited 38 times in total.

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Tue, 14. May 13, 00:47

Change Log

1.7.1
- Fix a bug which could lead to station ware limit settings corruption, causing traders to gradually use more CPU. If corruption is detected in 1.7.1 the station ware limit config will be reset to default.
- Fix a bug where homebased traders with jumpdrives would perform a 'best chance' station search instead of 'best price'.
- When evaluating docks to buy or sell at, examine other elligible docks trading at the same price to determine a more favourable stock level.

1.7.0
- Add Stock Limits settings accessible from homebased trader menus to support intermediate ware trading. Traders avoid selling below the minimum stock limit and avoid buying above the maximum stock limit. The limits apply to all traders at that homebase.
- Fix a bug with trading energy cells that could cause homebased traders to sit around in a station (1.6.2 regression)

1.6.4
- Add option for broadcasting OK trade to AP fleets
- Allow broadcasting from free traders in addition to homebased traders

1.6.3
- Add a blacklist menu option for adding all sectors belonging to a selected race
- Fix a bug where homebased traders would sell all their jumpfuel before returning home after a sale (1.6.2 regression)

1.6.2
- Fix a bug with the blacklist Clear button not working (1.6.1 regression)
- Prevent traders from selling Replicators
- Optimize the amount of jump energy for homebased traders based on current activity and reduce free trader energy stores by 20%

1.6.1
- Remove the ship ID code from auto-naming and instead add it explicitly into the attached warning message
- Let stations be blacklisted in addition to sectors
- Set default ware trade mode for intermediate products to None

1.6.0
- Added a broadcast option for homebased traders to share settings with multiple ships.
- Changed auto naming scheme for homebased traders. Names now include job names where applicable (e.g. Weapons Dealer)
- Set default ware mode for dock class homebases to No Trade
- Added equipping options to disable cargo life support and duplex scanners
- Avoid buying duplex when triplex is available
- Fix traders were only buying from docks when no factories qualified
- Fix eco traders not buying from docks

1.5.2
- Exempt traders homebased at docks from the 'Min Stock Level Trade %' setting when selling the dock's wares. The setting still applies to buying.

1.5.1
- Add equipping option for rudder optimizations
- Disable laser and missile equipping by default for new installs
- Rename Settings menu to Global Settings
- Add config option to disable the alert noise when trader is targetted
- Add text files for DE, PL, CS, IT, ES, FR, RU with English strings.

1.5.0
- Add simple global on/off equipment options to the config menu (lasers, shields, missiles, drones, docking computer, jumpdrive, triplex)
- If the trader lacks engine tunings or jumpdrive (if enabled) it will fly directly to docks to buy these goods in that order as top priority.
- For all other equipment the trader will only buy them if it happens to be docked at a station selling that item.
- Traders retain installed (i.e in shield bays or gun slots) lasers and shields regardless of whether the respective options are enabled.

1.4.3
- Fix: traders might not refuel before selling a ware outside their jump fuel range.

1.4.2
- Several performance enhancements, notably for economy boosting traders.
- Fix: exclude marines and mercenaries from being traded (always been present)
- Fix: free traders with docking computers would buy more wares than the destination station could buy. (1.4.0 regression)

1.4.1
- Improve eco trader performance a little when evaluating wares to trade
- Fix: prevent eco traders from selling secondary resources to stalled factories, not helping economy
- Fix: ships buying wares at docks would sell the ware back to the dock afterwards (1.4.0 regression)

1.4.0
- Add an economy boost mode for free traders, where they prioritize trading at stalled factories.
- Add free trader tether sector and tether range options to restrict free trader movement
- Have homebased traders observe dockware manager stock level limits configured on player docks.
- Traders now make use of docking computers when installed, and will buy a docking computer if they happen to dock at a place that sells one.
- Performance optimizations.
- Fix: repair shipyard selection was failing to respect blacklist
- Fix: homebased trader ware settings were not updated when wares were added/removed from the homebase tradeable ware list.

1.3.2
- Balance statistics are now resettable and display with comma separators. Collective balance now tracked in a global rather than summing trader values.
- Fix: balance statistics rollover when exceeding signed int max. Now tracks billions (thousand millions) in a separate integer.
- Fix: blacklisting non jumpable sectors could add duplicate list entries, and would blacklist sectors with jump beacons

1.3.1
- Homebased traders now only test the homebase can afford 1 unit of a ware rather than an amount equal to min(free space ship, free space station).

1.3.0
- Homebased traders now buy jumpdrives in addition to free traders.
- Traders repair hull damage at shipyard
- When docked opportunistically buy and equip a quantity of missiles, drones, tunings (not cargo), scanner, jumpdrive, shields
- Reserve against sale a quantity of supported missile types, compatible lasers (ex. TB, MDS), installed shields, drones, and a jump beacon.
- Launch missiles and drones when under attack
- Increase intelligence around refuelling and fleeing.
- Add blacklist options to add pirate, non-jumpable, and war sectors.
- Increase the attacked warning subtitle message duration from 3 to 6 seconds.
- Rapidly restart the command script on version upgrade, rather than waiting on action completion. May not take effect until +1 releases ahead.
- Display collective free trader balance underneath the current traders balance in the free trader's menu. Note this only includes profits from currently existing player ships.
- Disable selling wares to player owned stations.
- Fix: traders could erroneously believe they had sufficient jump energy to jump when they didn't (since 1.0.0)
- Fix: attempting to top up jump energy exceeding available cargo space (since 1.1.0)
- Fix: take into account infinite buyers when free traders assess trade run profits (since 1.2.0)
- Fix: monitor task could exit on version upgrade and not start again until the ship's move action completes, leaving traders vulnerable (since 1.1.0). May not take effect until subsequent upgrades.
- Fix: race condition where 2 free traders could perform the same trade (since 1.2.0)

1.2.3
- Switch display command to COMMAND_REFUEL when moving to an SPP.
- Revised criteria for searching stations by best-price vs best-chance vs nearest.
- When rerouting a buying mission check the ship can jump to the new destination, otherwise reevaluate.

1.2.2
- Fix if the cargo bay is completely full a trader won't sell the ware (introduced 1.2.0)

1.2.1
- Free traders will buy a jumpdrive if they don't have one already.
- Preserve free trader's profit tracking balance between command restarts. This primarily avoids resetting to 0 on upgrade.
- Fix attempting to buy a ware if there are insufficient funds to buy 1 unit.
- Fix docks not being taken into account when searching for a station to buy a ware at
- Fix a bug in infinite ware buying detection (introduced 1.2.0)
- Fix selling of wares to infinite buyers not awarding reputation
- Fix a bug where homebase traders would not return to homebase in order to load the ware for a sale mission (introduced 1.2.0)

1.2.0
- OK Trade can now be enabled on ships without homebases. They act as free traders and roam the galaxy in search of profit.
- When a ship is already running the command, the trade menu will display the ships's current settings or profit/loss so far in the case of a free trader.

1.1.0
- Change the OK trade command ID from 42 to 48 to resolve a conflict. Note that following upgrade from 1.0.0 existing OK traders will temporarily show "Unknown command!" until their current action completes and the scripts restart.
- Automatically enable autojump and set min jumps to 0 when starting the OK trade command.
- Detect danger and return to homebase. Display subtitle messages when a trader detects danger.
- Reroute to new destination if current trade mission is invalidated, for example if destination ware price becomes unacceptable with respect to homebase selling price
- Buy wares without first returning to homebase if ship has sufficient jump energy to get there and home again, or if the ship isn't jump capable
- Add a minimum stock level percentage trade threshold with default of 10% (sell when above 10% stock, buy when below 90% stock).
- Improve displyed command action details
- Fix amount of ware on order calculation to include amount in cargobay

1.0.0
- Initial release.
- Tested entirely in XTC 2.0.
- Expected to be compatible with vanilla and XRM TC/AP but remains to be tested. Uses no AP-specific script commands.
Last edited by Shimrod on Thu, 4. Dec 14, 02:06, edited 27 times in total.

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Tue, 14. May 13, 00:48

Free Traders

When starting the OK Trade command on a ship without a homebase, it will operate as a free trader and roam the galaxy in search of profit. This is fully automated and requires no micromanagement.

The free trader will determine the most profitable ware to trade in the known universe then go trade it. It's profit balance since starting the trade command can be viewed in the trade menu.

Homebased Traders

When starting the command on a ship with a homebase, it operates as a homebase trader. The player can configure how the trader should handle each of the homebase wares in terms of buy, sell, or no-trade. Appropriate defaults are detected, so that the trading in all wares can readily be activated without adjusting these values.

The trader will then select the highest priority ware to trade, where priority is determined by the relative stock levels adjusted for amount of ware on order or already bought and being shipped in. A station is selected within the homebase max jumps range. If the ship has a jumpdrive and sufficient energy available the station will be selected using the 'best price' method within the station's jumprange. If the ship could jump there but not back again, the 'best chance' method is selected, otherwise it looks for nearest station with sufficient price.

When docked at a station that trades energy cells or at the homebase, the trader will stock up on 2.5x homebase max jumps worth of fuel. Typically the trader will have enough energy left after a sale to jump immediately to another station to buy a ware, without having to refuel, or to jump home to escape danger.

Note: Starting the OK Trade command enables autojump and sets minimum jump range to zero. This is to enable automatic jumping using the stock movement scripts.

Auto Equipping

Equipping settings (jumpdrive, docking computer etc) can be configured globally in the OK Trade menu.

Note that the trader will only go out of its way to buy a jumpdrive and engine tunings. Other items such as scanners and docking computers are purchased lazily, if the trader happens to dock at a station selling that ware.

Optimizations

- If the script detects that the target station can buy an infinite amount of the ware (e.g. docks that buy shields, lasers, missiles), it'll load as much as it can carry when selling to that station. Note: the detection mechanism is only known to work with XTC.
- If incoming hostiles or missiles are detected in scan range the trader will try and reroute its trade, or flee to a homebase or safe station before being attacked. A subtitle warning message is displayed to alert the player.
- If the price at the destination changes and no longer meets the homebase price, the trader will reroute to a new station or return home and re-evaluate.
- After selling a ware the trader can buy a ware without returning home first, if the ship has sufficient jump energy.
- The amount of a ware on order and in cargo bay by other traders is taken into account when comparing stock levels to determine what to trade.
- The trader will not perform an identical trade mission to another OK trader; ware, destination and trade mode (buy/sell) must differ.

Stock Limits

The homebased trader menu contains a Stock Limits section. This allows a minimum and maximum threshold to be set for each of the homebase wares. These settings apply to the homebase rather than per-trader so only need to be set once.

Min Stock % is used to set a floor amount traders won't sell into This is useful for trading intermediate wares. The default of 0% means traders will sell everything.

Max Stock % is used to set a ceiling where traders won't buy stock above that level. This works in the same way as a dockware manager limit except it is percentage based. The default of 100% means traders will buy the ware to full stock level.

The menu also shows any dockware manager limits in a read only fashion. If a dockware limit is set the minimum absolute stock level between the OK setting and dockware setting will apply.

The global settings page also contains a Min Stock Level Trade % setting. This is used to create a buffer which must be exceeded before a homebased trader will trade a ware. The purpose of the setting is to avoid traders performing small trades, such as immediately re-buying the jumpdrive energy they refuelled with. This setting only applies to triggering a trade run; the trader will still use the full range of the stock level, or as limited by Min and Max Stock Level % settings described earlier.

Setup

Install
- The script and t folders from the zip should be copied to the folders of the same name in the Terran Conflict folder. For Albion Prelude, copy into the script and t folders in the addon subfolder.
- The setup script should run after starting or loading a game. The OK Trade command should then appear in ship trade menus.

Upgrade/Downgrade
- Replace the script files and load the game. The setup script will automatically upgrade settings, re-creating them on downgrade.
- Running OK Trade scripts will restart themselves following completion of their current activities

Uninstall
- First run the uninstall command from the OK Trade menu. This will replace running scripts with appropriate default commands (sell ware, buy ware, return home) to avoid disrupting immediate activities.
- Then save the game and remove the setup script. Upon reload the trade command should be gone.
Last edited by Shimrod on Fri, 22. Aug 14, 18:39, edited 9 times in total.

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Tue, 14. May 13, 01:12

This is great Shimrod thanks.

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Tue, 14. May 13, 01:30

No problem, cooperating traders seemed the only solution for keeping my energy guzzling weapons complex stocked :)

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Tue, 14. May 13, 03:08

Better/easier traders are always welcome, Shimrod!

Do you envision this as a replacement for CAG?

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Tue, 14. May 13, 03:38

I've barely used CAG so I can't properly review or compare it. From the CAG forum post it does appear to have similar functionality, but with particularly emphasis on experience levels, training courses, special equipment capabilities.

OK traders is designed to be immediately useful, to automate as much as possible and minimize micromanagement.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Tue, 14. May 13, 03:42

That makes sense. I stopped using CAG for exactly those reasons.

Thanks for contributing this. I expect that your customary high code quality will result in a very useful script.

Mad_CatMk2
Posts: 518
Joined: Sun, 22. Feb 09, 20:13
x4

Post by Mad_CatMk2 » Tue, 14. May 13, 04:45

DrBullwinkle wrote:That makes sense. I stopped using CAG for exactly those reasons.

Thanks for contributing this. I expect that your customary high code quality will result in a very useful script.
Agreed with Dr. B above too (nothing against Lucike or his code/work tho!)

Shimrod might you extend this script to mirror Lucike's complement of trading scripts (CAG, EST, and the like) but to give them the same focus as this script? That might be pretty cool to have.
I fly an OWP. What about you?

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Tue, 14. May 13, 04:51

Shimrod will OK traders work if homebased to a TL?

For example: I have a TL dedicated to salvage. If it gets full would I be able to have the homebased OK traders sell the wares in the ship?

EDIT: Figured it out. Looks like its only focus is on the station. Still a fantastic alternative to CAGs. Thanks again.

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Tue, 14. May 13, 11:23

Shimrod will OK traders work if homebased to a TL?
v1 only trades for station homebases. Does another script already do this , or is there a well known absence of scripts to manage this?

Do you imagine trading from homebased ships that can dock at the TL (can M3 carry ore?), or beaming/droning freight to nearby TS, given the general absence of TS docking slots?
Shimrod might you extend this script to mirror Lucike's complement of trading scripts (CAG, EST, and the like) but to give them the same focus as this script? That might be pretty cool to have.
I'll be sure to look at these for ideas, but my immediate focus is with improving trader intelligence, such as escaping hostiles, seeing if it can buy a ware in the local sector after selling one.

An intuitive enhancement would be permit a non-homebased trader to act as either a free trader, or to trade for all player stations. I'm also interested in whether huge ships like TL's could trade via drones without docking.

User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle » Tue, 14. May 13, 11:46

Shimrod wrote:I'm also interested in whether huge ships like TL's could trade via drones without docking.
Transfer Freight via Drones works great after adding engine tunings to the drones and increasing their transporter range (Freight Drone Transfer v08). Automating trade with freight drones would be a welcome addition to the game.
  • (In-sector docking takes a long time, so I simulate Docking Computers on the drones by using Gazz's Docking Lockup Fix in my own game. You could customize your code similarly.)


CLS2 (Bonus Pack) will trade from a TL, but setup is complicated because CLS2 is really designed for automating specific cargo runs rather than general-purpose trading. CLS2 will dock if it can, or will use the Transporter Device if available. AFAIK, CLS is the only current trade script that works from TL's.

Falcon Haulers can carry Ore. They are the only M3's with XL cargo space in the vanilla game.
Last edited by DrBullwinkle on Sat, 14. Dec 13, 13:15, edited 1 time in total.

Vayde
Posts: 849
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde » Tue, 14. May 13, 20:38

So this works in a similar way to a CAG and buys and sells wares for a single station or a complex?

This script set does not require pilots to train levels?

Does it keep stock levels at required amounts?

Oh never mind I'll get off my arse and test it myself...
Still life in the old dog yet...

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Tue, 14. May 13, 20:51

So this works in a similar way to a CAG and buys and sells wares for a single station or a complex?
Yes, it trades only for a station homebase. This might get extended in future but no concrete plans..
This script set does not require pilots to train levels?
No levels, just trade command software mk2.
Does it keep stock levels at required amounts?
It'll buy until 100% and sell until stock level is 0%. It selects which ware to trade based on stock level percentage, adjusted for amount currently on order by other OK traders from the same station.

jessterg
Posts: 28
Joined: Sat, 5. Dec 09, 18:52
x3tc

Post by jessterg » Tue, 14. May 13, 22:20

Super cool! I too had stopped using the CAG and manually took care of the shopping and selling from my staion hubs. Shimrod, Dr B, Vayde, just found this script : http://www.x1tp.com/root/index.php?opti ... 62&cid=984

If it does what Al_main and his buddy advertises, I can use my TL to trade with stations after I utilize the debris I've taken from stations wrecks , find a great buy while building stations for someone and . . . Way cool!-- to load up on energy cells or ore and foodstuffs for after the build! Ie, rather than going through the process of using multiple TSs to hurry and purchase the goods to sell the empty stations. I'll see how it goes and report if no one else does it before.
(thanks again for your and JoelR's help for the save: TESCGs script, Salvage Command Software http://forum.egosoft.com/viewtopic.php?t=223882.) In case you've never cleaned up Prez End, Homily of Perpetuity and I think the unknown sector between New Income and Montalar. you can repair several Mining TLs and a lot of Mercury Hauler wrecks. Great fun for me! When my resources get low on the TL for repairing wrecks I can just zip to one of my factory hubs and beam what I need. (Once I remake them from my computer crash. :evil:

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Tue, 14. May 13, 23:23

I fancied freight drones on the TL transfers for in-sector visuals, based on a video I saw recently (don't recall if it was elite, rebirth or star citizen) showing drones unloading a cargo ship. I'd like to see an orderly stream of drones flying out to the station and another stream coming back. Perhaps uniformity of flight paths could be effected by disabling collision detection, it's something I'd need to experiment with.

I suspect simulating the ware exchange would still have to underpin the drones though. If each drone were to conduct a real miniature transaction, then the stock level and therefore price would continually rise or fall rather than the bulk transaction occurring at a fixed price.

User avatar
joelR
Posts: 2008
Joined: Mon, 9. Jul 07, 23:33
x3tc

Post by joelR » Wed, 15. May 13, 00:01

Thats a great idea. It would make freight drones actually useful.

Vayde
Posts: 849
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde » Wed, 15. May 13, 22:45

Testing set up. 5.2 AP with the jump start script to set a few things in motion and help with start up. Starting sector Argon Prime.

So we have 2 1mj shield fabs in Argon Prime about 3k apart. 2 Mercury's fully tricked out, max shield rudder speed and 4k cargo with jump drives.

1 set as an OK Trader the other as a default CAG, no adjustments. Each assigned and home based to their own Fabs. Each fab left at default pricing and given 1 mil creds.

Jump range on mercs and stations set to 2. 2 sector exploration range of Argon Prime with no sat placement.

And they're off.

The OK trader was off like a shot and had his fab filled and producing really fast, the CAG just trundled off to its first station as he has no jump ability yet.

The OK trader was the first to start and sell products to the Argon eq dock. on avg he would sell 24 to 36 shields at a time.

We are now 6 seta hours into the test.

The CAG is catching up, one more training and he will have jump drive ability. It's at this point with 144 shields in his fab he decides to sell for the first time, netting a huge amount and almost catching the OK trader for profit.

Another 6 hours on seta 10 and the CAG pilot is more than holding his own. Profit for both fabs is about 600k with the OK Trader just edging it.

It's at this point that the CAG pilot takes his last training and his brain shuts down. He starts jumping for goods but does not have the fuel to return so ends up flying the whole way back.

Mr OK trader does not have a complicated algorithm slowing him up so he pushes ahead.

We are now 18 seta hours into the test.

The CAG pilot has found his idiots guide to piloting a ship and is putting it to good use, if he is beaten to a trade by an NPC he finds another place to buy. Unfortunately for the OK Trader he seems to be continuing his flight and buying at a higher rate. His station is always producing and is never short of wares.

Now the result of this test shows me that there is not a lot to choose between these two scripts. I deliberately did not adjust any CAG features to just be able to get a comparison. Although with a few seconds of tweaking the CAG at the start, his profit margins would have been better.

However as an afterthought, I should have ran a fully trained CAG against the OK trader to give them both an Equal start. I might do this another time.

As I've only ran this on a simple basis using a single fab with 1 product and 3 resources, I can't possibly know how this test would work with a larger complex and intermediate goods.

I'm neither Pro OK Trader or CAG, I was just curious as to how they would perform against each other. The information I have given here is by no means definitive and is not intended as a guide or a preference of one script over another.


Vayde
Still life in the old dog yet...

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Thu, 16. May 13, 00:25

Nice review, thanks Vayde.

In my case I've got 15 traders working a quad XL laser complex and they're keeping pace all right. It stocks something like a billion energy, and if energy isn't filled at a high rate only 1 type of laser ever starts building at a time. Was impossible with default trade scripts. I've dedicated 1 OK trader as a seller though as the energy reserve is taking so long to build that it's otherwise always a higher priority than the products, which annoyingly build in batches of 50 out of 80 so won't actually fill up unless sold off.

I've got 4 of them working a teladianium complex, taking over from 4 vanilla traders. They've really turned that thing around, it's now fully stocked with energy with product barely sitting there for long. 2 can probably manage it.

Being able to exploit infinite laser buying EQ docks makes a big difference to my complex. Without this I was only trading 1 PPC at a time, since the trader would otherwise factor in 'free amount of ware' in dest station to the amount it would load up. I noticed the vanilla selling script would load a bunch of PPC, but sell only 1 of them, so it would come back with most of them still in cargo. Would be interesting to know how CAG detects and handles selling to infinite buyers, I used a somewhat creative method to solve that. This is in XTC btw, haven't checked it on vanilla/XRM/AP. The way I see it, if the player is able to exploit that, then it's fair game for the trader automation to exploit it too.

In terms of forthcoming changes I'm adding a monitor task that scans for incoming hostiles so the trader can jump to safety before being attacked. I'll also make this task monitor the target station's price and divert or return home for refuelling, to optimize away that trouble your analysis highlights.

If there are any other low-cost high-payoff optimizations that spring to mind do let me know.
- Sell multiple wares in 1 go in the target sector if price is ok. Wouldn't be trivial to implement and this doesn't seem likely to gain much in the majority of cases.
- Don't return home empty after a sale, if a bought ware in local sector is highest priority for the homebase and within cost. Should be straightfoward and occasionally worthwhile.

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod » Thu, 16. May 13, 22:56

I discovered there's a command conflict with Station Financial Manager. Trade cmd id 42 appeared unoccupied but there's a duplicate entry in the reservation table which is in use. I'm going to switch the command id to 48 in the next patch.

Code: Select all

<t id="441">COMMAND_TYPE_TRADE_41</t> : UTProfit - UTProfit by Euclid 
<t id="442">COMMAND_TYPE_TRADE_42</t> 
<t id="442">COMMAND_TYPE_TRADE_42</t> : Station Financial Manager Automate - Station Financial Manager by S9ilent 

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”