[Script][Mar/13/2009]Station Storage Extension

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

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

Posts: 182
Joined: Thu, 15. Dec 05, 23:02

[Script][Mar/13/2009]Station Storage Extension

Post by Tim-O » Fri, 13. Mar 09, 01:09

Station Storage Extension (SSE) v beta.02


The Station Storage Extension allows to use the cargo bay of docked ships to extend the stations' storage capacity. Ships that are docked to the station and have it set as their homebase can be turned into storage extensions. They are then used to store wares if the stations' cargo bay usage exceeds a certain amount. If the station runs out of the ware at a later time, the amount stored in the extension ships is used to back it up.

The Station Storage Extension is located in the Station Command Panel. You recognize it by the yellow color.

I've discontinued the development of this script, but I've uploaded it to GitHub to make it easier for others to continue working on it. You can find the GitHub project here: https://github.com/merlinthered/plugin. ... .extension

Minimum Requirements:
A station and a docked ship with the station set as its home base.

Copy the contents of the "scripts" folder into X3 TC\scripts
Copy the contents of the "t" folder into X3 TC\t

Copy the contents of the "scripts" folder into X3 TC\scripts
Copy the contents of the "t" folder into X3 TC\t
The script will only notify you if it is currently running on a station and has to be restarted (this will be done automatically). However, you can see the current script version in the upper right corner of the main control panel. So there is where you should look to determine if an update was successful.

Open a Storage Extension Control Panel in the game.
Select the bottom item "Uninstall" and answer the following safety question with "Yes".
Wait until the script tells you that uninstallation has been completed.
Quit X3.
Remove all files of the script from the folders "scripts" and "t" (see "Used Resources")

Fed up with the small cargo bays of your stations and complexes? It's over now! The Station Storage Extension facilitates automatic transfer of wares to and from docked ships that have been registered with the Extenstion.
The settings allow for choosing upper and lower bounds for each ware in which the Storage Extension will try to maintain the stock. Over production is loaded into the extension ships and deficits are accounted for with the already stored cargo.
Every managed ware can be provided with preferred ships. These are then used first if some of the ware has to be stored, and last if a stock refill is necessary.
To add a ship to the list of extension ships it has to be docked at the station and have it set as its home base. You can then register the ship with the station in the "Manage Ships" section of the control panel. The ship will stay registered until it is either removed, destroyed or assigned to a different home base.
If you've got a station or complex with massive over production the Storage Extension can spare you much of the work required if you have to empty the stocks manually ever other minute or set up a complicated transport chain to a storage station. However, if the cargo bays of the extension ships should become too full at one moment the Station Storage Extension will warn you if you wish. You can set up seperate critical load levels for the cargo space of all docked extension ships and for the space used in the preferred ships of a single ware. If you really want to have a ware only in its preferred ships this will help you realize when an overflow is imminent.

The user interface of the Station Storage Extension should be quite intuitive to use since it was designed with that purpose in mind. Most of the windows have a descriptive text at the top that explains the settings. Just look and try and you'll understand everything quite fast. If there is any problem or unceartainty don't be afraid to ask in the script's thread in the forum.

Screen Shots:

Main Menu:

Ware Settings:
Image Image Image

Ship Settings:

Notification Settings:

Image Download as zip via GitHub
Image Mirror kindly provided by Mastersouleater

Used Resources:

Command Slot:

Language Files:
t\8223-L044.xml (page 8223)
t\8223-L049.xml (page 8223)

t\8910-L044.xml (page 8910) <-------String Library by ChemODur!! http://forum.egosoft.com/viewtopic.php?t=233377
t\8910-L049.xml (page 8910) <-------String Library by ChemODur!! http://forum.egosoft.com/viewtopic.php?t=233377

Skript Files:
scripts\lib.chem.strings.xml <-------String Library by ChemODur!! http://forum.egosoft.com/viewtopic.php?t=233377

Last edited by Tim-O on Sun, 9. Dec 12, 21:31, edited 7 times in total.

Posts: 182
Joined: Thu, 15. Dec 05, 23:02

Post by Tim-O » Fri, 13. Mar 09, 01:10


Mar 13, 2009: v beta.02

- Fixed a problem causing a freeze if a ship should unload a ware it had installed
- Fixed a problem causing "Unload and Stop" not to stop, when a ship had a ware installed it was supposed to unload

Mar 12, 2009: v beta.01

Initial Release

Posts: 16
Joined: Thu, 27. Sep 07, 15:28

Post by Kimius » Sun, 15. Mar 09, 20:03

just loaded this script, and it is awesome. i actually built a complex almost identical to the one in the screencaps before i found this script, and it seems to work quite nicely.

there does seem to be a bug in it though. i have four MSF docked at the complex hub, set to collect all the missiles and nothing else. as long as those freighters are filled with only managed wares then everything is fine, but as soon as i add some energy cells as jump fuel, which are not supposed to be managed, then any missiles transferred over to the freighters just get deleted. removing unmanaged wares from the freighers cargo hold makes it work again, but the deleted wares are gone for good.

Posts: 182
Joined: Thu, 15. Dec 05, 23:02

Post by Tim-O » Mon, 16. Mar 09, 14:10

I tried it with my missile complex that produces Hammers, Flails and Tomahawks. I have 5 Dolphin SF docked. I loaded each one with 1000 EC and only set the Missiles to be managed. None of the missiles had any preferred ships. Everything works fine for me. Can you tell me more about your settings (preferred ships, min/max percentages etc.)?

I really can't imagine how any wares could be lost in the process of transferring since I only use the "load" and "unload" scripting instructions, which should remove wares from a ship and add them to the station (or vice versa) in a single action. And they only transfer as much as possible to prevent destroying or creating cargo out of nowhere.

