[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

SieurNewT
Posts: 662
Joined: Tue, 13. Apr 04, 18:45
x4

Post by SieurNewT » Wed, 29. Mar 06, 11:44

Thanks

But i wonder that the station will say the ore mine where the owner product are, will have an price more hight that the one set to the transporter station because :

The transporter station will want to buy at very low price
The ore mine will try to sell at the hightest price possible

because the 2 stations wants to do profit... so they should know they are working for the same guy and then sell at a symbolic 1 credit price maybe ?

By the way i am using the XAI station price manager that do a very good combo with your script, by sample i say to the station to sell good according to stock and the Station Trader will then allway go to sell at the best price (profit price for me > estimated cost + average ecell cost), adjusting price in order not having the ships waiting like ducks in the stations

>> about the TS that use jumpdrive and make the way back by foot, i have found in X3 tech forum a thread about an UT 25 level bug, making them having the same bug, here was the answer in cas you have not already fixed that and / or you have this script part reused :
graham_hawkins wrote:Hi SieurNewT

The problem with the UT script is that when it sets up a trading run, it only makes sure it has enough fuel (energy cells) for the buying leg of the run. It ignores the selling leg.

I don't know how this relates to the Station Trader script.

If you want to fix the UT script and you are happy running a modified game, add the bit in red to line 347 of plugin.autotrade.galaxy

347 $fuel.reserve = 5 + $buyrange + 3 + 2 + sellrange
New Config : Intel 8400 & 4Ghz , 4GB DRR2 on Asus P5Q Pro, ATI 4850 and Win XP 32 bits SP3.

Old config AMD 64 3400 1Mo, MSI k8n neo plat, 7800 GS+ Bliss, 2 GB RAM 3200

NeilBeresford
Posts: 4
Joined: Thu, 26. Jan 06, 20:04
x3

Post by NeilBeresford » Wed, 29. Mar 06, 17:36

Well, I've tried the mod - and really had to remove it!

There appeared to be an issue where I was losing around 1,000,000 credits every 5 or 6 minutes under SETI on one Drone Complex. I originally had 9 tankers assigned (ok a little over the top, but I had the money and enjoyed the view of the tankers going to the station!) to the complex and it was making around 30 million a day, all well and good. After assigning the tankers to export from the complex, they did so all well and good. Then after getting the jumpdrive and drones plus the energy (all ships were maxed on hull, speed and shields) the ships started doing their thing... until reaching a sort of limit which seemed to float about - on this limit - it would take around 500k off the station funds (all ships were onroute in space, none actually going to any shipyard and as I said all were stocked up.) and then maybe a couple of 100k lumps amounting to around 1million... this would then be repeated once the ships sold their goods and reached this limit again. Oh I'd better mention there were no other ships docked at the complex and I could see no reason for the reduction. With disabling the script - the complex then went back to normal production - profile level.

Just for further information - I have around 46 ships (29 tankers), and around 40 stations in total - (this includes 2 big complexes with at least 13 stations apiece). My funds were around 940 million, and I only have the sector forbid mod running.

I sort of hope this makes sense - The idea of the traders for the station actually getting smarter and working together is a good idea, however I didn't like them dipping their hands in the till, so all the pilots were erased!

:evil:

thanks - Neil

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

Post by Naffarin » Wed, 29. Mar 06, 20:20

Do you have any other scripts running, Neil ?
I am afraid that the situation you described is virtually impossible with the station traders as the only point where money is needed, is when buying goods or upgrades. From your description i read that they were flying through space at that time, so there cannot be any money be used.

@Sieur:

At first the traders bought from player owned stations at any price but some people were concerned that they would be losing money in that. Therefore i changed the code that player owned stations would be considered only when their price was lower or equal to the buying stations price setting.

*edit*

The fuel is calculated differently in the station trader scripts, which use their own version of calculating the necessary fuel so they won't be affected by this code. Most of the time when the station traders or uts travel by normal drive it happens because they jumped from an attack or were disrupted by a signal during the jumping phase. When that happens the normal "move to station" phase will kick in and they will use normal drive.

NeilBeresford
Posts: 4
Joined: Thu, 26. Jan 06, 20:04
x3

Post by NeilBeresford » Thu, 30. Mar 06, 17:47

Hi Naffarin,

with regards other scripts - the only one I have running is the "forbit sector" script.

I have to admit this is a wierd one, as everything appears to function normally with the script disabled. What I'll do, is re-enable your script again, and monitor the situation. If this lost of funds happens again, I'll supply heaps of info and if needed, a save file. Anyway I'll keep you posted as for whatever reason, there's a problem and its always nice to know where its happening.

:!: As a foot note, I have to admit that with regards the game, I'm unable to complete mission 6 as the game appears stuck, no more details as I wouldn't want to spoil it. I've read in another thread that this might be down to corrupt game data and a re-install would be in order. I wouldn't mind doing this, and hmmm this might be the case with regards the loss of cash.

anyway, thanks for reviewing my post,

:)

