[Script] Fighter Base Commander V1.10 (04 Feb 2006)

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

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

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

[Script] Fighter Base Commander V1.10 (04 Feb 2006)

Post by dwgh » Sun, 22. Jan 06, 22:19

I love Myros' TerraCorp Combat Project, but I hate micro-managing fleets :) So after asking Myros if I could pinch some of his code, I came up with this.

It's very much a work in progress, but I'd appreciate some testing to make sure it does what I think it does!

http://www.comp.leeds.ac.uk/dharris/FBC110.zip
http://www.comp.leeds.ac.uk/dharris/FBC110.spk

Fighter base commander is an add-on to the TerraCorp Combat Pilot script (written by Myros - kudos to him for letting me adulterate his code). You *must* have this installed to run this script.

Select "Hire Commander" from the station command console. You will need to select the shipyard from which to buy ships, the minimum cash to leave in the station and enter a brief name for your base (the station name will be unchanged, but the base name is used when naming the ships). The commander will then either take a jump equipped TS from the stations owned ships or buy one if needed. This will be used to purchase upgrades for your ships (note that it will also take equipment from the station if present, so an equipment dock is an ideal base).

Essentially, the FBC automatically buys ships, upgrades them, hires TCCP pilots and then trains them up until they can fly M3 class ships. As your pilots become more experienced, they will automatically be given better ships to fly (money allowing). When you have 3 idle ships, they will automatically be formed up into a patrol group.

You can add ships of your own to the base simply by making the station their homebase, these ships will be given pilots and upgraded as usual (the FBC also automatically sends ships to the nominated shipward and repairs them). Note, that apart from the base tender (the TS), only M5, M4 and M3 ships are currently used by the FBC. You can, at anytime, take ships from the station for your own use by changing their home base, thus the FBC can provide a steady stream of new recruits for your fleet. Cycrow's remove homebase script is included and can be activated via the additional commands section of your ships command console.

Currently, the FBC will only have up to 9 M5s, 6 M4s and 3 M3s. It will only buy the latter ships if it has a suitable pilot that can be moved out of a lesser ship - excess M4 and M3 ships you add will be populated as pilots gain rank.

It is recommended that you allow the FBC at least 10 million credits to run his base, although M5 only bases can be run far more cheaply.

You recruit the pilots directly, not via the TerraCorp station (which may mean Myros wont like this). The cost of having a technician setup in your station means that all costs are doubled (ie it's now 200k to install and 100k to move).

You can change the patrol sector by running the advanced options command from another command console slot. This will immediately prompt you for a sector and then send you an incoming message which will ask you if you wish to change the patrol sector. All future patrols will be sent to this new sector.

A log of the FBCs actions is generated in the main game directory as log00010.txt

Script info:
433 COMMAND_TYPE_TRADE_33 Fighter Base Upgrade Tender
1133 COMMAND_TYPE_STATION_33 Fighter Base Commander
1134 COMMAND_TYPE_STATION_34 Fighter Base Commander advanced options
Page ID 7430

Probable to dos:
1. Fix upgrades/pilot transfers (ran into some problems with stations now having a limit to the number of ships docked and having ships stuck in queues rather than upgrading).
2. Revisit the weapons upgrades - currently it just sticks in the biggest laser it can in every slot (IRE, PAC, HEPT only).
3. Add advanced configuration command - allow you to adjust loads of options.
4. Add M6s to possible purchases - will need to allow possibility of sending pilots to enemy sectors for training.
5. Allow carrier support.
6. Integrate with the Task Force Commander script to allow more useful behaviour (eg trader escort).
7. Ware collection in sector.


Version History
1.10
First advanced option (change patrol sector) added
Small fixes

1.09
Added non-standard freighters to lookup list

1.08
Fixed bug with upgrader that couldnt cope with full cargo bays
Cycrow's Remove Homebase now on v1.1

1.07
Code generally tidied
Repair script updated
Cycrow's remove homebase command integrated to avoid duplication
More detailed log file information
Tender no longer buys items if it has already managed to load some from its home station

1.06
M4s no longer sent on patrol until maxed out laser- and shield-wise
Tender now buys 1MJ shields and IREs in batches of 10 to speed M5 upgrade
Ships should now return to homebase before having pilots installed

1.05
Fixed two bugs in the upgrader, one caused the script to only look for 25MJ shields, the other caused the tender to include items that it did not have the notoriety to buy

1.04
Fixed a naming error for the upgrade tender

1.03
Should now run out of any station, not just factories
Script should now auto-update

1.02
Fixed small bug in find upgrade item which caused the first sector on the known list to be ignored
Fixed bug in upgrade script which caused the tender to give away it's shields
Removed some debug logging
Added remove homebase command to all ships (special command menu)
Added a manual script a.reset.pilot which completely removes all traces of a cpilot (very occasionally ships seem to get blocked from allowing new pilots to be hired. Hopefully this will fix that
M3 ships are no longer added to potential patrol groups
Last edited by dwgh on Sat, 4. Feb 06, 09:08, edited 13 times in total.

Valen68
Posts: 274
Joined: Wed, 8. Jun 05, 18:23
x4

Post by Valen68 » Sun, 22. Jan 06, 23:53

This sounds pretty cool. So does that mean you have to buy your own base (equipment dock)?

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

Post by dwgh » Mon, 23. Jan 06, 00:06

No, it'll run out of any station. Having an equipment dock just makes the upgrading of the fighters easier...

User avatar
NZ-Wanderer
Posts: 1623
Joined: Thu, 5. Aug 04, 01:57
x4

Post by NZ-Wanderer » Mon, 23. Jan 06, 00:48

Ohh an end to that micromanaging nightmare in buying new ships, pilots etc... :) :)

