
I'll see about getting it hosted somewhere sensible, but for now you can get it here:
http://www.comp.leeds.ac.uk/dharris/StationCom12.zip
V1.2
Fixed problem with item buyer that eventually caused script to hang
Repair now also checks for a jump drive
General fixes to improve performance
Changed Input Two (range) criteria to allow broader functionality
Input One: Select a shipyard. If you want a fixed shipyard, select it here. If not, the station you choose will just determine the race of the Station Commander. Note - you can not select pirates here.
Input two: Input a range.
0-98 : Any shipyard within this range will be considered for buying ships from (take care that this doesnt mean you have ships crossing hostile sectors!). Sometimes, certain contacts will allow your Commander to buy pirate ships - these will fly from an appropriate pirate base.
99 : If you want a fixed shipyard (ie the one you chose with Input One)
100-998 : Commander Lite - upgrades ships and buys new ones from the fixed shipyard, but does not send any out on patrol
999+ : Station Quartermaster - Only upgrades ships already in station. Does not buy new ones or send out on patrol
Input three: Minumum cash to keep in station. The Commander will use this to determine how much of the station's money they can use. This allows you to keep sufficient funds in a factory to allow it to remain operational.
Input four: Commander can sell Y/N. Y or y will allow your Commander to sell ships if given the opportunity. Anything else will mean they never do so.
V 1.1
Fixed compatibility with ACP problem
FIxed bounty hunter problem
V1.0
Readme text follows:
Station Commander
Uses command codes 724 (Warehouse management), 725 (Upgrade purchase), 719 (patrol), 718 (repair), 1126 (station commander). Should be compatible with all major scripts (except the Imperial console), although this has not been fully tested. Language file is 211.
Extract to a temporary directory and then copy all files in the Station Commander script directory to the script directory in the main X2 game directory. Then copy the file in the t directory in the Station Commander to the t directory in the main X2 game directory.
Managing a stations fighter complement, intercepting enemies and ensuring a supply of parts for fighters can be difficult for the busy trader. This script sends a request to the local mercenary population requesting the services of a Station Commander. In return for their services and to cover the cost of an M5 fighter with which they travels to your station, you will be charged 2,000,000 credits. The M5 will then be used as a patrol ship.
The Commander will also require the use of a jump capable transport (used to buy fighter upgrades) and a standard transport (used as a warehouse to store spare fighter components). If you do not provide these (they need to be docked at the station with no commands issued), the Commander will immediate attempt to buy them. Note that due to the scarcity of jump drive vendors, if you dont provide a jump transport then rather than just buying a jump drive for a spare freighter, the Commander will buy an brand new ship that comes equipped with one.
Once all of these ships are in place, the Commander will send out an M5 on patrol and then engage the Automated Station Defence Algorithm which allows him to control his fighters. The warehouse will assess the need for fighter upgrades and then send the jump-ship to purchase any necessary equipment. Then the fighter complement is assessed with any existing ships being included (assuming they have the station set as their homebase). The Commander will gradually increase the number of ships until they have five of each of the three classes.
If a patrol ship detects an enemy, an intercept force will be sent to deal with them. Note that fighters need to have good shielding and weapons before they will be included in this force. If the station does not have at least one M3 or three M4 ships that are capable of surviving a battle then no force will be sent.
Any damaged ships docked at the station will automatically be sent for repair at the nearest station.
Ships with a trained AI controller are valuable commodities. It is generally accepted that after 30 patrol missions or 10 battles a fighter is well trained. Occasionally, a bounter hunter may visit your station and inquire as to the possibility of selling any suitable fighters. Your Commander will *never* sell all of one class and will only reduce a class's complement below four if they are short of funds.
Player notes:
When you start the script, you will be prompted for 4 things. The script works in a variety of modes - fixed vs random shipyards along with selling commanders or not.
Input One: Select a shipyard. If you want a fixed shipyard, select it here. If not, the station you choose will just determine the race of the Station Commander. Note you can not select pirates here.
Input two: Input a range. If you want a fixed shipyard, input any three digit number (ie 100 or more). Otherwise, this number will be the maximum distance from the station that the Commander will look for new ships. Any shipyard within this range will be considered for buying ships from (take care that this doesnt mean you have ships crossing hostile sectors!). Sometimes, certain contacts will allow your Commander to buy pirate ships - these will fly from an appropriate pirate base.
Input three: Minumum cash to keep in station. The Commander will use this to determine how much of the station's money they can use. This allows you to keep sufficient funds in a factory to allow it to remain operational.
Input four: Commander can sell Y/N. Y or y will allow your Commander to sell ships if given the opportunity. Anything else will mean they never do so.
All additional fighters are bought at the S level, i.e. they have just one 1MW shield and no guns. They are fully max'd with respect to cargo, engine tunings and rudder optimisation though. They also come with fighter commander MKI and MKII installed. So this script will not supply you with an instant fleet of fully equipped fighters! Note that the upgrader buys items from the open market, so upgrading takes quite a while and may well be competing against you and/or other stations. Also note that the upgrader is relatively stupid, it puts items in the first fighter in which they fit - it does not fully equip one before moving on to the next one. This is intentional (experience will be implemented eventually). Also note that your Commander pays top dollar for their ships, it is cheaper for you to buy them yourself...
The repair mechanism works via a fudge (as I couldnt work out how to access the in-game repair system via a script). It generates an intact copy of your damaged ship and then adds equipment before destroying the original damaged ship. Note it only checks for guns, shields, missiles, scanners, fighter commander MK 1 & II. Anything else will be lost.