[Script] Update 17.12.06 V1.26 Station trader, automated supply/trade for stations

The place to discuss scripting and game modifications for X³: Reunion.

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

Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

Post by Naffarin » Sat, 17. Dec 05, 20:46

Yes, asking for a report stops any other command running...actually i don't know if this can be changed. So right now the only way is to ask for a report and then restart the supply command again. Changing station jump range should not effect the command though, the only other reason for the traders stopping would be if a complex they are assigned to is being extended

fortysix2nz
Posts: 84
Joined: Wed, 3. Dec 03, 09:48
x3

Post by fortysix2nz » Sun, 18. Dec 05, 02:46

Just a quick question:

It seems to be that if the station a ship is assigned to has > 80% resources and < 20 % products and ships assigned to maintain, then these ships will become idle where ever they happen to be in space. Is this right or do I have a problem? If it is the case, could it be changed so that return home and wait for the correct situation for buy/sell?

Thanks

Myros
Posts: 176
Joined: Sat, 13. Dec 03, 00:23
x3

Post by Myros » Sun, 18. Dec 05, 03:01

Noticed the same thing, they tend to go idle wherever they happen to be at the time. Would like to see them return home before going idle.

M

Cisor
Posts: 287
Joined: Sat, 25. Sep 04, 15:06
x4

Post by Cisor » Sun, 18. Dec 05, 10:02

@Nafferin: Ouch about having to restart the command. Isn't there a way you can do the restart at the end of the report script. (I realise the current instruction will be lost, but at least then the trader will return home and start from there...).

Of course this raises the issue... what will happen to wares already in the hold? Will imports be dropped at station, and will exports still be sold? Hmmm. These are issues with manually restarting anyway, so .... what does the script do?

A thought.... The reason I run the report is largely to see the rank. Can't you append the rank to the ship pilot name (I know it's Julian but that shouldn't matter since it is stored in the ship details for each ship) when there is a rank change? Then we wouldn't have to run the report as much.

Your thoughts much appreciated. (BTW, I like the script very much).

genovagen
Posts: 67
Joined: Thu, 6. Jan 05, 00:29
x3

Post by genovagen » Mon, 19. Dec 05, 01:24

I love you, yea thats all i am saying i love YOU!!

Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

Post by Naffarin » Tue, 20. Dec 05, 09:38

Update 1.15

reused attack reaction script from trade software mk3 instead of an own implementation (yes, i was lazy)
Transports now return home if they don't have anything to do
Transports now change the pilot name and show the experience level in the name, they do this upon reaching the next level or when you start the command, so this may not show up immediately
Transports now order an amount of 4*level of drones when they are idle and reached at least level 2
TRansports now save the laser and shield equipment to prevent accidentally unloading it

Bugfixes:
Fixed a bug with locking stations which allowed transports to sell/buy at the same station instead of preventing it
Fixed a bug when multiple products are available that only the available of the last product evaluated was sold, instead of the amount that could be sold at the target station
Fixed a bug in the locking mechanism which caused the transport to go idle instead of waiting for the lock
...too many more to remember

@genovagen: :oops:

User avatar
-XTM-
Posts: 1277
Joined: Sat, 12. Nov 05, 19:46
x3

Post by -XTM- » Tue, 20. Dec 05, 13:40

Youre the best, thanks!
The Xtended Mod

Need Help?

Ask Questions / View the FAQ's at TheXUniverse Forums
Read the News on Mod Developments at our Website

JudasProphet
Posts: 7
Joined: Thu, 8. Dec 05, 12:27
x3

Post by JudasProphet » Tue, 20. Dec 05, 14:31

This script/mod is made of win and god, you sir deserve a large cookie and an internet for your work.

X-it
Posts: 1311
Joined: Wed, 6. Nov 02, 20:31
x3

Post by X-it » Tue, 20. Dec 05, 18:34

JudasProphet wrote:This script/mod is made of win and god, you sir deserve a large cookie and an internet for your work.
I'm not exactly sure what that means, but I totally agree, I think... :mrgreen:

This script has made X3 many times better for factory owners!

And I've been wondering where I could see the levels of the pilots, and now I know.

I bow before Thee, o Kreator of miracles! :P

I'm still thinking that this is too good to be true, though, and that my PC will blow up. Why else hasn't this been implemented by Egosoft all the way back from X-btf? Are you so much smarter than their devs?

Cisor
Posts: 287
Joined: Sat, 25. Sep 04, 15:06
x4

Post by Cisor » Wed, 21. Dec 05, 00:37

Thank you for the new version and for taking the time to give us this useful utility.

elzar760
Posts: 36
Joined: Sun, 20. Nov 05, 04:51
x3

Post by elzar760 » Wed, 21. Dec 05, 05:04

With 1.15 my pilots still seem to sit idle wherever they are docked after completing their last delivery until either resources are needed or products reach the level to sell, then the transport starts to head home to pick up a shipment.