Am in the middle of one of the missions in the plot atm so can't help, but as soon as I can get back to the game and finish the mission I'm on will gladly give this a go.. :)
Link to the list of Mods working in X4-Foundations and also Link to the list of Mods working in X-Rebirth

NOTE: I play with a modded game, so any reports I make outlining suggestions/problems/bugs/annoyances, are made with mods installed and running.

djssuk
Posts: 183
Joined: Thu, 11. Dec 03, 21:43
x3tc

Post by djssuk » Mon, 23. Jan 06, 01:09

I will spare a few hours over the next week testing.

Sounds great...

djssuk
Posts: 183
Joined: Thu, 11. Dec 03, 21:43
x3tc

Post by djssuk » Mon, 23. Jan 06, 20:41

I can't seem to find the 'Hire Comander' anywhere. I will try again...

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

Post by dwgh » Mon, 23. Jan 06, 20:46

Just to check... you have the 447430.xml file in your t directory and so on?

It should appear in the station command console (just click on any of the slots to get the list of potential commands).

djssuk
Posts: 183
Joined: Thu, 11. Dec 03, 21:43
x3tc

Post by djssuk » Mon, 23. Jan 06, 23:00

Checked again and no command.

I have checked my T files and your fils is there and starts with

<?xml version="1.0" encoding="UTF-8" ?>
- <language id="44">
- <page id="7430" title="Fighter Base" descr="">

And all of the Fighter.Base files are in the Scripts folder.

I have looked at station command closts for a Trading station n Home of Light and nothing was there, so I tried a Cahoona Bakery in Argon Prime and it was not there.

Also, my Discos at TerraCorp also can no longer 'Hire a Combat Pilot' anymore as the command for this has also vanished.

I have tried jumping to Argon Prime to see if anything changes.

I hav not yet tried saving and reloading yet, but will try this in a bit.

Thanks for looking as I do like the idea of this and do hope to get it working.

P. S. I tried the Zip file and the spk versions.

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

Post by dwgh » Mon, 23. Jan 06, 23:57

Note to self, try to include all the files in the pack... doh!

Forgot to add the setup file, will update the links when I've uploaded the complete packs. No idea why that should have affected your discos though as I left the original cpilot scripts untouched.

Anyway, shouldnt be more than 5 minutes...