Neil

Lethal Mitch
Posts: 423
Joined: Sat, 27. Dec 03, 18:11
xr

Post by Lethal Mitch » Sun, 2. Apr 06, 14:02

Hi Naffarin,

I have a little problem with the script.

The traders fit themselves out with fighter drones for protection but when attacked they are not releasing them.

I wondered if it was because I hadn't fitted fight software to the ships but this didn't make any difference. When I get a report that one of them is under attack and watch, their shields are practically gone and they might have as much as 16 drones on board but they are never released.

Its no big problem as I only have them operating in safe areas or areas where I have a heavy patrol. Just sometimes a baddie or two gets through.

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

Post by Naffarin » Sun, 2. Apr 06, 15:04

That's a feature of the mk3 scripts or rather lib.signal.attacked.trader which only launches drones by 75% probability in the case of an attack.
Not much i can do about i am afraid.

User avatar
DoHi
Posts: 279
Joined: Fri, 22. Apr 05, 02:37
x3tc

Post by DoHi » Tue, 4. Apr 06, 16:59

This script is awesome. Maybe a little too awesome. It makes sense that traders use JD though maybe a small paypacket for the pilots that look after me so well?
@the guy that had like 9 traders, this script aloows me to use 1 maybe 2 traders per station/complex. Runs like a dream.

EDIT: Do the traders sell intermediate goods? I have a Quantum Fab with excess silicon and it doesn't seem to sell, although it's cheap and I don't want to assign a "Sell at best" trader as it will affect my JD range.
The Truth is Out of Style.

JMCorp
Posts: 1422
Joined: Thu, 21. Apr 05, 21:48
x4

Post by JMCorp » Tue, 4. Apr 06, 19:28

this script seems to ignore jump setting of the fab. my spp is set to 3 jumps but the traders are going to kingdom end, rolks drift, emperor mines, etc. this is from argon prime.

i dont really mind all that much once they get their jump drives, but before that it takes ages for them to get anywhere.

*edit*
also, a feature request: would you please make the script so that it prefers less experienced ships over more exp ships? the reason for this is to level up the less experiences ships faster. it seems at this time it is totally random which ship it picks.

*edit2*
also, i dont want to "corrupt" my khaak invader game. does this script check to see if you are friendly with argon or goner before ordering the jump drive? i am enemy of both and dont want my traders to be able to script themselves jump drives because of this.

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

Post by Naffarin » Thu, 6. Apr 06, 08:04

Well jump setting is not ignored, but there is a known bug with distance calculation which was calculated in regard to the wrong sector at one point but i think in that case it is more a rounding bug that leads to using a jump range of 4 instead of 3. The script calculates quadrants for searching and starts at a sector at half distance between the station and the max jump range which would be 1.5 (=>2) for a jump range of 3 and searches in a distance of half jump range (again 1.5 => ) so in total it might consider stations in a distance of four jumps...i have to put in some more safety checks i think.

Preferring less experienced ships is not possible i am afraid, as the traders are distributed to different target stations anyway. Preferring one ship would basically mean taking the other ship completely out because it had to wait for the other ship to finish its trip. But there wouldn't be any advantage since the faster ship won't travel to the destination of the other ship anyway.

As for the khaak invader game. That's an interesting constellation and the script will get jumpdrives nonetheless so you will "corrupt" your game with it. Although i check for stations where i could buy a jumpdrive and wouldn't find any, i then call parts of the mk3 engine that deliver the jump drive to the ship. Although those parts also search for a selling stations they don't check if docking is allowed, so actually you just found a bug in the mk3 software.

gharrison7
Posts: 1
Joined: Sun, 19. Mar 06, 20:10
x3

How do I

Post by gharrison7 » Sat, 8. Apr 06, 01:11

How do i keep my transports from going into enemy teritory? I have xenon marked as enemy but my transports try to sell e-cells and silicone in xenon sector 347 and get buggered.

Also, while reading the previous posts someone was talking about not being able to sell intrim products from his spp complex. He probably has interim set to buy and not sell, or he has not updated to 1.4 where you can specify the buy or sell interim in the station parameters.

JMCorp
Posts: 1422
Joined: Thu, 21. Apr 05, 21:48
x4

