Hotkey: Scan Target Asteroid or Ship (v1.2) (28/04/2009)

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
User avatar
clevider
Posts: 343
Joined: Wed, 13. Feb 08, 00:39
x4

Hotkey: Scan Target Asteroid or Ship (v1.2) (28/04/2009)

Post by clevider » Sat, 8. Nov 08, 11:12

Scan Target Asteroid or Ship (v1.2)
Download from www.xai-corp.net

What it does
This script creates a hotkey which will cause the targeted asteroid or ship to be scanned (provided the relevant scanner is installed and the object is within scanner range). If you use the hotkey to scan an asteroid, its resource type and yield will be displayed at the bottom of the screen. For ships, a message specifying whether the contents are legal or illegal is displayed. A warning is displayed if an illegal scan is about to take place. To scan anyway, press the hotkey again within 2 seconds.


What it does not do
-The ship information screen will not be opened since the purpose of script is purely to scan for illegal wares

-Automate the search for and scanning of asteroids. There are already one or two scripts by other people for that. This is simply a hotkey for use in the ship you're currently piloting.

-Asteroid chunks and rocks (i.e., those not appearing on the gravidar or the sector map) apparently can't be scanned until something has hit them (like a laser). Until then, the game will tell the script that nothing is targeted and you'll get the "Invalid object" message. A simple work-around is to shoot the rock once. Then you'll be able to scan it. This will be corrected in a later version if I find out how.


Installing/Removing
-Install and remove using Cycrow's X-Universe Plugin Manager
-Instructions for running a script to unregister the hotkey (optional) are included in the readme. Just remember to run it BEFORE you uninstall the script ;)


**Change Log**
v1.2
--No longer asks for confirmation if scanning in a sector from whose owner a license is not available (Pirates, Xenon, etc.). My understanding is that these scans are automatically legal in the sense that there isn't any rep loss for scanning without a license in such sectors. In X3R any ship scanned in a pirate sector might turn hostile. I don't know whether this occurs in X3TC.

V1.1
--Added warning when scanning ships w/o a license
--Removed some debugging code I had missed last time


Additional Credit
-Cycrow: for the X-Universe Plugin Manager, his basic scripting guides (here), and some details on the ship-scanning cmd
-s9ilent: for explaining how to find and trigger sound events
-The Xai Corporation: for hosting scripts and their online version of the MSCI-Handbook
-Egosoft: for creating the whole X Universe
Last edited by clevider on Wed, 29. Apr 09, 06:42, edited 2 times in total.
//-- ...Signature line decrypting: 1%... --\\

Tiedyeguy
Posts: 1156
Joined: Mon, 16. Feb 04, 03:39
x4

Re: Hotkey: Scan Target Asteroid or Ship (v1.1)

Post by Tiedyeguy » Thu, 20. Nov 08, 00:53

clevider wrote:Scan Target Asteroid or Ship (v1.1)
Download from www.xai-corp.net
Limitations
-Asteroid chunks and rocks (i.e., those not appearing on the gravidar or the sector map) apparently can't be scanned until something has hit them. Until then, the game will tell the script that nothing is targeted and you'll get the "Invalid object" message. A simple work-around is to shoot the rock at least once. Then you'll be able to scan it. This will be corrected in a later version if I find out how.
Realistically, another good work around for small asteroids is the "old fashioned" way: Target, 'i', *enter*, *enter*.

User avatar
clevider
Posts: 343
Joined: Wed, 13. Feb 08, 00:39
x4

Post by clevider » Thu, 20. Nov 08, 01:32

I'd noticed that hitting 'i' popped a little description next to the target button on the sidebar, but hitting <enter> afterwards doesn't do anything in my game unless it's a full-sized asteroid (in which case it scans). For rocks, the box shows the resource type, but not the yield and this behavior is the same whether the rock has been scanned or not.

