[SCR] Cargo Delivery Service 2.02 : 03/02/09

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

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Sat, 31. Jan 09, 13:45

Where is the ship homebased ? That probably effects what it can see.

DonFü
Posts: 3
Joined: Sat, 31. Jan 09, 13:08

Post by DonFü » Sat, 31. Jan 09, 13:57

Hm... I think I just got the problem. Crystals, micro chips and those quantum things are not listed as wares in the HQ!? Maybe the HQ from the Marodeur is broken or i've messed something other up.

Sorry to bother, script works just fine :wink:

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Sat, 31. Jan 09, 14:39

You may need to manually put one of each on the HQ to get them listed there.

User avatar
klaatu
Posts: 316
Joined: Fri, 21. Nov 03, 17:23
x4

Post by klaatu » Sat, 31. Jan 09, 17:30

Yes, you'll only see wares listed that the other station/ED/HQ/etc. has in it's list of wares. So add one of the ware you want to haul from the station to the HQ, then try it.

The homebase of the freighter makes no difference at all. It can be set anywhere, or nowhere and it wouldn't matter in the least to CDS.

As a sidenote, I've been thinking about changing the way wares are loaded. Currently it waits untill it's about to head to the other station before loading the wares. I think certain things would work better if I changed it to load whatever wares the station has in stock (not counting the reserve, of course) every minute or so, then check to see if it should head to the other station. This way you could load many times the station's entire stock size into the freighter if you wanted. As it is now the most you can haul is whatever the size of the station's maximum stock is.

Can anyone think of any cons to making this change?

Hieronymos
Posts: 830
Joined: Fri, 30. Dec 05, 22:14
x3

Post by Hieronymos » Sat, 31. Jan 09, 21:43

Klaatu,
great script. Perfect for non-closed loop complexes, and especially for the PHQ.

Only downside I can see is possibility of freighter clogging up over time with one ware, preventing carrying of any other(s), if the production:consumption ratios of served fabs/complexes is not equal.

Your current rule: "the most you can haul is whatever the size of the station's maximum stock is." is probably the best solution to this.

But doesn't scale particularly well if freighter is small, and served complex is huge (with huge max stock levels).
............

Does this script also serve multiple freighters serving same fab<--->mine??

Or serve multiple freighters serving same complex, but different secondary fabs/mines?

User avatar
klaatu
Posts: 316
Joined: Fri, 21. Nov 03, 17:23
x4

Post by klaatu » Sat, 31. Jan 09, 22:47

Hieronymos wrote:Only downside I can see is possibility of freighter clogging up over time with one ware, preventing carrying of any other(s), if the production:consumption ratios of served fabs/complexes is not equal.
This shouldn't happen. The freighter should not load any more than the other station can accept. This includes any stock of that same ware it might already have in it's hold. So while it may not be able to completely unload all its current cargo at the receiving station, when it goes back to get more it'll take into account how much it may already have in its hold before loading more.
Hieronymos wrote:Your current rule: "the most you can haul is whatever the size of the station's maximum stock is." is probably the best solution to this.
Actually the rule is more like: "the most you can haul is whatever the other station can take", but because it waits to load until it's ready to go it can't take any more than the current station can stock. If I were to change to loading on-the-fly, so to speak, the freighter could indeed load up more than that, but it still wouldn't load more than it could unload at the other station.
Hieronymos wrote:But doesn't scale particularly well if freighter is small, and served complex is huge (with huge max stock levels).
Not sure what you're getting at here. Could you elaborate? It seems to work OK for me if the hauling freighter is, for instance, a disco with 67 units of cargo servicing a pretty good size complex.
Hieronymos wrote:Does this script also serve multiple freighters serving same fab<--->mine??

Or serve multiple freighters serving same complex, but different secondary fabs/mines?
Well, you can certainly run it on more than one freighter servicing the same route. A single CDS freighter does not pay any attention to any other freighters or what they may or may not be doing. So if you do set up two freighters with the exact same stations and wares (or different second stations and wares even) it should work alright I would think. Only one's going to be able to grab the stock once it's there to grab of course.

Hope this help, and glad you like it.

Hieronymos
Posts: 830
Joined: Fri, 30. Dec 05, 22:14
x3

Post by Hieronymos » Sun, 1. Feb 09, 05:37

Thanks for quick reply klaatu.