If I can't work it out by your settings the next step would be to turn on debugging. Do you have a little experience with using the script editor?

Posts: 16
Joined: Thu, 27. Sep 07, 15:28

Post by Kimius » Mon, 16. Mar 09, 18:13

all settings are default on the script, 20% low, 80% high on missiles, no management on the rest. four mistral super freighters docked and managed, default settings on the ships internal systems. filling up the first one in the list with 500 or so EC makes missiles start vanishing, removing them fixes the problem instantly.

i also have a bunch of other scripts installed, though none of them are active on the station. the ones i can see in the plugin manager are ATF shipyard, autoscan smugglers, community plugin conf, explorer command extension, marine repairs, npc bailing addon, salvage claim, universal best buy/sell and upgrade kits. off the top of my head there is also MARS, prospector and CAG. some residue of medusa is in there as well, since the removal didnt work all that great.

so there should be ample room for conflicts in there :p

using the script editor is not my specialty, but that shouldnt stop me from figuring it out. if there is something to be found in there, then just let me know.

Posts: 182
Joined: Thu, 15. Dec 05, 23:02

Post by Tim-O » Mon, 16. Mar 09, 19:03

Ok, i probably won't have time for testing it today. If you don't mind, try setting the Debug variable to TRUE in the following scripts:


Then save the game, load again and restart the Storage Extension on your complex/station. Make sure, this station is the only one with the script running. The Script will now log its actions into the logfile 9001 wich should be located in your My Documents/Egosoft/X3 TC folder. First, start the script with no EC in the freighters, let it run a little while, check out if everything works all right and then terminate the command.
Then, exit X3 (or Alt-Tab) and rename the logfile or move it somewhere else. Then do the same thing with EC on the freighters. Perhaps I can figure out the problem from the logs. (make sure that the missiles do actually disappear in the second case ;) )

Posts: 16
Joined: Thu, 27. Sep 07, 15:28

Post by Kimius » Wed, 18. Mar 09, 23:46

seems that i can't recreate the problem, so i will be running the debugging in the background for a while to see if it happens after a couple days worth of playing. for the time being though, the script apparently works as intended.

let's hope it stays that way :P

Posts: 167
Joined: Sun, 27. Apr 08, 04:56

Post by Rhadamant » Wed, 22. Apr 09, 18:31

Your script rocks. I was doing ship storage manually by hand before. This script is awesome because it automates a function done manually and it doesn't feel like a 'cheat' script. Nothing like having 15 mistral super freighters and 2 Terran Atmospheric Lifters helping to store my stuff!

Note: Yes, I am stockpiling for world war 4.

Posts: 182
Joined: Thu, 15. Dec 05, 23:02

Post by Tim-O » Wed, 13. May 09, 10:37

I'm glad you like it :)

User avatar
Posts: 376
Joined: Wed, 15. Apr 09, 22:50

Post by thiosk » Wed, 13. May 09, 18:53

I'm also running this script. I'm very happy with it, especially for the sale of weapons. I can load up a freighter completely, without having him galavanting around the galaxy trying to sell weapons here or there, and then jump him straight to terracorp with a full cargohold.

I like it!

I've also started stockpiling my microchips early.

Posts: 11
Joined: Tue, 1. Nov 05, 01:03

Post by edmanny » Fri, 15. May 09, 23:44

Hey Tim,

Thanks a lot for the script it's great.

If you have some free time :wink: here's an idea to try and improve it:

The conditions (min & max %) that determine if the ware goes in the ship or in the station are based on the station stock.

It would be nice if we could choose to do the opposite:
For each ware, set an amount limit. if the number of ware in the ship's cargo hold is < to the limit, the next wares goes in the ship's hold, if it is > to the limit, it stays in the station stock.

What do you think ?

Posts: 182
Joined: Thu, 15. Dec 05, 23:02

Post by Tim-O » Sat, 23. May 09, 00:20

You want to use it to automate ship equipping? To set an amount of wares each ship should get? Or to have the wares better distributed to the ships. Sounds interesting.
Does it collide with the "preferred ships" concept? What happens if a ware is set according to your proposal and that ware has certain preferred ships? Are the wares only delivered to these ships?
Another thought: What happens, if you set two wares to be filled into 60% of the docked ships' cargo hold. That makes a total 120%. Which ware is to be preferred? Or should such settings be impossible?

These are just some obstacles I could encounter when trying to implement your suggestion. Doesn't mean I'm not gonna do it ;)
I'm not playing X3 at the moment. Not much time. Perhaps I'll make some improvements to my scripts when I have a little more free time. Like in July or August. We'll see. Thanks for your suggestion anyway. I appreciate that.

Posts: 525
Joined: Fri, 13. Feb 04, 23:15

Post by Jeraal » Thu, 2. Jul 09, 00:22

I'm a little lost on the min/max% settings. If I have a complex that produces extra crystals that I want stored while leaving some in the complex, what would I set these to? If I have another product that I'm stockpiling(chips), how would I set it to store all of the product produced?
Never underestimate the power of stupid people in large numbers.

Brute force and ignorance solves all problems, just not very efficiently.

If brute force isn't working, then you aren't using enough.

User avatar
Posts: 123
Joined: Sat, 14. Jan 06, 02:32

Post by Makita » Thu, 2. Jul 09, 03:24

Can't believed i missed this little beauty, thanks for the bump Jeraal :)

Posts: 218
Joined: Sun, 1. Feb 09, 23:39

Post by zymurg » Fri, 17. Jul 09, 22:44

I have this installed and it is great. However, is it compatible with the recent 2.1 patch for X3 or will I have to re-install it or remove it?

Post Reply

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