djssuk
Posts: 183
Joined: Thu, 11. Dec 03, 21:43
x3tc

Post by djssuk » Tue, 24. Jan 06, 13:29

Many thanks.

I will try again tonight.

The Disco thing was a coincidence... a timing thing...

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

Post by dwgh » Tue, 24. Jan 06, 18:28

Small update

Blinki1984
Posts: 245
Joined: Sat, 14. Feb 04, 11:15
x3

Post by Blinki1984 » Tue, 24. Jan 06, 18:42

nice work

djssuk
Posts: 183
Joined: Thu, 11. Dec 03, 21:43
x3tc

Post by djssuk » Tue, 24. Jan 06, 22:44

I was using 1.01 with a few mixed results so far.

Firstly, the command only seems to be available in goods based shipyards such as solar plants. It is also available at 'HQ'. It is therefore not avaialbe at Trading Statinos, or so it appears.

The Command 'Hire Commander' is not present at any station, although I have a Fleet Command option (can't remember the name). Triggering this seems to do the job.

I waited a while after selecting a Shipyard in Trinity Sanctum (my base in Home of Light) but nothing hapened, so I purchased a few M4 Pegasus ships and assigned the home as my chosen station. This renamed the ships to the chosen (typed in) name and the number afterwards. I waited a while but nothing occured.

I have also assigned an Argon Mercury as to my station (home) but this did not move from the Shipyard.

Anyway, I will now try version 1.02 and have another go.

Comments to follow...

Saint-Ashley
Posts: 1267
Joined: Sat, 3. Dec 05, 03:40
x4

Post by Saint-Ashley » Tue, 24. Jan 06, 23:43

Code: Select all

012   global script map: set: key=COMMAND_FB_HIRE_COMMANDER, class=Factory, race=Player, script='fighter.base.automate', prio=0

Inside your Script setup.fighter.base line 12 if you change the Class value to Equipment Dock or possibly Station? The hire commander command will appear under that classes additional commands. I set it to Equipment Dock personally and hired a commander at a dock.

Script seems to work good so far... but if everyone is takeing your suggestion about equipment docks they will not see the hire commander command as of yet...

Also fellow gamers upon hireing a commander at a station a map will pop up asking to select a position select the shipyard that you wish your commander to use, the rest is self explanitory.

Planning on further tests later tonight...
Last edited by Saint-Ashley on Fri, 27. Jan 06, 18:18, edited 1 time in total.

User avatar
Malakie
Posts: 1061
Joined: Tue, 13. Apr 04, 23:08
x4

zip file corrupt

Post by Malakie » Wed, 25. Jan 06, 05:06

Hi,

The zip file is corrupt. I needed it because I wanted the text file readme. I normally use the package tool script installer but that says there is no readme even though it lists one.

So, You might want to update both packages!

Malakie

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

Post by dwgh » Wed, 25. Jan 06, 09:28

djssuk - Another daft mistake by me, well spotted by SaintAshley. I've changed the script to run out of any station and tested it with a Royal Boron Shipyard. Crossed fingers it should run where you want it now.

Bit worried about that fleet command option, sounds like there may be a conflict. Can you let me have the actual name and I'll check it out.

SaintAshley - Thanks :)

Malakie - Didn't think I'd have to test a 50k upload for corruption! OK, not sure what happened with the installer (readme files should get dumped into the readme diectory), but I've tested the zip file this time and it works fine - for now at least...

Next up for fixing will be the missile code (it currently only installs mosquito missiles).

I've enabled the auto-update - can't wait to find out how badly I've messed that up :twisted:

djssuk
Posts: 183
Joined: Thu, 11. Dec 03, 21:43
x3tc

Post by djssuk » Wed, 25. Jan 06, 18:20

Many thanks

Was going to say works with all stations except Equip docks and Trading stations, but this this coverred. So, my results form last night.

The hire command... forgot, will read again and note, but think it states Hire Fighter Base Comander' or something like that, so still obvious, but not word for word...

