[Script] Trading Station Deluxe / Warehouse v1.08

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

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

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

[Script] Trading Station Deluxe / Warehouse v1.08

Post by Gazz » Thu, 5. Apr 07, 21:50

Das entsprechende deutsche Topic ist hier.

Regular Trading Stations are nice. Alas they fall short because Free Traders do not shop there and their storage capacity is far too small for reasonable profit$.

Shall we...?

What the script does
This is a station script.

A factory is cleared of all manufacturing equipment and turned into nothing more than a warehouse.
Production is no longer possible in this factory.
Running this script on a "real" 30MCr Trading Station is pointless.

Since Factories come in 3 sizes, you now have a choice.
An L-sized Fab can store no less than 40 GPPC or 16000 Mosquitos.

This factory can be used in three ways.
Depot: Ships, including Free Fraders, deliver wares like weapons and shields.
Warehouse: The factory is used exclusively as extended storage space for the finished goods of your other factories in a complex.
Automated Sales Office: This creates a sales point for your goods in remote areas of the universe where your wares are bought by Free Traders.


Download . . . Trading Station Deluxe / Warehouse . . . ZIP and SPK


Wares Management
Energy Cells are always storable.

There is no direct order to add or remove a Ware manually but this works automatically instead.

When the script is started, all wares with a stock of 0 will be removed.

This script works closely with the Commercial Agent (CAG).
When an active CAG has at least 50 pieces or 500 cargo units of a ware on board, this ware is added to the station's list.

Adding one or more new Wares works by sending the CAG to where these wares are produced to buy some.
Restart the CAG script and the home base is configured to work with the new wares while the CAG is still on the way back.


Mode: Warehouse
All wares that were added via the Wares Management are treated as products.

If you would like your weapons factory to have a larger storage area you would not add 5 more highly expensive weapons factories but... a cheap warehouse. At least that seems logical to me.
The factory will not fill up anywhere as quickly but keep producing.

The station's name must contain "Warehouse" when the script is started.

The script terminates itself (not the factory =) when the factory is connected to a complex.


Mode: Depot
All wares that were added via the Wares Management are treated as resources.

This allows for easy creation of a fleet support depot since you can use your favourite station supply script to collect these "resources".
Unlike with a regular Trading Station the buying price is not also a selling price since resources are not sold.
This station only collects things for you.

You might place a small Depot for 25 MJ shields and jump fuel next to your favourite shipyard for instance.
If a shield factory is close then you don't even need a dedicated freighter in that station but can count on Free Traders to supply it.

The station's name must contain "Depot" when the script is started.

The script terminates itself when the factory is connected to a complex but I see no reason for wanting to do that.


Mode: Automated Sales Office
(This is what the script started out as. =)

As you already know, selling certain wares (like drugs) is easy. Distributing them is not.

Creating many small production complexes everywhere you want to sell these items is a lot of work and not efficient. A complex that meets the maximum local demand must be oversized for this area and will either run idle or empty.
There will also be a lot of vulnerable freighter traffic unless you make every one of those small complexes self sufficient which again, is not very efficient.

On paper, the Trading Station is perfectly suited to fulfill the role of a distributing station. Alas, it's tiny cargo capacity does not allow real profit$.

Image These are the kind of sales you want. 1.3 million Cr cash from a single sale.


Automated Sales Office: Features
This is a station script.

Prices are set automatically so free traders will come and buy your goods.

A Commercial Agent (CAG) (from the Bonus Pack or the appropriate forum thread) is required to supply this office.
The CAG must be level 4+ (Freighter pilot 2nd class ) because trading with intermediate products is required.
Using a jumpdrive is recommended when supplying the Sales Office with wares from a remote production facility.

