[SCRIPT] Ship Claim System MK1 - v1.02 2007-02-21

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

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

Greg_G
Posts: 110
Joined: Tue, 26. Apr 05, 19:15
xr

[SCRIPT] Ship Claim System MK1 - v1.02 2007-02-21

Post by Greg_G » Fri, 16. Feb 07, 01:34

Ship Claim System MK1
http://x3.bitspring.com/scs/
(I urge you to read the above webpage instead of this forum post first as it's much
easier to read. Then please return here to read/post comments.
)
requires Community Extended Mod Pack (EMP)

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 w/ Custom Wares Enabled)

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.

[ external image ]
[ external image ]
[ external image ]

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 recplacement 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 and others
neumanf15 and reinhart_menken for their help investigating custom wares issues

Personal Note:
I had previously stated that I wasn't going to release this publically unless there
seemed to be community interest (of which there was none). However, after finishing
it, I was so proud of the result I just had to polish it up and release it. I really hope
y'all like it. I do! :D

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/ShipClaim ... 2.2007.spk
Uninstall Script v1.02: (Right-click->Save Target As...)
http://x3.bitspring.com/files/setup.plu ... nstall.xml
Last edited by Greg_G on Thu, 22. Feb 07, 02:23, edited 6 times in total.

reinhart_menken
Posts: 229
Joined: Sat, 27. Jan 07, 05:23

Post by reinhart_menken » Fri, 16. Feb 07, 02:33

Hey, this is great! I've been getting tired of getting all the capped ships by myself lately and was just wondering if there's any script for this. Just excellent! Thank you :) Will try it out right away after I finish this X3 gaming "session" ;)

One question though, would a carrier ship not crash into the smaller ship and thus destroy it? I've tried to get close to a TL, and even when I am right next to the bracket I am still xxxkm away from it, hence my question =/

Greg_G
Posts: 110
Joined: Tue, 26. Apr 05, 19:15
xr

Post by Greg_G » Fri, 16. Feb 07, 03:18

reinhart_menken wrote:Hey, this is great! I've been getting tired of getting all the capped ships by myself lately and was just wondering if there's any script for this. Just excellent! Thank you :) Will try it out right away after I finish this X3 gaming "session" ;)
Please let me know how it goes. This is by far my most sophisticated script and I'd love to hear if it's working properly for people.
reinhart_menken wrote:One question though, would a carrier ship not crash into the smaller ship and thus destroy it? I've tried to get close to a TL, and even when I am right next to the bracket I am still xxxkm away from it, hence my question =/
Aye, I was concerned with this as well. Obviously, this is not an issue for OOS, but is a potential issue for IS. Therefore, I made the margins intentionally large. Ships only need by 5 km away before the device can begin the claim process.

Obviously, input from users will be critical in my adjusting such margins. If folks find crashing into ships an issue, I'll adjust as best I can.

Of course, there's nothing I can do about the fact that a TL moving through a system while you are in-system is a bull in a china shop. That's just the way it is in X3. So in cases where you are using a huge ship, you might want to go OOS and all will be well. :)

neumanf15
Posts: 259
Joined: Mon, 26. Dec 05, 19:55
x3

Post by neumanf15 » Fri, 16. Feb 07, 04:54

Sounds awesome. Downloading and will try it!

User avatar
defiant1
Posts: 1141
Joined: Sun, 7. May 06, 03:53
x4

Post by defiant1 » Fri, 16. Feb 07, 05:36

