[SCRIPT] Maintain Ware Quantity V2.0- was Maintain Product Quantity - X3 - 2007/08/09

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

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

Post Reply
B-O'F
Posts: 724
Joined: Sat, 21. Feb 04, 02:15
x3tc

[SCRIPT] Maintain Ware Quantity V2.0- was Maintain Product Quantity - X3 - 2007/08/09

Post by B-O'F » Mon, 22. Jan 07, 23:06

Update - 2007/08/09
V2,0 and a name change
- it now runs on a ship docked at another ship

Now works on a ship as well as a station.

I had to change this to run two different scripts, using one command slot - selection is automatic, depending on the homebase set.

The command does not display for the playership, and only displays for other ships once a homebase has been set.

If the homebase is a station, you select the ware to maintain, and the quantity you wish to maintain - entering '-1' will automatically set the maximum that the station can contain.

If the homebase is a ship, you have to first select the homebase ship, then the ware, and then the quantity (-1 does not work here). Sorry about having to select the homebase ship, but there is no other appropriate command available.

Command slot etc. is the same as before.

Installation.
Uninstall Maintain Product Quantity before installing this version - old files were 'setup.cmd.maintprod' and 'ship.cmd.maintprod'

--- End of updated info

This is an updated version of the old X2 script by Reven in his Scripting Tutorial.

I have made one change - you are now allowed to select the ware to maintain.

Description:

This script runs on a ship docked at a station (factory, equipment dock, trade dock or HQ) and will try to maintain a constant amount of a ware.

You select the ware and the quantity to maintain.

If the amount of ware available is greater than the set quantity, the ship will store it in its cargo bay.

If the amount of ware available is less than the set quantity, the ship will transfer the required amount back to the station.


Usage:
Trade - Maintain Product Quantity,
Select the ware,
Enter the required quantity,
Go away and do something else.

The ship must have the station set as its homebase; it must be capable of carrying the ware; it must have some free cargo space.


It can be used at a shield factory, for example, so you can collect a larger amount than the station would normally handle - either to supply a lot of ships, or for sale elsewhere.

It can also be used for resources - so you can get a very large amount at a very cheap price and gradually use it.


Uses:-
Trade Command 39
Page id 8894
Text id 8894

It is available as a .zip package containing the files and the .spk version
Courtesy Xai Corporation

Enjoy,

Boron - Ol Fh'art
Last edited by B-O'F on Fri, 10. Aug 07, 00:01, edited 1 time in total.
Public Service announcement

Growing old is not a disease - it is a delayed symptom of birth trauma.

draffutt
Posts: 4292
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt » Tue, 7. Aug 07, 22:31

if i set a fighter (for excample) homesbase to my M7 ((which has over 1000 cargo space free at the moment) another example) i get a script input null (for goods selection) and a report in the log stating something to the effect "not enought cargo space to hold any null"
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes

B-O'F
Posts: 724
Joined: Sat, 21. Feb 04, 02:15
x3tc

Post by B-O'F » Wed, 8. Aug 07, 00:38

Hi again draffutt,

You are having fun breaking my scripts, aren't you...

Well, this script was written to maintain wares at a station (factory or dock) - and uses station-related commands to get the ware. It is an updated version of an old X2 script... It was never meant to work on a ship.

Having said that, there are no checks in place to stop it showing when docked at a ship...

There are two ways to go from here:-
1) I add the checks and grey out the command when the homebase is a ship - fairly quick to do, but limiting.
2) I re-write the script to allow it to work correctly when used at a docked ship - more work, but possibly more useful.

I have already re-written this script for my own use to maintain multiple wares at a selected percentage (only for stations) - but I am using StorBays with a very large cargo bay... and I believe that it could be re-written to work when docked at a ship, but this needs checking..

Is option 2 more to your liking?

Boron - Ol Fh'art
Public Service announcement

Growing old is not a disease - it is a delayed symptom of birth trauma.

draffutt
Posts: 4292
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt » Wed, 8. Aug 07, 00:50

option 2 would be much better. thank you.
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes

B-O'F
Posts: 724
Joined: Sat, 21. Feb 04, 02:15
x3tc

Post by B-O'F » Wed, 8. Aug 07, 01:10

Hi draffutt,

O.K. option 2 it is - but it will take a little time...

Boron - Ol Fh'art
Public Service announcement

Growing old is not a disease - it is a delayed symptom of birth trauma.

draffutt
Posts: 4292
Joined: Wed, 21. Feb 07, 17:46
x4

Post by draffutt » Wed, 8. Aug 07, 17:31

no rush. i know you are busy with your other projects.
None of us is as smart as all of us. ~Ken Blanchard

TC player bug fixes
Reunion player bug fixes

Greedy_Bastard
Posts: 90
Joined: Wed, 4. Oct 06, 02:56
x3

Post by Greedy_Bastard » Thu, 9. Aug 07, 04:04

Will it also go and pick up/buy the wares from another station. for example i will eventually re-set up my complex for ship construction next 2 my HQ, if the HQ ware of choice runs 2 low will it go 2 the complex and deiver them 2 the HQ.

Thx in advance.
I bet you $25 that im greedier than you and ill prove it to you in 5 languages:
English: I love Money
Spanish: Amo el dinero
French: J'aime l'argent
German: Ich liebe Geld
Russian: Я люблю деньг
Now you owe me $25

B-O'F
Posts: 724
Joined: Sat, 21. Feb 04, 02:15
x3tc

Post by B-O'F » Thu, 9. Aug 07, 15:32

Hi Greedy_Bastard,

Sorry, that is not the intention of the script. The ship running the script stays docked at its homebase.

It works as a reservoir at a factory (or dock) so that you can keep a fairly constant amount available...

If it is a ware that you are producing, then it will store the excess units until there is a market for them - or you have built enough for your purpose.

If it is a product that the factory consumes, then it allows you to buy large stocks when the ware is cheap......

Used on a Trade Dock or Equipment Dock, then you can have more of a ware than the standard storage amount - handy for equipping ships...

Boron - Ol Fh'art
Public Service announcement

Growing old is not a disease - it is a delayed symptom of birth trauma.

B-O'F
Posts: 724
Joined: Sat, 21. Feb 04, 02:15
x3tc

Post by B-O'F » Fri, 10. Aug 07, 00:03

Hi,

Script has been updated and renamed - it now allows a ship as a homebase...

Boron - Ol Fh'art
Public Service announcement

Growing old is not a disease - it is a delayed symptom of birth trauma.

Greedy_Bastard
Posts: 90
Joined: Wed, 4. Oct 06, 02:56
x3

Post by Greedy_Bastard » Fri, 10. Aug 07, 20:41

o well. still simplifies the ship prouction capabilities. i can always use superfreighters which hold enough wares.
Thx 4 reply
I bet you $25 that im greedier than you and ill prove it to you in 5 languages:
English: I love Money
Spanish: Amo el dinero
French: J'aime l'argent
German: Ich liebe Geld
Russian: Я люблю деньг
Now you owe me $25

Post Reply

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