[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

Borgholio
Posts: 14
Joined: Wed, 27. Jan 10, 23:46
x3tc

Post by Borgholio » Wed, 4. Apr 12, 00:58

Found a small bug in this script. When setting my Mammoth to auto prep a group of Mistral Super Freighters, the freighters only upgrade their cargo bay 1k units at a time. In other words, they only go from the base of 10k to 11k. I have to run the auto prep command 5 times to get them to go all the way up to 15k...or do it manually.

shadowcode
Posts: 13
Joined: Sun, 27. Apr 08, 21:27
x4

Post by shadowcode » Fri, 6. Apr 12, 15:28

It would be nice if it was possible to get the supplies from a (equipment) base rather than a ship.

User avatar
Nibel
Posts: 208
Joined: Sat, 29. Apr 06, 16:53

Post by Nibel » Thu, 13. Sep 12, 23:25

safe to use with AP ?
WARNING: Any custom commands between 1300-1400 will not work in Albion Prelude (these slots are now taken by the fleet command menu)

-----------------------------------------------

1350: ThisIsHarsh, Auto prep ships (Buying upgrades)
1351: ThisIsHarsh, Auto prep ships (Repairing)
1352: ThisIsHarsh, Auto prep ships (Upgrading)
1353: ThisIsHarsh, Auto prep ships (Equipping)
1354: ThisIsHarsh, Auto prep ships (Shopping)
1355: ThisIsHarsh, Auto prep ships (Waiting/checking)
1356: ThisIsHarsh, Auto prep ships (Transferring upgrades)
i guess not.

SpongeBobSpacepants
Posts: 110
Joined: Sun, 19. Oct 08, 12:02
x3tc

Post by SpongeBobSpacepants » Tue, 30. Oct 12, 14:52

Not at all straight forward. Could not get it to equip other ships of the same class as the template even though i had all the equipment on board for the other ships i wanted to upgrade.

Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 » Thu, 19. Sep 13, 20:36

Released v1.3a

Hi all,
removed a bug preventing auto prep ships command to upgrade correct amount of cargobay, speed and rudder extensions.
Only condition this script is now working well (the only condition I have tested yet): Buy a bunch of ships, dock them to a carrier and let the carrier auto prep them with upgrades and equippment. For me (TC v3.2) it is now working well.

Other changes:
- a few changes regarding command setting of ships currently upgrading
- installed / updated message

Merged these fixes mentioned by others too:
fragma wrote:Firstly, thanks for this script. Anything that makes micro-managing less annoying is good, and this script delivers!

I noticed just a small error in the "Upgrade ship like..." scripts. The command works perfectly, but it shows "Unknown Command!" on the current command for ships running it. I managed to fix it with the in-game script editor:

File 1. plugin.prep.cmd.upglike

Code: Select all

001   set script command: COMMAND_TYPE_SPECIAL_34
changed to:

Code: Select all

001   set script command: COMMAND_PREP_UPGLIKE
File 2. plugin.prep.upglike

Code: Select all

003   [THIS] -> set command: COMMAND_TYPE_SPECIAL_34
changed to:

Code: Select all

003   [THIS] -> set command: COMMAND_PREP_UPGLIKE
fragma wrote:There also seems to be a bug with the "Equip Energy Cells (resupply config)" function. The amount of ECells transferred is wrong.
For example, if the target ship's fuel resupply is set to 10 jumps, Autoprep will give it exactly 10 ECells, instead of say, 100 ECells it should transfer if the target is a TS, or 200 for a M2, etc.

Poking around the script I think I found a fix:

FILE: plugin.prep.ware.filter.xml
Lines Changed:

Code: Select all

038   |||$quantity = $ship -> get jumpdrive fuel resupply
changed to

Code: Select all

038   |||$quantity = $ship -> get resupply fuel required
So far it seems to transfer the correct amount based on fuel resupply settings. But I'm not sure if this will break something else...
Nibel wrote:safe to use with AP ?
WARNING: Any custom commands between 1300-1400 will not work in Albion Prelude (these slots are now taken by the fleet command menu)

-----------------------------------------------

1350: ThisIsHarsh, Auto prep ships (Buying upgrades)
1351: ThisIsHarsh, Auto prep ships (Repairing)
1352: ThisIsHarsh, Auto prep ships (Upgrading)
1353: ThisIsHarsh, Auto prep ships (Equipping)
1354: ThisIsHarsh, Auto prep ships (Shopping)
1355: ThisIsHarsh, Auto prep ships (Waiting/checking)
1356: ThisIsHarsh, Auto prep ships (Transferring upgrades)
i guess not.
I moved all the commands from 13xx to 14xx, so it should be now safe to use it in AP. Here the new list:

1450: ThisIsHarsh, Auto prep ships (Buying upgrades)
1451: ThisIsHarsh, Auto prep ships (Repairing)
1452: ThisIsHarsh, Auto prep ships (Upgrading)
1453: ThisIsHarsh, Auto prep ships (Equipping)
1454: ThisIsHarsh, Auto prep ships (Shopping)
1455: ThisIsHarsh, Auto prep ships (Waiting/checking)
1456: ThisIsHarsh, Auto prep ships (Transferring upgrades)


Download v1.3a

Note: I have not tested this fully, so I do not know, if there are other issues.

paulhamm
Posts: 148
Joined: Mon, 4. Jul 05, 14:19
x3

Post by paulhamm » Wed, 25. Sep 13, 16:16

Nicoman35

I have been doing a bit of testing on your version 1.3a. The repair ship function does not seem to work. Used a Magnetar with4 repair lasers installed.
There is also a problem when upgrading larger class ships that can not dock with the auto prep ship. Failed to upgrade tunings. It did transfer cargo Mosquito Missiles. Did not purchase upgrades. Used a Chokaro with 4 Fujin ships as buyers as needed. The 10 Mistral Super Freighters should have docked at local EQ dock in Light of Heart and purchased Tunings and upgrades like CLS1 and 2.

Reverted to previous version and seems to be working again.

Not sure if you are aware but there is a CTD issue with the older version 1.3 that seems to be associated with the loss of a template ship. My work around was to not use the affect auto prep ship again. Crude but worked.

Thanks for taking a look at this script. I like how it works and hope you continue to improve it.

Nicoman35
Posts: 681
Joined: Thu, 17. Nov 05, 13:12
x3tc

Post by Nicoman35 » Wed, 25. Sep 13, 17:27

paulhamm wrote:Nicoman35

I have been doing a bit of testing on your version 1.3a. The repair ship function does not seem to work. Used a Magnetar with4 repair lasers installed.
There is also a problem when upgrading larger class ships that can not dock with the auto prep ship. Failed to upgrade tunings. It did transfer cargo Mosquito Missiles. Did not purchase upgrades. Used a Chokaro with 4 Fujin ships as buyers as needed. The 10 Mistral Super Freighters should have docked at local EQ dock in Light of Heart and purchased Tunings and upgrades like CLS1 and 2.

Reverted to previous version and seems to be working again.

Not sure if you are aware but there is a CTD issue with the older version 1.3 that seems to be associated with the loss of a template ship. My work around was to not use the affect auto prep ship again. Crude but worked.

Thanks for taking a look at this script. I like how it works and hope you continue to improve it.
I only made it working for upgrading and equipping groups of ships docked at carriers. Then give the carrier the command to auto prep. I did not touch any other aspect, but my changes may well affect repair job....
I did not use any supplyer ships, so it's untested so far.
I'll have a look at this for shure, but not right now. I want to play a bit first. I don't know when I'll continue work on this....maybe you would like to have a look? :roll:

Phier
Posts: 254
Joined: Sat, 23. Feb 08, 22:23
x3tc

Post by Phier » Tue, 3. Dec 13, 07:48

I've been playing with this in AP and thanks! Just getting the upgrades alone, enmass, is fantastic.

albazeus
Posts: 76
Joined: Fri, 21. Feb 14, 17:21
x3ap

Post by albazeus » Fri, 14. Mar 14, 12:27

Is there a way to use this script for TSs or other ships that cannot dock at carriers?
I'd like to tune/buy thech upgrades/buy shield-lasers. Is it possible?
Or do you know any other script/mod/way to do this?

TIA

foszae
Posts: 139
Joined: Sat, 1. May 10, 03:14
x4

Post by foszae » Thu, 1. Oct 15, 03:15

A live version of this is still available Autumn 2015 on a site in french:
http://www.3enfamille.net/vb/showthread ... hisIsHarsh

TechSY730
Posts: 115
Joined: Tue, 26. Jul 16, 02:51
x3ap

Post by TechSY730 » Wed, 10. May 17, 04:39

Actually, I don't think the cause of the crash is the template getting destroyed. I have edited my local version to be more paranoid about making sure ships exist before trying to display anything about them, but I can still get the crash.

I am now currently suspecting that this crash can happen if you pull up the menu after you interrupted a prior Auto Prep ships task with some other task. But I can't think what could cause this; without knowing which types of scripting errors can cause a full on game crash, this is hard for me to debug...

EDIT: Progress update; so I have managed to track down the issue to something "bad" in the custom menu that is shown to configure the command before the command is run.
Once I figure out what, I will add a check to workaround it, then file a bug report as scripts should not be able to cause a crash

TechSY730
Posts: 115
Joined: Tue, 26. Jul 16, 02:51
x3ap

Post by TechSY730 » Fri, 12. May 17, 21:58

Auto Prep Ships v1.4b

This builds off the work of Nicoman35 in his unofficial 1.3a.

Changes:
  • * Fixed a crash related to displaying the prep-log (X3 will crash if a string of a too large a size is put into a custom menu). The plugin will now truncate the log to 4000 characters before trying to display it (which may mean it gets cut off mid word!)
    * You can still get the unabridged log written to a log file using the new "Write log to disk" command
    * To prevent unrestricted growth of a string that is in the save file, the full prep log is now capped at 40960 characters. This should be FAR more then enough, this is just to stop unrestricted growth
    * Fixed an issue where ships that could not dock with the prepping ship would be ignored for repairing
    * You can now specify a (player owned) station as the source to fetch equipment from, in addition to the existing ship option, in case you have a factory or equipment dock you would like to fetch supplies from
In 1.4b
  • * Fixed a bug where when gathering equipment from a station, the ship wouldn't actually dock at the station.
Auto_Prep_Ships_v1.4b_TechSY730_hack.zip:
https://drive.google.com/open?id=0B80_E ... 2h0VlVZQ2c

Rotite
Posts: 7
Joined: Tue, 22. Nov 22, 18:10

Re:

Post by Rotite » Fri, 2. Dec 22, 19:31

TechSY730 wrote:
Fri, 12. May 17, 21:58
Auto Prep Ships v1.4b

This builds off the work of Nicoman35 in his unofficial 1.3a.

Changes:
  • * Fixed a crash related to displaying the prep-log (X3 will crash if a string of a too large a size is put into a custom menu). The plugin will now truncate the log to 4000 characters before trying to display it (which may mean it gets cut off mid word!)
    * You can still get the unabridged log written to a log file using the new "Write log to disk" command
    * To prevent unrestricted growth of a string that is in the save file, the full prep log is now capped at 40960 characters. This should be FAR more then enough, this is just to stop unrestricted growth
    * Fixed an issue where ships that could not dock with the prepping ship would be ignored for repairing
    * You can now specify a (player owned) station as the source to fetch equipment from, in addition to the existing ship option, in case you have a factory or equipment dock you would like to fetch supplies from
In 1.4b
  • * Fixed a bug where when gathering equipment from a station, the ship wouldn't actually dock at the station.
Auto_Prep_Ships_v1.4b_TechSY730_hack.zip:
https://drive.google.com/open?id=0B80_E ... 2h0VlVZQ2c
Sorry for a necro.
Unable to access the file, not even archive.org has a record.

Post Reply

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