[SCRIPT] Auto Prep Ships v1.3 [2010-09-24]

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

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

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

[SCRIPT] Auto Prep Ships v1.3 [2010-09-24]

Post by ThisIsHarsh » Sun, 5. Jul 09, 11:33

Auto Prep Ships

:arrow: Automate the tasks of repairing, upgrading, equipping and configuring groups of ships quickly and easily - without cheating.


:arrow: Download: Auto Prep Ships

:arrow: Menu example (jpg)


:arrow: Upgrade ship like command: orders a single ship to buy all tech upgrades (software, etc) to match a template ship, then transfers those tech upgrades to a target ship. Requires Supply Command Software. Useful in early game using M4/M5 as delivery ships for equipping single targets.

:arrow: Repair Laser Production Complex AL plugin: adds Repair Laser factories to random sectors for each race.

:arrow: Auto prep ships command:
  • The main command - designed for use by the TM class, but will run on any carrier class ship with Supply Command Software.
  • On starting the command you are presented with a menu, where you select the tasks to perform (detailed below), and create a list of target ships to equip.
  • The list of target ships is processed task by task, sector by sector. So all ships in a sector are repaired, then all in the next sector. Then all ships in a sector are upgraded, then all in the next sector, and so on.
  • There is a log that appears in the command menu as the carrier preps the target ships. You can open the menu without interrupting the carrier, just be sure to exit by pressing ESC.
  • The carrier will use jumpdrive and refuel based on its autojump and refuel settings in the command console.
  • The tasks are performed in the following order:
    1. Repair: target ships will be visited and repaired via repair laser, if necessary. The carrier must have at least one turret with only repair lasers fitted.
    2. Upgrade:
      • Upgrades include tunings, software and other tech such as jumpdrives.
      • You specify the tuning percentages in the menu and create a list of tech upgrades by copying from another ship, then removing unnecessary items.
      • Firstly, the target ships will be sent to buy tunings from the nearest dock. Once all ships have have done so, the main upgrade process begins.
      • For ships that can dock, they will be ferried around to various docks to buy upgrades. Multiple runs will be performed as necessary (i.e. if too few docking spaces to do all ships in one go).
      • For ships that cannot dock, you must assign one or more "Supply ships" to act as a proxy, buying upgrades to be transferred afterwards. Once the carrier finishes an upgrade run the supply drone proxy ship(s) will dock at a mutual station with the target ship(s) and transfer the upgrades. I recommend Argon Discoverers - they are cheap and carry M-sized cargo (thus can carry jumpdrives).
    3. Configure: for this you need to assign a template ship to copy settings from. The settings to copy are enabled/disabled in the menu.
    4. Equip:
      • For some equipping tasks you will also need to set a template ship (specifically: weapons, missiles, and ammo):
      • If there are any wares that are not available on the carrier, then it can try flying to a storage ship to fetch from there. The storage ship is set in the menu - "Fetch equipment from" option.
      • Wares will not be purchased. For that I suggest a combination with Manual Trade Extension. Use Manual Trade Extension to supply the equipment (possibly to a 'depot' intermediary ship) and Auto Prep Ships to equip.
      • If even one item is missing then that whole set of equipment will be skipped (e.g. if a ship requires 4 shields and the carrier only has 3 then no shields will be installed).

Changelog
v1.3:
- Added: log in preload menu.
- Fixed: energy cell refuel quantity.
- Fixed: probably lots from way back.
v1.2.1
- Fixed: problem equipping shields when already some aboard target.
- Fixed: problem upgrading ships that are already aboard carrier.
- Fixed: not recognizing when a target ship has been destroyed.
v1.2:
- Added: fetching equipment from a homebase ship.
- Added: more options - set wing, add upgrades from template.
- Modified: better handling of 'when finished' ferrying.
- Modified: AL plugin now adds Repair Lasers to docks.
- Fixed: turret loadout issue.
- Fixed: various minor issues.
v1.1:
- Added: 'Dock when finished' option.
- Added: "Add all damaged ships' to target list, when repair is enabled.
- Added: 'Homebase' option for configuration according to template ship.
- Modified: current sector of target ships appended to name in list.
- Modified: slightly better information on current task in property view, etc.
- Fixed: some minor tweaks and bugfixes.
v1.0.1:
- Modified: minor command slot change for compatibility
v1.0:
- first release.
Last edited by ThisIsHarsh on Sun, 26. Sep 10, 19:55, edited 17 times in total.

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Mon, 6. Jul 09, 01:08

