Ship Claim System MK1
http://x3.bitspring.com/scs/
  requires Community Extended Mod Pack (EMP)

For discussion, technical assistance, and suggestions go to:
http://forum3.egosoft.com/viewtopic.php?t=171458

Developed for:
   X3-Reunion 2.0.02                (REQUIRED)
   Bonus Pack 3.1.05       
   Community Extended Mod Pack 2.01 (REQUIRED)
   Cycrow's Script Manager          (REQUIRED)
 
Uses:
   EMP Ware:  192 (28;0;0;0;0;192;11163;0;56573;1;1;0;56573;0;0;0;SS_WARE_SW_CUSTOM12_6;)
   T File:    8765 (448765.xml)
   Command:   647  (In Piracy Menu)
   Page ID:   8765
   Debug Log: log08765.txt (disabled by default)

What it does:
   Ahoy Matey.  Ship Claim System MK1 is a sophisticated hardware/software solution
which automates the tedious chore of claiming all detected, abandoned ships in a 
sector.

The system operates differently depending upon the ship which runs it and the 
ship/station input:

Scenario 1: Ship with available docking bays; input set to self
Ship will travel to the assigned sector, it will approach the nearest abandoned
ship, claim it, and order it to dock with itself.  It will continue doing so until 
either all docking bays are full or there are no remaining detected, abandoned 
ships.  If the former, it will travel back to its starting position, release all 
claimed ships, and return to the sector to continue the procedure.  When complete, 
the ship will retain all docked ships and then travel to the starting position from 
which the command was issued.

Scenario 2: Ship with available docking bays; input set to station
Ship will act as in Scenario 1, however, if all docking bays are full, the ship
will jump to the "input station", release all the claimed ships, order them to dock
at the "input station", and return to the sector to continue the procedure.  When
complete, it will jump to the "input station", release all the claimed ships, order
them to dock at the "input station", and then travel to the starting position from
which the command was issued.

Scenario 3: Ship with available docking bays; input set to any other object
Ship will act as in Scenario 1, however, if all docking bays are full, the ship
will jump to the vicinity of the "input object", release all the claimed ships which
will idle near the object, and return to the sector to continue the procedure.  When
complete, it will jump again to the vicinity of the "input object", release all the 
claimed ships which will idle there, and then travel to the starting position from
which the command was issued.

Scenario 4: Ship with no available docking bays; input set to station
Ship will travel to the assigned sector, it will approach the nearest abandoned
ship, claim it, and order it to dock at the "input station" regardless of distance.
It will do this for every detected, abandoned ship in the sector.  When this task is
complete, it will then travel to its starting position from which the command was 
issued.  The claimed ship will have "(autoclaimed)" appended to its name to make
it easier to locate in the ship listing.

Scenario 5: Ship with no available docking bays; input set to self or anything else 
Ship will travel to the assigned sector, it will approach the nearest abandoned
ship, claim it, and order it to dock at a nearby station in the following order
of precedence: [1] Homebase (of claiming ship...if any), [2] Shipyard, [3] Any 
other Station.  It will do this for every detected, abandoned ship in the sector.  
When this task is complete, it will then travel to its starting position from which 
the command was issued.  The claimed ship will have "(autoclaimed)" appended to its 
name to make it easier to locate in the ship listing.

A report will be sent to the pilot when the procedure is complete.







Installation:
   Use Cycrow's Script Manager to install the SPK file.  The Script Editor must
be activated as this is not a signed script.

If (and only if) upgrading from version 1.00 or 1.01 (the versions that used custom 
wares), you must:
1) Activate the Remove Scripts (uninstall) function in the Script Manager
2) Exit the Script Manager
3) Start X3 and load your save game
4) Save a new save game and exit X3
5) Install the most recent SCS MK1 SPK.

Where to buy:
   The SCS MK1 is available to all at your local Pirate Base for the reasonable sum 