If CDS vessel is transporting multiple, perhaps bulky, wares from from 2 complexes to each other (e.g. ore & silicon<----->ecells & beefsteaks & soja), your loading formula still produces no clogs??? (I'm thinking here of ST's clogged with wares, without room for more cargo..)

In my weird way, I'm just trying to see how un-fu**-uppable your script is :) , if you know what I mean. I'm thinking yours might be the TC replacement for RedSpot's excellent X3R delivery script, but want to be sure!

EDIT: Think I just answered my own question. If target facility can't accept more wares, for any reason..CDS won't load them.
If target fac. has a problem after CDS loads, then there might be a problem..but then it wouldn't be CDS's fault.

Razman23
Posts: 195
Joined: Sat, 12. May 07, 19:29

Post by Razman23 » Sun, 1. Feb 09, 14:54

Can this work with a TL as one of the stops?

Of course, having the transporter installed on the ship would be a given. :wink:
Raz

richardh
Posts: 67
Joined: Thu, 4. Dec 03, 00:17
x3

Post by richardh » Mon, 2. Feb 09, 12:59

Just an idea...

The script seems to look at the destination station too, to see what it can accept. Try manually trucking and loading one unit of whatever you want into the destination HQ, so it's "on the books" as a ware. Then try the cargo delivery script config...

Rich

User avatar
klaatu
Posts: 316
Joined: Fri, 21. Nov 03, 17:23
x4

Post by klaatu » Wed, 4. Feb 09, 04:09

Razman23 wrote:Can this work with a TL as one of the stops?

Of course, having the transporter installed on the ship would be a given. :wink:
Sorry, no, it can't. Player-owned factory/complex/ED/etc. to another player-owned factory/complex/etc. only. Not a bad idea though, but don't know how well it would fit in with the idea of this script.
richardh wrote:The script seems to look at the destination station too, to see what it can accept.
Right. That's why you have to set both stations before you can select what product(s) to haul; any product selected must be a tradable ware at both stations.

It keeps an eye on both stations as it works too. If it's trying to load product at the current station to get to the minimum, but the other station already has enough stock to make the minimum and the current station can handle that amount, the freighter will head off back to the other station even though it hasn't reached the minimum yet. This prevents what I call a deadlock in case the current station is not producing any product because of lack of the product from the other station.

I went ahead and implemented what I talked about previously, which was loading any available product every minute or so. Seems to work well as far as I can see. Doing it this way too prevents some other freighter from snatching up all the product before the CDS freighter can.

I also cleaned up the code somewhat and improved the error checking for like when you change stations it should now set the ware to haul to nothing if it's not valid for the new station combo.

See first post for new version.

Hieronymos
Posts: 830
Joined: Fri, 30. Dec 05, 22:14
x3

Post by Hieronymos » Wed, 4. Feb 09, 06:56

So what's next klaatu?

What I'd like, personally:

:arrow: XaiCorp NOS (Navigation Override System)-like logic to have CDS ships steer well clear of hostiles.

:arrow: Naffarin's Station Trader v1.25a was my fave station trader script for 3R. Could never get into Lucike's work. Besides, mod playing and libraries make a bad combo. A lot of your CDS logic seems like it'd work well for a station buy/sell script.

Doesn't hurt to ask, right? :)

richardh
Posts: 67
Joined: Thu, 4. Dec 03, 00:17
x3

Post by richardh » Wed, 4. Feb 09, 10:47

klaatu wrote:As a sidenote, I've been thinking about changing the way wares are loaded. Currently it waits untill it's about to head to the other station before loading the wares. I think certain things would work better if I changed it to load whatever wares the station has in stock (not counting the reserve, of course) every minute or so, then check to see if it should head to the other station. This way you could load many times the station's entire stock size into the freighter if you wanted. As it is now the most you can haul is whatever the size of the station's maximum stock is.

Can anyone think of any cons to making this change?
I like it. Will be useful when storing stuff like Microchips. You've really got to wonder how a Chip Plant, a massive chunk of high-tech fabrication hardware floating in space, is incapable of storing more than a handful of the darn things. PUT THEM IN THE HALLWAYS! STACK THE BOXES IN THE MEN'S ROOM! My local Tandys outlet has more microchips than those factories can store. Sheesh.

So the idea of a parked freighter loading 'em up automatically? Great!

Rich

WildAce
Posts: 356
Joined: Thu, 2. Nov 06, 18:06
x4

