[SCRIPT] Target Nearest Unclaimed Ship v1.2

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

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

Post Reply
Posts: 68
Joined: Wed, 4. Nov 09, 05:39

[SCRIPT] Target Nearest Unclaimed Ship v1.2

Post by mailleweaver » Mon, 15. Feb 10, 00:01

My first script. Hope someone finds it useful.

  • Allows you to set a hotkey to target the nearest unclaimed ship that is within scanner range of player owned ships. It will ignore ships that are currently out of scanner range of player owned ships, and it will also ignore astronauts.

    :!: Requires:
  • Image<---download

    Click the SPK link above to download the file.
    Open Plugin Manager, click on "install package," browse to the file you just downloaded, click "ok," and click "install."

    Upgrade: Open Plugin Manager, select "Target Nearest Unclaimed Ship," click uninstall, then follow the above instructions for installation of the new file.
Permissions/Thanks: Changelog::
  • 1.0 - First Release.
    1.1 - Fixed some erratic selection behavior.
    1.2 - Fixed a bug where astronauts could be targeted if their pilot name was not set. Also got rid of the zip files because Plugin Manager is required for the Hotkey Manager anyway.
Last edited by mailleweaver on Tue, 7. Dec 10, 03:11, edited 6 times in total.

Posts: 152
Joined: Fri, 27. Jun 08, 18:47

Post by ITFUncleDave » Mon, 15. Feb 10, 00:24

Very interesting, i'm glad someone with more skill was able to fix that astronaut bug, I wish i had had the time and patience to do it myself, but regardless, Good job! :thumb_up:

Posts: 68
Joined: Wed, 4. Nov 09, 05:39

Post by mailleweaver » Mon, 15. Feb 10, 00:42

I've always been a DIY kind of guy, so decided to fix it myself. Little did I know how involved it would really be. If you look at the code, you'll see that it doesn't resemble yours at all anymore; I ended up having to rewrite the whole thing from scratch. It seems like such a complicated way to do a simple thing, but I couldn't find any other way. Oh well -- whatever works. Thanks again for the original; I never would have attempted this without it.

Posts: 1385
Joined: Wed, 3. Aug 05, 05:05

Post by mark_a_condren » Mon, 15. Feb 10, 15:56


Hello fellow scripter, Congrats on your first script. :wink:

Will it be the first of many or have you had enough?
Sometimes it takes a while for the hair to grow back after you pull it all out. :D

Have DL'ed it and will take it for a spin as soon as i get a chance to play rather than script.


Posts: 68
Joined: Wed, 4. Nov 09, 05:39

Post by mailleweaver » Tue, 16. Feb 10, 01:53

I'll make more if the opportunity arises, but I probably won't go looking for stuff to script. This one was just to fix a must-have script that was a good idea but underdeveloped enough to be a real annoyance. (I guess kind of like many of the vanilla features that people have created so many scripts to fix.)

User avatar
Posts: 67
Joined: Fri, 3. Feb 06, 06:00

Post by Toastysoul » Tue, 9. Mar 10, 06:19

Take a look here: http://forum.egosoft.com/viewtopic.php?t=251694

I don't know if they fixed in X3TC the problem that was causing the find ships command to also find astronauts, but I had to take a different approach when I wrote my script last year. Too bad you hadn't seen it, it could have saved you some time as you'd only need to correct a small flaw in the setup script (no hot key check! :oops:) and make any necessary changes between X3R & X3TC.

Anyway, congrats your first scripting venture was successful!

Posts: 48
Joined: Tue, 2. May 06, 18:58

Astronaut bug - not really

Post by corbinbird » Sat, 13. Mar 10, 20:47

The astronaut bug seems to have been created by Voxol's BailSignalExtension 2.1 . All the spawned Astronauts are auto set to [Neutral Race]. It is getting a sort set up for "No Pilot' and no Astronauts that is the problem.


Posts: 3
Joined: Tue, 3. Nov 09, 21:44

Links not letting me DL files

Post by SimonSmee » Mon, 20. Sep 10, 19:38

I go to website click on DL file and get this error:

Can't select categories or not type in links.php

I am missing something?

Posts: 68
Joined: Wed, 4. Nov 09, 05:39

Post by mailleweaver » Fri, 8. Oct 10, 06:31

Sorry, I've been away for quite a while and have been keeping a new version away with me. The original script had some problems. A few weeks ago I asked the moderator for the FileFront X3TC site to get it removed and upload my new one. Unfortunately, the entire FileFront network was having some work done and he couldn't do it right then. I only just remembered to check up on it again. I guess he removed the files, but left the pages there. I've uploaded a new version into the generic FileFront site (where I can upload and delete files without having to involve a moderator) and updated the links in the opening post.

Edit: An even newer version up now (1.2). I thought of a way to finally fully fix the astronaut bug (for sure this time). Funny thing is, after reviewing the help I got from EmperorJon and mark_a_condren (link to the topic is in the OP), they told me how to do it way back then. If only I'd had enough experience to see it. Thanks, guys, for being patient enough to help a new scripter even though it meant you were trying to bring light to the blind.

Post Reply

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