Also, when I selected my Boron Shipyard and then typed in the money for my Solar Plant, nothing happened. However, when I manually added 10mil, it worked and started buying ships.

One new issue.

It doesn't seem to be buying equipment. It seems to have purchaed my M5 Octs, upgraded the max speed, cargo, etc but not touched the shields. I expected them to upgrade from 1 x 1MJ to 2 x 2MJ but they did not. It also does not seem to have hired or purchased a ship for buying equipment. Anyway, I purchaed an Argon Mercury and set it's home station as my new 'Training Academy' (my Solar Plant) and waiting, but it never moved. I sent it home and waited, but it never moved. In the meantime, my M5 Octs came to my Solar Plant, the Training Academy, waited, hired a Pilot and started a combat Patrol, but my Argon Mercury never moved or purchased any equipment. Have I misunderstood?

Also, I may have imagined it, but my first three M5's, which I purchased in advance seem to assign a pilot in the Boron Shipyards, whilst I think the others set off from their and did not get a pilot until it arrived at my Solar Plant. I will check this out again, but if this is true thn you may wan't to change the rules to be consistent (always go home first). Alternatively, what about making them go to Terracrop first (keep in line with Comabt Pilot script).

Also, a final idea... How about a final option of choosing the Combat Tour locations instead of it defaulting to the sector of the home station. My Solar Plan is in Argon Prime but I prefer to do my training in Kingdom End. No great thing though.

From what I have seen so far, it is looking very good and I can't wait for you further developments. Keep up the great work... It makes an already fantastic set of scripts (Combat Pilot and Taskforce) even better.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22201
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Wed, 25. Jan 06, 18:33

the readme's seem to work fine for me ?

djssuk
Posts: 183
Joined: Thu, 11. Dec 03, 21:43
x3tc

Post by djssuk » Wed, 25. Jan 06, 18:37

I used both versions and they seem fine to me. The script installer also links to the readme with no problem on mine too.

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

Post by dwgh » Wed, 25. Jan 06, 18:40

Also, when I selected my Boron Shipyard and then typed in the money for my Solar Plant, nothing happened. However, when I manually added 10mil, it worked and started buying ships.
So just to be sure... on running the script, you first select the shipyard that will sell you the ships, then type in the amount of money that the FBC will always leave in the base station and then a base name.

So, if your station has 5 million in it and you enter 4 million... he has 1 million to spend on what he likes, leaving the rest for the operation of the station.
It doesn't seem to be buying equipment. It seems to have purchaed my M5 Octs, upgraded the max speed, cargo, etc but not touched the shields.
The speed etc upgrade is done when the pilot is hired. The shields etc. require the TS to go and buy them.
Anyway, I purchaed an Argon Mercury and set it's home station as my new 'Training Academy' (my Solar Plant) and waiting, but it never moved.
OK, that's odd - especially as it also didnt buy a new one - it should have done that if it didnt like the one you gave it. I'm assuming the FBC still had money to spend (it would have needed to pay for a jump drive)? Will have another look at that bit tonight.
Also, I may have imagined it, but my first three M5's, which I purchased in advance seem to assign a pilot in the Boron Shipyards, whilst I think the others set off from their and did not get a pilot until it arrived at my Solar Plant.
If it buys it's own ships, then they get the pilot installed when it arrives at the station. Adding your own ships is something I added in later, so I suspect they will just get upgraded on the next pass by the FBC. I'll see about having them get returned home before the pilot is installed - probably sensible to do anyway in case it tries to include them in patrols.
Alternatively, what about making them go to Terracrop first (keep in line with Comabt Pilot script).
Did think about this, but it seriously limits where you can setup a base. I'll probably include this as an option when I get around to the advanced configuration - letting you choose to stick to the original TCCP idea or letting you hire a TCCP tech for your station.
How about a final option of choosing the Combat Tour locations instead of it defaulting to the sector of the home station. My Solar Plan is in Argon Prime but I prefer to do my training in Kingdom End. No great thing though.
Another one for the advanced config. options I think...

Post Reply

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