Station Commander unsigned script

The place to discuss scripting and game modifications for X²: The Threat.

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

Post Reply
dwgh
Posts: 120
Joined: Wed, 6. Nov 02, 20:31
x4

Station Commander unsigned script

Post by dwgh » Mon, 6. Sep 04, 16:23

Something for the richer people out there... an M6 is a better solution for OOS defence, but this is more fun :) I'd suggest adding around 10 million minimum to any station running this, but it should work with less (I tested it with 7.5 mill and 25 mill, the latter max'd it out).

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.
Last edited by dwgh on Wed, 13. Oct 04, 05:57, edited 2 times in total.

dwgh
Posts: 120
Joined: Wed, 6. Nov 02, 20:31
x4

Post by dwgh » Thu, 9. Sep 04, 11:09

I've fixed a couple of problems, anybody who has the original should replace it with the new one...

User avatar
Clovis
Posts: 81
Joined: Fri, 16. Apr 04, 20:15
x3tc

Post by Clovis » Thu, 16. Sep 04, 01:09

:thumb_up: Looks very nice.

Johnn
Posts: 77
Joined: Wed, 6. Nov 02, 20:31
x3

Post by Johnn » Wed, 22. Sep 04, 13:51

:) I love the idea of the script and I have tried it out:--
:evil: But im afraid that when I ran it it worked ok for a few hours I had 7 station commanders in different sectors but the game started to hang:-
When I go back to an earlier save and take the script out there are no hang ups.
:? The only scripts Im using are the signed ones and this one so I think there might be a conflict or am I using too many station commanders?
My system is windows ME,AMD 2200, 512MB ram and I have had no other problems till I put this script in.
It worked for a few hour then BANG!! game freezes and I have to reset the computer. :(

:evil: :evil:

dwgh
Posts: 120
Joined: Wed, 6. Nov 02, 20:31
x4

Post by dwgh » Wed, 22. Sep 04, 15:54

I'm 100% sure there is no conflict with the signed scripts. For it to hang rather than just slow down suggests that I've made a mistake and put in an infinite loop somewhere. The fact that this happens after several hours means it is almost certainly in the bounty hunter bit... That should have been fixed in version 1.1 of the script.

Let me know if you are using that version, if so, I'll have another peek at the code to see what the problem is...

Johnn
Posts: 77
Joined: Wed, 6. Nov 02, 20:31
x3

Post by Johnn » Wed, 22. Sep 04, 19:39

:( Im sorry to say that it is the script that was causing the problem as I went through all my stations and got rid of the station commander.
Deleted all the scripts from the scripts folder and the T folder.
Did everything I did before and no problems.
Put the computer on seta X10 went for dinner came back still going alright.
:oops: Sorry to be the bearer of bad news but I thought I would let you know that it is not down to me but something in th script.

PS I was using the new script at the start of this thread V1.1

dwgh
Posts: 120
Joined: Wed, 6. Nov 02, 20:31
x4

Post by dwgh » Thu, 23. Sep 04, 17:13

No problems, I'm quite happy to accept it was the script that was the problem, I just wanted to be sure you were using the latest version.

I know that it isn't a conflict with the signed scripts, so I need to look for a bug instead. Will take a look at it tonight and hopefully I'll find the problem. I'll also see about adding a little more functionality (which is sure to introduce more problems ;) )

Johnn
Posts: 77
Joined: Wed, 6. Nov 02, 20:31
x3

Post by Johnn » Thu, 23. Sep 04, 18:30

I love the script and what it does and I look forward too the next one.
I hope to say YIPPEE to the next one as it is is a dam good script and I hope you are going to try and get it signed.

dwgh
Posts: 120
Joined: Wed, 6. Nov 02, 20:31
x4

Post by dwgh » Fri, 8. Oct 04, 08:42

Sorry it took so long, a combination of a couple of weird bugs and a very busy real life...

Anyway, let me know if you manage to break it again. If I dont hear anything bad, then I'll think about sending it for signing.

Johnn
Posts: 77
Joined: Wed, 6. Nov 02, 20:31
x3

Post by Johnn » Fri, 8. Oct 04, 13:01

:) Ok ive now downloaded it and will test it over the weekend.
Sorry that ive been so long but Ive been busy Beta testing another online game.
Will let you know the results thank you.

Johnn
Posts: 77
Joined: Wed, 6. Nov 02, 20:31
x3

Post by Johnn » Wed, 13. Oct 04, 12:48

:) OK ive had it running all weekend on SETA most of the time and it doesnt hang now.
There is just one slight niggly bit with the auto repair.
I Have put BPH ships into some of the stations and when it send them for repairs they loose the BPH upgrade and I have to put the BPH back in which means that theire levels reset back to zero.
This is slightly annoying when you have BPH levels 8's going back to zero.
Still a good script but you should be aware of this problem.
Thank you.

dwgh
Posts: 120
Joined: Wed, 6. Nov 02, 20:31
x4

Post by dwgh » Wed, 13. Oct 04, 17:26

Ah, I can fix that quickly enough - although I suppose I ought to do the full range of signed experience based scripts rather than just BPH. Will see if I can get something sorted over the next couple of days... you wont have to re-start the Commanders as the repair sub-script is only called when necessary.

BlueSwede
Posts: 251
Joined: Sat, 7. May 05, 19:05
x3tc

Post by BlueSwede » Fri, 3. Jun 05, 16:05

Sounds like a pretty cool script. I'll try it out when I've got 10 M cred. to put in a factory....

AdmiralTigerclaw
Posts: 2131
Joined: Mon, 27. Dec 04, 11:49
x4

Post by AdmiralTigerclaw » Fri, 3. Jun 05, 16:39

*Introduces Swede to the wonders of Topic Date*

As you can see by this WONDEROUS chronogological dating system, the last post here was calculated at roughly october of last year. Carbon dating has yet to be so accurate.

Elwood J Blues
Posts: 192
Joined: Sat, 14. Aug 04, 13:08
x3tc

Post by Elwood J Blues » Thu, 10. Nov 05, 12:33

There is a small problem with the comander. There are enemies throughout the sector he's deffending and he won't send any ships to engage. Even if they are attacking ships assigned to his station. Had to do a complete roll back to v1.1 which fixed the problem.

Elwood J Blues.
It's 106 miles to Chicago, we've got a full tank of gas, half a pack of cigarettes, it's dark, and we're wearing sunglasses.

parameter
Posts: 728
Joined: Thu, 2. Feb 06, 09:21
x3tc

Station Commander for X2

Post by parameter » Mon, 19. Jun 06, 18:41

:)

Hi dwgh, It has been a long time and you no doubt dumped it and moved to X3 but did you get your Station Commander script sorted?

I only ask because it seems brilliant but I am aware of the original post date of the subject. I am a Mac user so have to make do with old mods/scripts for X2 until X 10 - Infinity Loop appears....... eventually! Well we are not going to get X3 for certain.

:lol:

Post Reply

Return to “X²: The Threat - Scripts and Modding”