Actually, it's just occurred to me that without this hotkey I don't have any way of scanning debris. Is this just me?
Last edited by clevider on Thu, 20. Nov 08, 20:11, edited 1 time in total.
//-- ...Signature line decrypting: 1%... --\\

User avatar
Graxster
Posts: 817
Joined: Sat, 14. Oct 06, 01:01
x3tc

Post by Graxster » Thu, 20. Nov 08, 06:24

clevider wrote:Actually, it's just occurred to me that without this hotkey I don't have any way of scanning debris. Is this just me?
Not sure, since I deleted all the debris out of my game. I *did* use a script to reveal all the debris content previously tho. Like so:

Code: Select all

Arguments

     sec , Var/Sector , 'Select a Sector'

001   $array.debris =  find debris: sector=$sec resource=null min yield=null flags=[Find.Multiple] refobj=null num=9999 max distance=null refpos=null
002   $n =  size of array $array.debris
003   while $n
004   |dec $n = 
005   |$rock = $array.debris[$n]
006   |$rock -> set asteroid scanned to [TRUE]
007   end
008   return null
I suppose that's cheating tho, lol.

-Grax

User avatar
clevider
Posts: 343
Joined: Wed, 13. Feb 08, 00:39
x4

Post by clevider » Thu, 20. Nov 08, 21:55

Graxster, it was worth a shot but apparently neither getting the debris array nor setting them to "scanned" makes the rocks become "active" and with "get player tracking aim" returning NULL for inactive objects, I can't tell which rock in the array is the right one. Also, since the player (maybe just me? I'm still unclear on that) can't view debris yield through the game interface (i.e, by pressing 'i'), having scanned the object doesn't do them any good.

I think I'm going to post this problem in the Generic Questions thread. That seems like a more appropriate place... If I'm misunderstanding something or if anyone has any more ideas, I'd sure like to hear them though.
//-- ...Signature line decrypting: 1%... --\\

angrysquirrel
Posts: 267
Joined: Tue, 18. Nov 03, 00:46
x3

Post by angrysquirrel » Sun, 23. Nov 08, 08:30

Hi Clevidar!

I like your script! One thing I think would be a great addition though would be to make two scripts that autoscan the target.

So, you install the autoscanner for illegal wares and once its installed (you can use a hotkey toggle to turn it on or off) you don't have to keep pressing a key to scan the target.

Here is one I used to use for X3

JMCorp Auto Freight Scanner

http://forum.egosoft.com/viewtopic.php? ... utoscanner


You could make another scanner to do that for minerals. Just fly by the rock and it gets scanned.

User avatar
clevider
Posts: 343
Joined: Wed, 13. Feb 08, 00:39
x4

Post by clevider » Sun, 23. Nov 08, 17:54

That's an interesting idea, angrysquirrel, but since this is my first script it'll be a while before I've learned how to write (and debug) an expanded script like that. It's something to work toward, at least.

It did give me an idea on how to somewhat ameliorate the can't-scan-smaller-rocks-without-shooting-them-first bug, however...
//-- ...Signature line decrypting: 1%... --\\

jiunejai
Posts: 56
Joined: Fri, 4. Mar 11, 08:47
x4

Post by jiunejai » Sun, 5. Jun 11, 14:21

How about auto rename the target ship that player scaned to add "(Scaned)" behind it's original ship name?

as:

Terran food transporter => Terran food transporter (Scaned)

I think that will be helpful during Freight Scan Mission to find which ship player haven't scan yet.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Sun, 5. Jun 11, 14:37

Since the scripter hasn't been around this year you might have more luck changing the script yourself.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

jiunejai
Posts: 56
Joined: Fri, 4. Mar 11, 08:47
x4

Post by jiunejai » Tue, 7. Jun 11, 14:12

Oooooohhhhhh!Nnnnnnoooooo!!!

It's unlucky to me, really.
I have no idea that how to write a script at all.
I can't even read the script since I don't know any script command stands for.

Post Reply

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