Post by JMCorp » Mon, 10. Apr 06, 14:52

ok, thanks for the answer!

User avatar
Crush
Posts: 225
Joined: Thu, 21. Oct 04, 15:58
x3tc

Post by Crush » Wed, 19. Apr 06, 12:53

why doesn't this script work for trading stations? well, i understand about the maintain station command, but why shouldn't it be able to make ships buy stuff and sell from the tradign station?

i claimed the xenon 101 sector, built a trading station there. because of the sector takeover script it is now owned by me. i added some basic wares like shields, ecs and hepts to the trading station and want tses to buy them. atm i can only use the default buy and sell commands which don't use jumpdrives. and that's a pain in 101.

so is there a script that gives trading stations the same functionality as this one gives to factories? and is this one going to support that?

TehFreak
Posts: 636
Joined: Tue, 17. Aug 04, 11:01
x3

Post by TehFreak » Wed, 19. Apr 06, 17:21

He's already explained why it doesn't work with trading stations, and how you can edit the script yourself if you really want it to. Look back a few pages.

Lethal Mitch
Posts: 423
Joined: Sat, 27. Dec 03, 18:11
xr

Post by Lethal Mitch » Wed, 19. Apr 06, 18:42

Yes as Tehfreak explains, this has been spoken about before and must say I agree with the decision for it not to work with Trading/Eq docks by default.

I do also agree with Crush as well, to a point.

Could the script maybe be modified or changed to BUY only when assigned to an Equip dock for example? i.e like the old BPH in X2.

I don't want the selling option. I agree with the reasons given for that not being included.

The reason I would want this is so I could fit out a new ship easier instead of jumping all over the universe in order to fit out one ship with guns etc which I find laborious.

User avatar
Crush
Posts: 225
Joined: Thu, 21. Oct 04, 15:58
x3tc

Post by Crush » Wed, 19. Apr 06, 19:16

TehFreak wrote:He's already explained why it doesn't work with trading stations, and how you can edit the script yourself if you really want it to. Look back a few pages.
i'm really sorry. didn't want to read the entire thread. maybe this could be included in the first post, that the script doesn't work with trading stations?

TehFreak
Posts: 636
Joined: Tue, 17. Aug 04, 11:01
x3

Post by TehFreak » Sat, 22. Apr 06, 00:09

Lethal Mitch, if you make the changes dearest Naffarin mentioned, and then set your prices for the weapons to one above average, it should do what you want. It'll buy in, but won't be able to find anywhere to sell.

Lethal Mitch
Posts: 423
Joined: Sat, 27. Dec 03, 18:11
xr

Post by Lethal Mitch » Sat, 22. Apr 06, 05:18

Tehfreak says;
Lethal Mitch, if you make the changes dearest Naffarin mentioned, and then set your prices for the weapons to one above average, it should do what you want. It'll buy in, but won't be able to find anywhere to sell
Thanks for that, I never thought of it that way. I do agree that the buy low/sell high bit would be an unfair advantage from your own dock/station so I dismissed it totally. But the way you suggest, would stop the buggers selling.

Dropbear1967
Posts: 29
Joined: Sat, 27. May 06, 07:26
x3

Post by Dropbear1967 » Sat, 24. Jun 06, 03:00

Hi there..

Fabulous script, I'm using it with all of my stations!.. The majority of the time it works wonderfully, but I'm having a problem with the transports that buy resources for a station not filling up a full load.

ie: I have a big complex which produces shields/weapons etc and a "feeder" complex which produces energy/meatsteaks etc. The transports that are assigned to the shield/weapon complex buy goods from the feeder complex, but only small amounts (say 300 energy at a time). I have a couple of transports assigned to the station but they are not keeping up with the demand.


The "feeder" station has stocks of well over 10,000 units of the products that the producer needs BTW - so it's not low on stock.

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

Post by Naffarin » Sun, 25. Jun 06, 09:43

Support for this script is discontinued due to problems with the starforce copy protection along with some severe dataloss due to a sudden reboot. I will return to the x community as soon as the publisher decides to use a customer friendly copy protection.

I recommend using the commercial agent software available in this forum or in the level 3 devent section which is in my opinion the very best available trade software currently.

@Mods: Thread may be closed

Lethal Mitch
Posts: 423
Joined: Sat, 27. Dec 03, 18:11
xr

Post by Lethal Mitch » Sun, 25. Jun 06, 18:25

That's a real shame Naffarin, though I respect your reasons.

This script has always been my first choice.

The Commercial Agent is good I agree but conficts with the Anarkis Carrier commands which I use a lot.

Post Reply

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