All CAG of the sales office are automatically configured for this special task.
(Add another Thank You for Lucike's awsomely configurable CAG. =)

Automated Sales Office: Advantages
Instead of many small complexes all throughout the universe you can have a huge centralized production complex that is easy to plan, maintain, and expand.
You can have several production complexes. The CAG will buy anywhere in the station's jump range.
Fluctuations in local demand do not affect your average sales since all sales offices are supplied equally.
A production increase of the central facility directly transfers to all offices.

The central production facility acts as a huge buffer to avoid individual complexes over- or underproducing.

The number of free traders that would shop with your offices is limited. The Trading Station Deluxe allows far bigger sales to each individual trader (see the screenshot) and instead of waiting for a small local complex to produce back up to full, the CAG will fetch a new full load of goods immediately, maximizing the sales in this region of the universe.

Since only finished goods are transported over long distances, smaller, cheaper, and faster (=safer) TS can be used.

Placing sales offices only requires you to build one factory without any kind of supporting infrastructure.
This is quick and far cheaper than inferior Trading Stations.

All prices are adjusted automatically so all you need to do is build the station, attach the CAG, supply Credits, and start the script.

Your production complex can be set to not trade with other races which keeps civilian traffic out of your docking bays. They will be busy enough with your own traders.
This removes a very annoying bottleneck.
If you still want to sell in the same sector... just place a sales office right next to it. The cost is trivial compared to a production complex.


Automated Sales Office: Usage
A factory that you want to refit for this purpose must not be part of a complex but can be attached to another Sales Office afterwards.

Several refitted factories can be combined into a complex after the refitting took place in every single factory.
The only advantages of it being tied into a complex with another Sales Office is if you wish to further increase the already high storage capacity or have 10 docking bays instead of the usual 5 for a single factory.
The storage capacity of a single L Fab is enormous but you might want to attach a smaller Sales Office for high priced wares only in order to keep the stock level managable.

If you combine several sales offices into a complex then you must also start the station script on the complex hub afterwards.

It is not allowed to mix Sales Offices with producing factories in a complex. This will simply not work.

The selling price in the sales office is set 0.2 % or a minimum of 1 Cr below average.
Resources other than EC are not bought.
Your production complex can sell at minimum price which means that your CAG will always prefer it over any other supplier.
Be sure to set trading with other races to off in the producing factory before you set the price to minimum.

Note that a sales office needs a lot of starting funds since all wares are bought.
For an L-sized space weed or fuel seller, about 1.4 million credits are recommended to remain in the office.

Any CAG that is configured to work with the Sales Office is set to not fly around and sell those wares.
You are allowed to change that by manually configuring the Sell Products % value for this trader after the configuration took place.
The reason to not allow selling is that if your own freighters supply the target stations, free traders can not see this trade oppurtunity and you risk your own freighter while flying around in potentially hostile space.

Refitting a factory or complex hub costs a one time fee of 50.000 Cr.
Closing the office for more than an hour will require an additional 5.000 Cr if you decide to reopen this business.


Version History
1.08 : Apparently debug was still enabled in the 1.06 release. Oops.
Potential bug (unable to reproduce) fixed that would delete wares with stock > 0 from a station.

Resources used:

Textfile: 7023
Task ID 7023 on the station
Command slot: COMMAND_TYPE_STATION_54
Last edited by Gazz on Tue, 24. Apr 07, 21:47, edited 2 times in total.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
KayEss
Posts: 96
Joined: Sun, 3. Sep 06, 16:52
x4

Post by KayEss » Thu, 12. Apr 07, 06:34

What sort of factories do I need to buy to use for this?

Will any factory be able to store any product or do I need to buy factories that actually have them in the resources or the products?

RaGodofTehSun
Posts: 417
Joined: Thu, 23. Dec 04, 04:02
x3

Post by RaGodofTehSun » Thu, 12. Apr 07, 07:46

This will be of great use when i start over as a Bandit King! thankyou! :D
Image

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Thu, 12. Apr 07, 12:02

KayEss wrote:Will any factory be able to store any product or do I need to buy factories that actually have them in the resources or the products?
Any factory will do. All manufacturing equipment is dismantled so in the end it doesn't matter what the empty shell once contained.

I prefer physically small factories over large things like wheat farms.
Less problems with drunk freighter pilots that way.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Ska Trek
Posts: 107
Joined: Thu, 19. Feb 04, 04:09
x2

Post by Ska Trek » Mon, 23. Apr 07, 01:47

I attempted to turn my Equipment Dock into a Warehouse, but I only have the option for "Sales Office" did I misunderstand something?
X3 is pretty.

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Mon, 23. Apr 07, 11:45

Probably. There is only 1 button for all modes.
Using several command buttons for something trivial like that would be very bad style.

The station's name controls how the script uses it. That's in the first post - that line in bold.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Ska Trek
Posts: 107
Joined: Thu, 19. Feb 04, 04:09
x2

Post by Ska Trek » Mon, 23. Apr 07, 19:54

All of that I had read anyway, it's just that I've labelled it with warehouse in the title, ran the script, it added $$ to the end, but I still can't add more than 2 1GJ shields to it, the wares are listed in the Add/Remove screen, and I have a CAG max-level hooked up to supply it, but even manually I can't transfer any more wares.

Perhaps I'm just being thick, shoes must be on too tight :

Edit: Tried Depot too, but all that done was eat the wares I had stored previously and still won't allow more than 2 Lastertowers or anything big
X3 is pretty.

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Tue, 24. Apr 07, 18:22

The storage capacity is hardcoded and only depends on what kind of station you placed there.

"2 1GJ shields" suggests that you built one of those expensive but largely useless Trading Stations.
Try an L-sized factory instead, something like a Cahoona Burger Grill L or whatever they are called.

Wheat farms and the likes are usually cheapest but they don't look right with those huge fragile wings extending. I prefer my "TS" small and compact but it's only for optical reasons.

These cost only a fraction of a "real" TS and have serious advantages wrt AI trader behavior.
Ska Trek wrote:Tried Depot too, but all that done was eat the wares I had stored previously
Oh, not good.
The script does remove all wares from a factory when started but is supposed to leave the ones that have any stock. At least that was my intention. =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Ska Trek
Posts: 107
Joined: Thu, 19. Feb 04, 04:09
x2

Post by Ska Trek » Tue, 24. Apr 07, 19:44

It wasn't a TS but was an EQ, I guess the same applies. Oh well, only several million down the drain :) I wansted something that a M1/2 could dock at you see, pipe dreams :P

Thanks for the script anyway dude, we all appreciate the effort scripters put in. I'll still be putting up depots in the far reaches once I have.. reeducated some sectors to my way of thinking.
X3 is pretty.

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Tue, 24. Apr 07, 20:52

There is a workaround for this so don't put that pipe away, yet.

You can have a TS Deluxe with (expandable) cargo capacity that an M1 can dock with.

With Ashleys Factory mod you can not only build XXL Fabs but also get an extended Hub with big ship docking capacity.

If you set up a depot with the exact wares you want and then connect it to some dummy factory with this super hub then the resulting complex would have the wares you want and would already be set up to work as a depot.

The drawback is that connected factories can not be altered very well so the depot would not be able to dynamically add wares and it would be pointless to run the script on it.
You could only set it up and use "as is" for as long as the complex exists.

Not ideal or pretty but it would be a way to create an "all inclusive" equiping station for newly built cap ships.
If you connect say, both an M and L sized depot into a complex you can also configure them for different wares.
The M station might carry shields so few are kept in stock while the larger (or both) station carries weapons or missiles, which you need in higher quantity.

Result: A station that automatically collects all the stuff you want or need for your big ships and that said big ships can simply dock with after they leave the PHQ shipyard.
In my current game I haven't build the PHQ, yet, but I will have a depot like that right beside it. =)

Hmm. Actually that would be pretty cool just for having stations that automatically stock up on 20000+ EC so your M2 can jump and dock there for refueling and pick up mass driver ammo or whatever you fancy without any additional detours.

While an equipment dock can (I think =) carry EC, it's capacity is sad.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Ska Trek
Posts: 107
Joined: Thu, 19. Feb 04, 04:09
x2

Post by Ska Trek » Tue, 24. Apr 07, 21:13

Hmm, sounds interesting.. one other question I have, the script seems to be sending me many many messages, crashes my game when I try to view them, after emptying it there are instantly about 5 or 6, any way to disable that?
X3 is pretty.

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Tue, 24. Apr 07, 21:29

Sorry, sounds like I was being my perfectly normal chaotic self and uploaded a version with debug still enabled.

Version 1.08 released.

* Debug off (really really sure now!)

* Have not been able to reproduce it but there might have been a case where the starting script would delete wares from the station even if there was a stock > 0.
I think I fixed that but alas, I did not see it happen before so it may or may not work now.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

blackfire83
Posts: 584
Joined: Tue, 13. Jul 04, 13:03
x3tc

Post by blackfire83 » Sun, 2. Dec 07, 03:31

Does this encourage NPC free-traders to actually purchase your goods? What annoyed me in my last game was that my goods never seemed to sell unless I used my own selling freighters, and they require constant baby-sitting. My current game is currently all Space Fuel Distilleries so I don't have to have seller ships. If I use the Automated Sales Office for OTHER goods, will I get free-traders stopping by?

-blackfire83
Count the bodies like sheep to the rhythm of the war drums...

X3:TC - Battlemaster, Master Industrialist

suntox
Posts: 25
Joined: Fri, 5. Sep 08, 23:04

Post by suntox » Sun, 21. Sep 08, 21:44

i dont seem to get it working.

i bought a cattle ranch L. renamed it to Warehouse. activated the script and it gets renamed to Warehouse$$. told a mercury its his new homestation. activated cag on it and sent it to buy lasertowers.

it docks on the lasertower fab but doesnt buy any, instead goes and docks with the warehouse. also adding lasertowers to the cag via teleporter doesnt help (also with restarting cag afterwards).

the factory still shows agnu beef as product and no lasertowers. am i doing something wrong or it doesnt work with 2.5 or any of the other scripts i got?

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Sun, 21. Sep 08, 22:40

To be honest - this script is well over a year old and I have no idea if it even works at all with the current CAG.

Maybe I will look into it some time but not right now.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Post Reply

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