Update v1.0.1
- Minor update: command slot change for compatibilty.


someone else
Posts: 2972
Joined: Sun, 18. Jun 06, 13:37
x3tc

Post by someone else » Mon, 6. Jul 09, 15:48

phew! this will make Carrier management much easier!

:thumb_up: :thumb_up: :thumb_up:
Trade, Fight, Build, Think, Modify.
Ship Rebalance Mod
OOS Rebalance
Resized Aldrin Big Rock
SIDE/TOP/FRONT Ship Size Comparison
Remember young Padawan: money stolen can be, time cannot.

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Wed, 8. Jul 09, 02:52

someone else wrote:phew! this will make Carrier management much easier!

:thumb_up: :thumb_up: :thumb_up:
Actually I originally created it to automate the preparation of captured ships (via NPC Bail Addon/Salvage Commands) for active duty. Having several damaged, underequipped, newly salvaged ships waiting to be outfitted at various sectors around the galaxy was a micromanagement nightmare!

Recently though, I've found it useful for general carrier management as well. Though I am aware there are other scripts for this, I haven't had a chance to do a comparison yet, but I think this plugin is the most comprehensive 'auto equip' type plugin so far.

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Thu, 9. Jul 09, 20:57

Update v1.1

:arrow: 'Dock when finished' option. Can order target ships to dock at nearest station, carrier (here), homebase, or none, once all preparation tasks have been completed.

:arrow: 'Add all damaged ships'. When repair task option is enabled you can add all your damaged ships throughout the galaxy to the target list. Very useful when you have a lot of salvaged/battle scarred ships lying all over the place (especially when using repair lasers).

:arrow: 'Homebase' option to configuration using template. Enable to change homebase of all target ships to be the same as the template ship's.

:arrow: A few other minor information related tweaks.

Feuerriese
Posts: 204
Joined: Thu, 28. Sep 06, 12:25
x4

Post by Feuerriese » Fri, 10. Jul 09, 23:30

Really good script, thanks a lot for making a fleet commander's job easier :)

Now for the request part...could you add some kind of "auto-repair fleet" option ? I think this might come in handy (almost as much as an editable template database :lol: )

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sat, 11. Jul 09, 02:02

I've actually been thinking about adding a way to save configs for recall, but that's a ways off yet.

"auto repair fleet" - need more details... Already you can add all damaged ships to the target ships list and disable everything except the Repair task. Then when you start the command it will automatically repair every ship in your fleet.

The ship already uses jumpdrive (restocking with ecells as necessary) to get from one sector-load of target ships to the next. So it really is "fire and forget".

The only real addition I can see with your suggestion would be to make it sit in continuous loop, repairing ships as and when necessary... Is that what you mean? I think something like that would be worth an entirely new plugin (though many of the same scripts could be used). I think there is actually a pure repair laser script by Graxter, but not looked into it recently.

Feuerriese
Posts: 204
Joined: Thu, 28. Sep 06, 12:25
x4

Post by Feuerriese » Sat, 11. Jul 09, 07:21

Sorry for the lack of details but you are right, I was thinking of a continuous loop. The point is, sooner or later you will own a lot of ships and then you will have to find the repairship, give order to add all damaged ships and start the command. But because of the pure number of ships you have to do that on a regular basis - so it'd be nice to have the grease monkey do all the work for you.
Scan player ships for damage, check e-cells, hop into system if necessary, put damaged ship into halt mode, fly into range, repair, let target ship continue with original order. Maybe add an optional "don't jump into dangerous sectors" just to make sure the poorly shielded repair ships don't get bashed...so you see, absolutely easy! Did I mention editable templates? :D

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Mon, 20. Jul 09, 20:19

Update v1.2

:arrow: Equipment can now be fetched from another assigned ship, rather than stored on the prep ship.

:arrow: Once finished prepping, target ships can now be either: (a) picked up; (b) sent to nearest station; or (c) ferried/sent to target ships' homebases. These options are similar to the previous version but more intelligent (e.g. ferrying rather than just sending).