Post by WildAce » Thu, 5. Feb 09, 01:54

this script is nice, its going to make my multi sector complex so much easier to manage.

atm ive got the silicon/ore/crystal/food fabs in one sector but the SPP are in the one next to it because of the higher Sun % was very annoying i had to have my crystal plex buy energy from the same SPP it was supplying the crystals to in the first place. so basicly money was just sitting there going back and forth between the stations for no real reason.

DJ Aitch
Posts: 142
Joined: Fri, 6. Feb 04, 19:57
x4

Post by DJ Aitch » Fri, 6. Feb 09, 14:26

Great script, I've been looking for something simple like this for a while. Most of the alternatives are too cumbersome and include many superfluous commands which complicate things.

I'm looking forward to installing this tonight and sorting out some of the micromanagement issues I currently have.

A question/suggestion I have would be to have an option to specify how many of a certain ware to collect. I am thinking in terms of supplying the PHQ with the wares needed for production. It would be good to be able to set an upper limit so the trader doesn't fill all my PHQ space with e.cells so I've got no room for other wares.

Is that a simple addition and more importantly would you be willing to add it? :wink:

richardh
Posts: 67
Joined: Thu, 4. Dec 03, 00:17
x3

Post by richardh » Sun, 8. Feb 09, 11:29

I'm now using this all over the place, and great. Cheers!

One possible config setting that would sometimes be useful...

There is logic to make the freighter cart "only as many units as the destination station can hold". It would be great if this could be switched on or off as required (default "on" would be fine).

The reason...

I've got a Trading Station as a distribution point for a certain hot-selling item... but it can only stock 166 units. My factory is in another sector, and has heaps of the stuff. I've got a freighter using CDS loaded up and waiting in the factory, for someone to buy from the trading station. If someone buys 20 units, that's all the freighter takes. But then, as soon as it's left, another buyer takes all the rest. Freighter takes its own sweet time arriving, and only has 20 units to put back on the shelves. Result: losst profitssss.

With this "only ship required amount" setting OFF, the freighter would ship "The Minimum Cargo Space Percentage" as already exists in the CDS config, without regard to the available space at the destination.

With the setting on, it would act as it does now.

Thoughts welcome...

Rich

Hieronymos
Posts: 830
Joined: Fri, 30. Dec 05, 22:14
x3

Post by Hieronymos » Tue, 10. Feb 09, 23:55

DJ Aitch,
it always seemed best when supplying PHQ with materials to construct a complex producing exactly the right ratio of components. Then let yr fave CDS script shuttle the stuff over.

But perhaps Klaatu's excellent script can adapt to supplying PHQ from a mismatched set of fabs/hubs??

User avatar
klaatu
Posts: 316
Joined: Fri, 21. Nov 03, 17:23
x4

Post by klaatu » Wed, 11. Feb 09, 07:21

DJ Aitch wrote:A question/suggestion I have would be to have an option to specify how many of a certain ware to collect. I am thinking in terms of supplying the PHQ with the wares needed for production. It would be good to be able to set an upper limit so the trader doesn't fill all my PHQ space with e.cells so I've got no room for other wares.

Is that a simple addition and more importantly would you be willing to add it? :wink:
It's basically already in there. Use the docware manager script to set stock limits on the wares in your PHQ and the CDS freighter will honor those limits.

Wolf-R1
Posts: 384
Joined: Thu, 27. Jul 06, 04:30

Post by Wolf-R1 » Thu, 12. Feb 09, 03:37

I've been looking for something like this for a while however I have a slight problem. It conflicts with the Freight Distribution Network http://forum.egosoft.com/viewtopic.php? ... highlight=. I've been using FDN for a bit now and have need of the kind of script you've written however when I install it I can no longer land anything at the FDN node. Any ideas why?

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Thu, 12. Feb 09, 10:31

Conflicts in what way ?

readtext errors ?

User avatar
klaatu
Posts: 316
Joined: Fri, 21. Nov 03, 17:23
x4

Post by klaatu » Thu, 12. Feb 09, 16:37

I don't see anything in the command slots or text ids or page ids (as listed in the script & mod download library thread) that would conflict, and as far as I know those are the main ways one script could conflict with another. If there are others I'm not aware of them.

Please give more details. I don't use FDN myself so I don't know what this "FDN node" is supposed to do, but if the game treats it as a standard player factory/complex then CDS should work fine with it.

Post Reply

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