[SCRIPT] Target Nearest Unclaimed Ship v1.2

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

Post Reply
mailleweaver
Posts: 76
Joined: Wed, 4. Nov 09, 04:39
x3tc

[SCRIPT] Target Nearest Unclaimed Ship v1.2

Post by mailleweaver » Sun, 14. Feb 10, 23:01

My first script. Hope someone finds it useful.

Description:
  • 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:
Installation:
  • [ external 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, 02:11, edited 6 times in total.

ITFUncleDave
Posts: 163
Joined: Fri, 27. Jun 08, 18:47
x3fl

Post by ITFUncleDave » Sun, 14. Feb 10, 23: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:

mailleweaver
Posts: 76
Joined: Wed, 4. Nov 09, 04:39
x3tc

Post by mailleweaver » Sun, 14. Feb 10, 23: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.

mark_a_condren
Posts: 1468
Joined: Wed, 3. Aug 05, 05:05
x3tc

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

mailleweaver

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.

MarCon

mailleweaver
Posts: 76
Joined: Wed, 4. Nov 09, 04:39
x3tc

Post by mailleweaver » Tue, 16. Feb 10, 00: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
Toastysoul
Posts: 69
Joined: Fri, 3. Feb 06, 05:00
x4

Post by Toastysoul » Tue, 9. Mar 10, 05: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!

corbinbird
Posts: 49
Joined: Tue, 2. May 06, 18:58
x3tc

Astronaut bug - not really

Post by corbinbird » Sat, 13. Mar 10, 19: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.

Cheers.

SimonSmee
Posts: 3
Joined: Tue, 3. Nov 09, 20:44
x3tc

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?

mailleweaver
Posts: 76
Joined: Wed, 4. Nov 09, 04:39
x3tc

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”