of ~1.6 million credits.
How to use it: The SCS MK1 can be activated in the Command Console in the Piracy section. It takes two parameters for input: 1) Sector in which to perform the operation 2) Any ship or station as secondary input (see the scenarios in What it does for details on what to select; it is safe to select the ship itself for default behavior) Usage Notes: 1) Ships already docked in a ship using SCS MK1 will not be undocked at any point in this procedure. This way, a normal fighter contingent will be unaffected by the SCS MK1. 2) This technology has its limitations. Only abandoned ships detected by your ships or satellites will be claimed. 3) Claiming a ship remotely is a complex task. The SCS MK1 will usually have to make multiple attempts to claim a ship. Each attempt takes approximately 10 seconds and has approximately a 20% chance of success. The SCS MK1 will keep trying until it succeeds. 4) After completing its task, the software will send the user a report of its activities. After this, the user has a predetermined amount of time to issue any other commands before the ship will return to the location from which it was originally issued the command. 5) If installed and available on the ship, the Energy-Free Advanced Jumpdrive will be used for travel instead of the normal jumpdrive, eliminating the need for a supply of energy cells. 6) Maintaining a network of navigational or advanced satellites greatly improves the effectiveness of SCS MK1. I highly recommend Cycrow's SEWN script and its satellite replacement technology for helping maintain your satellite network. 7) The SCS MK1 works well both in and out of sector, and on either piloted or unpiloted ships. The docking sequence takes a bit longer when in-sector. There are audio queues during the claim attempts when the ship is piloted. IMPORTANT NOTE: THIS IS A NEW SCRIPT. THERE MAY BE BUGS IN IT AND THIS SHOULD BE CONSIDERED A PUBLIC BETA TEST. I chose all currently unused command slots, etc., however, I will not seek official "dibs" on them until such time as folks feel that it is worthy. Obviously, I'd appreciate if other script authors would avoid these for the time being. At least until we see if anyone other than me wants to use this script. Known Bugs: 1) None currently known... (If anyone encounters problems, let me know here and I'll fix it ASAP!) Future: 1) A MK2 variant which will search the entire galaxy for detected, abandoned ships would be possible. This could either be written as a primary task performed only when ordered or as an "additional ship command" that runs continuously and checks periodically. (I really like this second idea, although "additional ship command" slots are a precious commodity.) 2) Adjust the chance per claim attempt according to factors like the class of the ship being claimed and/or other factors. 3) Add the ability to transport ships into docking bays instead of the full docking sequence. (Honestly, I rather like the full docking sequence, so I'm leaning towards not adding this.) 4) Include number of trips (for docked runs) and total time elapsed in the report. Files in Package: plugin.scs.main.xml plugin.scs.search.xml plugin.scs.jumpto.xml plugin.scs.claim.xml plugin.scs.offload.xml plugin.scs.movetosectorpos.xml setup.plugin.scs.xml setup.plugin.scs.uninstall.xml lib.bitspring.isdockingpossible.xml lib.bof.scs.sort.num.2ar.xml 448765.xml readme-SCS.txt Uninstall: Use the Script Manager to remove script files. This should install the uninstall script automatically. After loading a save game, this script should run and remove remove the command slot and hotkey registration. I suggest stopping the CCD from running on all ships and ensuring their original cargo is intact before uninstalling. If this doesn't happen, manually copy the uninstall script (available for download below) to your X3 scripts directory. Be sure to remove the uninstall script before re-installing SCS. You never want both setup.plugin.scs.xml and setup.plugin.scs.uninstall.xml installed in your scripts directory at the same time. Advanced Configuration/Troubleshooting: There are a few user-adjustable variables in the main script (plugin.scs.main.xml) for those interested. They are marked clearly and are in the first page of the script. Additionally, the debug log can be enabled by removing the comment on the indicated line. For those with problems with the SCS MK1, I request that, if you are able, enable this, restart X3, recreate the problem, and send me the log08765.txt that will be produced in your X3 root directory. History: 1.00 - Original Release 1.01 - Fixed a bug causing jumps to fail Tweaked approach margins for ships to stations to improve in-sector approaches 1.02 - Replaced use of custom wares with use of the community EMP due to problems some users were having with custom wares. Thanks: Again to all the tutorial authors Cycrow (for lots of things) B-O'F (for the inspiration for this script and his sorting library) al_main, et al. neumanf15 and reinhart_menken for their help investigating custom wares issues Download: *If upgrading from 1.00 or 1.01, you must follow the special instructions in the Installation section above* SPK Package v1.02: http://x3.bitspring.com/files/ShipClaimSystemMK1-V1.02-21.02.2007.spk Uninstall Script v1.02: (Right-click->Save Target As...) http://x3.bitspring.com/files/setup.plugin.scs.uninstall.xml