:arrow: Can now set wing membership from template. Also add upgrades from template (so you don't have to select the same ship twice).

:arrow: Repair Lasers are now added to docks as well as have factories. To enable, toggle AL plugin off then on again. The factories will be destroyed and recreated elsewhere and Repair Lasers will be added to a few random docks, allowing them to be consumed (so factories don't just sit at 100% stock all the time - whoops!).

:arrow: Several minor tweaks and bugfixes.

Check the OP for updated screenshot of menu options.

Gilliganxl
Posts: 24
Joined: Thu, 2. Jul 09, 05:36

Post by Gilliganxl » Sun, 26. Jul 09, 05:50

okay so for the equip items the ship items you want on have to be on the ship preping the fighters right? no way of having them go buy stuff from equipment dock? cuz i got a dock with everything ready...anyway i got the big ship with all items ready but when i select template and then ships to prep, all the ships just launch then sit their. and i dont see the fetch items options as shown in v1.2. Thats the one i downloaded as well.

eh nevermind i never reint the script so it was still running as v1.1 lol sorry.

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Sun, 26. Jul 09, 06:13

Gilliganxl wrote:okay so for the equip items the ship items you want on have to be on the ship preping the fighters right? no way of having them go buy stuff from equipment dock?
Nah, they won't go buy stuff. There are already two options as I see it for getting hold of equipment. You can use Manual Trade Extension to buy equipment and dump at a homebase ship, then use this same homebase ship as the 'Fetch equipment from' ship in Auto prep ships. The second option is to use Lucike's Commodity Logistics Software to deliver equipment from your/NPC stations to a homebase ship, and again use that ship as the Fetch equipment from' ship in Auto prep ships.

Azercon
Posts: 14
Joined: Fri, 10. Jul 09, 03:08

Post by Azercon » Thu, 30. Jul 09, 03:44

Looking for a little help. I installed this script its version 1.2 I made sure of that. Im new to the game so please have a little patience with me. Im trying to use a mercury to do this, If I read correct thats a suitable ship for it. I have in the special command im giving these options. resupply, rearm,refuel, equip ships like, and upgrade ships like. If i use the upgrade ship like both ships went to a trade center and foolishly I didnt check before hand but i believe it equiped the ship with the correct extensions. Now I want to equip the ship with shields and guns so I am using equip ships like command and it goes through but neither ship does anything.

The ship im trying to equip is a merc, and the template ship is the same ship. The ship im using has a ton of the correct shields and guns but its not doing anything.

I also dont have access to the auto prep ships display window like you have posted here.

So if anyone could help a X3 newb out, what am I doing wrong??

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Thu, 30. Jul 09, 04:24

Azercon wrote:Looking for a little help. I installed this script its version 1.2 I made sure of that. Im new to the game so please have a little patience with me. Im trying to use a mercury to do this, If I read correct thats a suitable ship for it. I have in the special command im giving these options. resupply, rearm,refuel, equip ships like, and upgrade ships like. If i use the upgrade ship like both ships went to a trade center and foolishly I didnt check before hand but i believe it equiped the ship with the correct extensions. Now I want to equip the ship with shields and guns so I am using equip ships like command and it goes through but neither ship does anything.

The ship im trying to equip is a merc, and the template ship is the same ship. The ship im using has a ton of the correct shields and guns but its not doing anything.

I also dont have access to the auto prep ships display window like you have posted here.

So if anyone could help a X3 newb out, what am I doing wrong??

You have to use a carrier ship, e.g. a TM class (Argon Magnetar is good as it can equip Repair Lasers), to use the 'Auto prep ships' command. If you're equipping a ship that cannot dock at the carrier then you need to have another ship that can act as a supply drone to buy the upgrades (Argon Discoverer is good, cheap and supports M-class cargo/upgrades).

'Equip Ships Like' is a stock egosoft command, not part of this plugin.

Hope this helps.
Last edited by ThisIsHarsh on Thu, 30. Jul 09, 04:44, edited 2 times in total.

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Thu, 30. Jul 09, 04:40

Update v1.2.1

:arrow: Minor bugfix update.

[Is it just me or are images not loading in posts?]

Azercon
Posts: 14
Joined: Fri, 10. Jul 09, 03:08

Post by Azercon » Thu, 30. Jul 09, 23:07

Yes that does help Ill set up a new ship and try things out thanks for the reply.

And no its not just you they havent loaded for a couple days now for some reason (the pics).

Azercon
Posts: 14
Joined: Fri, 10. Jul 09, 03:08

Post by Azercon » Fri, 31. Jul 09, 00:48

Ok I got me a magnatar and a discoverer. I have the auto prep menu up. I have guns and shields on the magnatar. I basically have all the settings set to match your image of yours. I have the two ships set as the target ships. I have the discoverer set to supply ship. I have the configure set to a model ship of the same model/type.

When i hit the auto prep it sent the two new ships to the dock and got the extensions they needed then the magnatar set course for the two new ships and they set course for the magnatar. once they got within a certain distance of each other the magnatar set course for the nearest dock and went and parked.

The discover never changed orders. and the mag never equipped the ships with shields and guns. (I do have it set to enable for those settings)

So what am I doing wrong now? (sorry to be such a bother) Is there something else i need to do for the discover to make it the supply ship? and activate it?

ThisIsHarsh
Posts: 1135
Joined: Sun, 19. Oct 08, 18:46
x3tc

Post by ThisIsHarsh » Fri, 31. Jul 09, 02:31

Azercon wrote:Ok I got me a magnatar and a discoverer. I have the auto prep menu up. I have guns and shields on the magnatar. I basically have all the settings set to match your image of yours. I have the two ships set as the target ships. I have the discoverer set to supply ship. I have the configure set to a model ship of the same model/type.

When i hit the auto prep it sent the two new ships to the dock and got the extensions they needed then the magnatar set course for the two new ships and they set course for the magnatar. once they got within a certain distance of each other the magnatar set course for the nearest dock and went and parked.

The discover never changed orders. and the mag never equipped the ships with shields and guns. (I do have it set to enable for those settings)

So what am I doing wrong now? (sorry to be such a bother) Is there something else i need to do for the discover to make it the supply ship? and activate it?
So I take it the ships to be equipped cannot dock at the Magnetar? The supply ship is only used to buy tech upgrades (i.e. software, Jumpdrive, etc) when the target ships cannot dock at the carrier. Are upgrades not being purchased when they should be?

Things to check for equipment issues: are there enough weapons/shields on board the carrier (if you only have 4 of 5 needed then 0 will be installed)? are the shields definately not installed on the carrier (the carrier's shields will not be stolen by target ships)? Does the carrier have a Transporter Device (required if the target ships cannot dock)?

I really should implement some error messages for when things fail.


If all else fails, and you dont mind a bit of work:

1) Go into script editor (CTRL+C, CTRL+S, ENTER), scroll to file 'setup.plugin.prep' near the bottom and select with ENTER.
2) Modify the line at the top "set global variable: name='prep.debug' value=[FALSE]", changing the [FALSE] to a [TRUE].
3) ESC to quit, save, press ESC again and select 'Reinit script caches' (or alternatively reload savegame, but that takes longer).
4) Run 'Auto prep ships' command as before, in fact run a couple of times, so it does the same incorrect behaviour as before.
5) Send me (or post the last several lines here) the file log01000.txt in your savegame folder (C:\Users\<username>\Documents\Egosoft\X3TC for Vista, whereas XP is something like C:\Documents and Settings\<username>\My Documents\Egosoft\X3TC).


Failing all this, give up and wait for me to make a version that gives error messages...

Azercon
Posts: 14
Joined: Fri, 10. Jul 09, 03:08

Post by Azercon » Fri, 31. Jul 09, 02:55

well i really appreciate the reply only God knows how long it would of taken me to realize that when I switched my supply ships i forgot to switch the transporter device.

That's what it was. And I just want to say this script is awesome. This will make things so much less time consuming.. I for one appreciate the time you put into working this thing.

Thanks again!

Feuerriese
Posts: 204
Joined: Thu, 28. Sep 06, 12:25
x4

Post by Feuerriese » Tue, 4. Aug 09, 22:53

Yet another feature request :D As I'm using AutoPrep almost as often as Lucike's trading scripts ( = a *lot* ) I feel the need for a tiny bit of automation...more or less like the X3R "sector mother".

http://forum.egosoft.com/viewtopic.php?t=175572

Set a home sector, jump range and a supply base and the prepper starts working, i.e. delivering shields and ecells. Oh, and talking about supply bases, is it at all possible to make a shield producing complex the preppers supply base ?

Post Reply

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