fortysix2nz
Posts: 84
Joined: Wed, 3. Dec 03, 09:48
x3

Post by fortysix2nz » Wed, 21. Dec 05, 10:16

I have a complex producing Energy Cells which of course the complex also requires. It would be helpful if I could get the script to ensure that the traders always leave behind x amount of energy cells so the station doesn't run out. I figured an input when the script is run or something asking how much to leave in the station, and then the script could always just ignore the first say 1000 EC and make it's calculations on the remaining amount. Would this be possible or a bit on the heavy side?

Most of my facts use this script, its great. I was at one stage (when I only had a few facts) essentially doing the script manually. Which was painful. Cheers!

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

Post by euclid » Wed, 21. Dec 05, 14:34

I read about your script just when I've decided to write a similar for myself - now it looks as if I can use yours :grin:

Two questions:

#1 Can your script make an M6 trade for your station?

#2 Is it possible to exclude intermediate products?


Cheers Euclid

Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

Post by Naffarin » Wed, 21. Dec 05, 21:58

1) Yes, should work though i never tested it
2) yes, if you remove it from the product list (use the complex manager written by me)

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

Post by euclid » Wed, 21. Dec 05, 22:42

Naffarin wrote:1) Yes, should work though i never tested it
2) yes, if you remove it from the product list (use the complex manager written by me)
Thanks for the quick response.

1) Seems not to work because it's not possible to assign a Homebase to an M6. Is there a workaround?

If I understand 2) correctly then I need to remove it from the intermediate product list?

Cheers Euclid

Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

Post by Naffarin » Wed, 21. Dec 05, 22:50

hmm as for 1) didn't know that...it should be possible by using the script call set homebase but as for regular gameplay...seems not to be possible
2)no, you have to remove it from the product list, this is the indicator for a station trader that it may sell a product

kurush
Posts: 4320
Joined: Sun, 6. Nov 05, 23:53
x3tc

Looks more like a stuff for Mk2...

Post by kurush » Wed, 21. Dec 05, 23:37

Well, I think docktrader logic is necessarily very different from freetrader logic.
Trade Mk3 definitely needs some work to fine tune it, but I also think there should exist a docktrader script a la advanced bph that can babysit a factory.
The two scripts would work very differently I think. (imho)
I wonder if there is any purpose in MK2 except being a requirement for MK3?

Tritous
Posts: 899
Joined: Sat, 15. Jan 05, 17:20
x3tc

yes

Post by Tritous » Thu, 22. Dec 05, 17:32

I believe that Mk1 is the selling commands, Mk2 is the buying commands...or it may be the other way around.

Mk3 is the ST/UT commands

As for setting homebases to M6s, that may be a hardcoded thing, I don't actually know.
Give a man a fire, he'll stay warm for a day
Set a man on fire, he'll stay warm for the rest of his life ;)

Naffarin
Posts: 481
Joined: Sat, 3. Dec 05, 09:49
x3

Post by Naffarin » Fri, 23. Dec 05, 17:02

Update 1.16
No functionality added, only verified 1.3 compatibility. Sadly the script engine has not been extended to reflect the settings of the intermediate products, so the station traders are not aware of the new setting to buy/sell/both for intermediate products. This means that you still have to use the complex manager to add/remove intermediate products to the products list if the station trader should sell them.

Bugfix: Transporters now really return home when they have nothing to do (they were a bit stubborn about that)
Bugfix: Transporters now order drones which they didn't do under all circumstances
Bugfix: Equipment save was accidentally using shield bay count to save lasers instead of laser bay count, this has been fixed
Bugfix (well sort of): Transports no longer buy wares that are listed as sellable resources which only happens if they are intermediate products in a player owned complex or in some equipment docks (i think). Anyway this code mostly returned either null or the homebase of the transport, so it did more bad than good. If anybody finds factory combinations that don't work as before, please let me know.
Bugfix: if a transport is not docked at home when the homebase has products for sale he will now check for jump energy before returning home and eventually buy some at the nearest spp)

beartlaoi
Posts: 11
Joined: Sun, 10. Oct 04, 19:30
x4

Post by beartlaoi » Fri, 23. Dec 05, 17:58

I love this script, beats the old BPH hands down.

I actually spent this morning debugging v14 to find out why my three transports were sitting idle at a completely full SPP/Silicon complex.
I fixed sellMultiWares and got them going.

Then I look at the board noticed that I was out of date and you already fixed the problem, Thanks!

However, while I was debugging I noticed two other things that still need fixing in v16.

sellMultiWares 114 stationToSell should be replaced with target. The current var is the loop var, target is the result.

supply 009 reads 'plugin.strader.debug'
This should be 'plugin.strader.debuglevel' like in line 012 and the other scripts.

These probably have little to no real effect on practical operation so don't be in a hurry to release a version for just this.

Post Reply

Return to “X³: Reunion - Scripts and Modding”