hmmm interesting...i got it working...clamed a couple ships then they just "hung" IE not moveing...i hoped into them and then all was fine since i was piloting it...but as soon as i left it just stoped and sat thier as if it were trying to say "no im not going" to me...so i had to drag its @$$ back to my hq (which i some how lost i think...) and once i got it to the player hq it docked and was dandy and ready to do my bidding...was that supposed to happen???? if not what might have caused this?? (this was an excellsior class ship btw which is about M6/5 class (approximit) and my understanding is that this works all the way to M4...
Teladi Next Minute Shipping®

Greg_G
Posts: 110
Joined: Tue, 26. Apr 05, 19:15
xr

Post by Greg_G » Fri, 16. Feb 07, 05:39

Just to be clear on what happened, did you transport into/out of the ship that was running the SCS MK1? If so, that's a no-no for any (task 0) script. In my experience, whenever you transport into or out of a ship whatever script it is running is aborted (drives me nuts!). Or am I misunderstanding you?

User avatar
defiant1
Posts: 1141
Joined: Sun, 7. May 06, 03:53
x4

Post by defiant1 » Fri, 16. Feb 07, 05:58

i tryed that also...first when i transported it aborted (as i was hopeing it would) and i reenabled it and then transported out and it just sat thier like it was compleatly dead...

isnt it supposed to move off somewhere or do somthin cus i toled it to find ships and clame them and return to my mammoth (the really big argon ship that is usually seen around argon prime) when it was finished with its clamming...
Teladi Next Minute Shipping®

reinhart_menken
Posts: 229
Joined: Sat, 27. Jan 07, 05:23

Post by reinhart_menken » Fri, 16. Feb 07, 06:15

Argh!! Just capped a ship to be claimed after a BBS Merc mission and my Elephant came out of nowhere then the LX I am piloting ran into it :evil::rofl: That was a 20 - 30 minute skirmish too, being a level 2 merc mission (Cycrow's). That's what you get for ordering the elephant to follow you and then forget about it :lol:

User avatar
defiant1
Posts: 1141
Joined: Sun, 7. May 06, 03:53
x4

Post by defiant1 » Fri, 16. Feb 07, 06:36

oops?..nvm i think i got it workin./..seemes some other command(s) some how inadvertantly conflicted with the salvage software...(oops) i removed my script that ive been trying to write as well (was supposed to be advanced salvage software but this does pretty much all i wanted it to do) and it works 100% no issues...now i just need to tracter my shuttles back in...fun...(got about 30+ shuttles...
Teladi Next Minute Shipping®

reinhart_menken
Posts: 229
Joined: Sat, 27. Jan 07, 05:23

Post by reinhart_menken » Fri, 16. Feb 07, 07:57

It worked beautifully OOS (didn't try IS) :) One problem though, I'm afraid it's something similar to defiant1's. My ship does claim and then order the other ships to dock at it, but then it just sits there, not jumping or moving to the station I input it to =/

Greg_G
Posts: 110
Joined: Tue, 26. Apr 05, 19:15
xr

Post by Greg_G » Fri, 16. Feb 07, 08:09

Just so I'm clear, is it the ship that was ordered to dock that just sits there? If so, I ran into this once or twice during my own testing. The SCS MK1 orders the ship to dock once, waits 3 minutes, orders it again, then waits 7 more minutes before giving up and moving on to the next ship. Usually this works out fine, but during just one of my tests, neither order worked. The claimed ship sat there with the correct order showing (Dock at...) but it didn't do so.

I'm not sure if this is a bug in the SCS MK1 or not, since it's just giving the claimed ship a standard docking order and the claimed ship is showing that it received it. (I can't spam the dock command too much because if the ship is actually docking but is very slow, and then receives another docking command near the completion of docking, it'll start over again.)

So for now, give it at least 5 minutes (enough time for both docking commands to be sent) and see if that does it. If this keeps happening, I'll investigate it further.

reinhart_menken
Posts: 229
Joined: Sat, 27. Jan 07, 05:23

Post by reinhart_menken » Fri, 16. Feb 07, 08:53

Actually, it's the carrier that isn't doing anything. My apologies for not making it clear before. My Eelephant had picked up five capped ships and ordered each of them to dock at itself with success, but then the Elephant just sits there.

As for your docking problem, it might have to do with angle of the carrier, as I have tried to tell my fleet return home too and told the carrier to standby, but somehow some of the fighers just wouldn't dock. When I gave the carrier a new order to follow me, which caused it to move, the fighters started moving again. Maybe you could try and make the carrier issue itself an order to move around a little if the claimed ship isn't docking; but that would be tricky check though since some of the damaged ships might just be slow =/

Greg_G
Posts: 110
Joined: Tue, 26. Apr 05, 19:15
xr

Post by Greg_G » Fri, 16. Feb 07, 09:02

On the second issue, aye, if it becomes a problem I'll address it, but in my tests it was very rare and only in-sector.
reinhart_menken wrote:Actually, it's the carrier that isn't doing anything...then the Elephant just sits there.
Okay, let me see here. First off, were there any more unclaimed ships still to be claimed in the sector? I'm assuming not. Second, and much more importantly, what "secondary input" did you give when you activated the SCS (where it asks for a ship or station)? Third, did it still show that it was running the command? Lastly, did you receive an incoming message report?

Edit: For anyone who has this or any other issue, if you want to help me diagnose, but don't feel like editing the script yourself to enable debug logging, simply replace the existing script in your X3 scripts directory with this one and (re)start X3 [SCS MK1 version 1.00 only]:
OLD VERSION-LINK REMOVED (Right-click->Save Target As...)
Then, any time you use the SCS MK1, it will record a whole bunch of useful information (to me) in the log08765.txt file in the X3 root directory but only for the most recent SCS operation (so the log file doesn't just keep growing), so make sure the problem occured on the most recent use of the SCS MK1. When sending me logs, please use PMs and not forum posts.

Edit 2: I've confirmed this bug. I know what's wrong but I probably can't fix it until tomorrow. I'll post 1.01 tomorrow with this fixed. Sorry for the trouble.

Edit 3: I've made a pre-release 1.01 if anyone wants to try it. It fixes the problem folks were having above. I'm not going to release it officially until about 12 hours from now at which point I'll have had a chance to make sure the package is okay. But just in case anyone wanted the untested release: OLD VERSION-LINK REMOVED
(What a silly, careless mistake, I had used get volume of ware instead of get volume of ware in cargo bay so it was returning 1 instead of 0 for the presence of the Advanced Jumpdrive on ships that didn't have it. Hopefully this will fix this problem for y'all. It works properly now for me.)
Last edited by Greg_G on Fri, 16. Feb 07, 20:38, edited 1 time in total.

reinhart_menken
Posts: 229
Joined: Sat, 27. Jan 07, 05:23

Post by reinhart_menken » Fri, 16. Feb 07, 13:09

Great, will test it as soon as I get out of classes this afternoon today :) And no problem with the script, it was still very useful before ;)

User avatar
defiant1
Posts: 1141
Joined: Sun, 7. May 06, 03:53
x4

Post by defiant1 » Fri, 16. Feb 07, 18:11

w000t!!! should i remove the older version (IE turn it off and uninstall the spk for the older version) and install this or does this need the older one still? (im guessin it wont need it so i can remove it)
Teladi Next Minute Shipping®

Greg_G
Posts: 110
Joined: Tue, 26. Apr 05, 19:15
xr

Post by Greg_G » Fri, 16. Feb 07, 19:05

Version 1.01 is officially tested and released. See the original post for the download link. The jumping problem seems to be resolved.

Simply install the 1.01 SPK whether or not you had 1.00 installed. There is no need to uninstall 1.00.

User avatar
defiant1
Posts: 1141
Joined: Sun, 7. May 06, 03:53
x4

Post by defiant1 » Fri, 16. Feb 07, 23:04

YEAAA...once i get off of work ill try to go clame some other ships that i find...hehe
Teladi Next Minute Shipping®

reinhart_menken
Posts: 229
Joined: Sat, 27. Jan 07, 05:23

Post by reinhart_menken » Sat, 17. Feb 07, 04:04

Just got a chance to test out the script and it works great! Congratulations! :) Everything works now (at least the ones I tried). I had my carrier collect ships and then jump to shipyards and drop them off.

It was a little bit off of the distance from which I usually manually drop my ships off though, but I was always really close to the shipyard before I drop the ships. What I did was I dock my carrier to the shipyard (guess you can't do that with M2 or M1s), tell it to idle(cause undock) and then tell it to standby; after that I tell the salvaged ships inside the carrier (which is now standing by) to dock the shipyard, and they're docked within a second or two. Of course, it would not be this fast IS.

I didn't really care for the carrier going back to the sector after all the ships have been salvaged though, since I usually have to carry those ships off to somewhere else to either upgrade them/equip them or etc. A nice addition to the message that tells me the Ship Salvage Software MK1 is finished (displaying ships stat and all) would be to ask if I want the carrier to remain where it is (where it drops the ships). However, I imagine this would get rather annoying if it has to be repeated over and over for someone who does this a lot =/

I don't mean to complain or anything. Just want to give you some feedback so you can do with it what you will ;)

User avatar
defiant1
Posts: 1141
Joined: Sun, 7. May 06, 03:53
x4

Post by defiant1 » Sat, 17. Feb 07, 04:46

will it let my ship (the one im in) also scan for salvageable ships? or does it only use the sats?

also do i need script manager/editor thing running?
Teladi Next Minute Shipping®

Greg_G
Posts: 110
Joined: Tue, 26. Apr 05, 19:15
xr

Post by Greg_G » Sat, 17. Feb 07, 06:03

reinhart: I'll give all that some thought. Thanks for the input. I'm glad it's working. One note, I intentionally included a 30 second delay after it sends the incoming message report but before it returns to the start position for you to have a chance to idle it or give it another order. If you like, you can adjust that time value up as much as you like. That value is set at the very top of the plugin.scs.main script. Move down/right till the value is red, hit enter, scroll down to <number>, hit enter, type in a new number in milliseconds, hit enter, hit escape, 'yes', enter and voila. :D

defiant1: yes, it will use the scanners onboard the ship as well (or any other ships of yours in the sector) in addition to satellites. So be sure to use a triplex scanner. Nevertheless, that'll never be nearly as effective as a network of satellites. Not sure what you mean with your second question though. It's an unsigned script so the script editor has to be unlocked. Everything that needs to be done is listed in the installation instructions.

Post Reply

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