[S][23.08.07][1.51] Optimized Targeting - Final Version

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

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

User avatar
X-Freak Cartman
Posts: 4017
Joined: Mon, 2. Oct 06, 15:08
x3

[S][23.08.07][1.51] Optimized Targeting - Final Version

Post by X-Freak Cartman »

German Topic

In Anger of the X3 Targeting (where you can switch through the targets depending on the angle they're on the HUD), I wrote that script to get my old X2 targeting behaviour back.
The Side-Effect are 8 new hotkeys including 6 new targeting possibilities and a way to get enemies in range of the turrets you chose.
Of Course, the next enemy, cargo container or missile is selected after it left the sector or is being destroyed. This happens within less than half a second, so you can directly attack or collect it.
The readme wrote:Optimized Targeting 1.51

Description : Replaces the unhandy Egosoft-targeting and adds some new hotkeys and features for targeting.
Version : 1.51
Date : 23.08.2007
Author : X-Freak Cartman


###########################################################################


Installation:
¯¯¯¯¯¯¯¯¯¯¯¯¯
Extract the zip-file into your X3-folder.
The files should be at the right place from then.

When you've installed the files, load one of your savegames or start a new one. Now you'll find the new hotkeys in the options-menu under 'controls' / 'interface'. Scroll down to configure them.
Those hotkeys won't be used, so you can configure them how you want it. It's recommended that you replace the standard targeting-hotkeys by the new controls (in QWERTY Keyboard Layout)


Recommended configuration:
Next player property - Ins
Previous player prop. - Enft
Next enemy - Pos1
Previous enemy - End
Next target - Page up & mouse-wheel up
Previous target - Page down & mouse-wheel down

Now it's the sense of this script that you replace the old targeting hotkeys.

Recommended configuration for the new features - this is my own configuration, which has been established since mazuras in my personal X-Universe:

Next station - Shift+Page up
Previous station - Shift+Page down
Next carrier - Shift+Ins
Next cargo container - Shift+Del
Next adverse cap. ship - Shift+Pos1
Next missile - Shift+End

Enemy-searching mode - Shift+Backspace
Enemy-searching turret - Shift+=

Next scanned asteroid - Shift+;
Next unscanned asteroid - Shift+'
Next warpgate - Shift+#

It's possible that you have to re-configure your settings if you update the Optimized Targeting. I'm trying to use as few hotkeys as possible, but you may have to configure some new keys.

Changelog from older version to this one:

1.2 : Searching for ware-containers
1.21 : Searching for missiles
1.22 : Enemy-searching mode
1.24 : turret for enemy-searching
1.31 : all hotkeys - there was an translational error in version 1.31

Besides, the old hotkeys will remain. If this is the first installation, you have to configure all of the hotkeys.

If you want to get missiles targetted when looking for enemies, you need to set an AL-Option.

Usage:
¯¯¯¯¯¯
If you've installed the scripts and defined the hotkeys, you can use the Optimized targeting. The targets will be selected like this:
Next ~ - the next afar object will be selected.
Previous ~ - the next close object will be selected.

The enemy-selection, the missile-selection and the cargo container-selection support special features:
If the current target leaves the sector, gets destroyed or picked up, a new target of the same type will be selected immediately. For example, if you destroy an enemy, you'll have get the next enemy ship.

-> it takes the work from you - you don't have to press the key again. A Script for lazy people ;)


The enemy-searching (next/previous enemy) additionally supports the searching-modes. If you press the accordant hotkey, the mode will change and you'll hear an acustic signal.

>Out of order<
-> If you press 'Previous/next enemy', the areal nearest enemy will be selected. This doesn't consider cockpit positions and laser-firing ranges.

>Warning: selected<
-> The Hotkey will only search for enemies attacking or trying to attack your ship. This way, you're able to protect yourself as effective as possible.

>Laser 'XYZ': Restricted access'<
-> Turret 'XYZ' will only search for enemys within its firing range if no other enemy has been selected previously. You can change this turret with the hotkey 'Enemy-searching turret'.

>Laser 'XYZ': selected<
-> Turret 'XYZ' will search for enemys which are in the firing range of the installed weapons. If a selected target leaves the firing range, the next target which is in the range will be selected automatically. You can change this turret with the hotkey 'Enemy-searching turret'.


The 'XYZ' is a greek letter, which accords to the turret number:

Alpha - Cockpit
Beta - First turret
Gamma - Second turret
Delta - Third turret
Epsilon - Fourth turret
Zeta - Fifth turret
Eta - Sixth turret
...

With the hotkey 'Enemy-searching turret', you can change which turret should be considered for searching the next target. Here, for example, the Hyperion:

Alpha - Cockpit
Beta - Rear turret (Nr.1)
Gamma - Rear turret (Nr.2)
Delta - Front turret (Nr.1)
Epsilon - Front turret (Nr.2)

And at the Mamba Raider, the rear turret is 'Beta', for example.

If you switch the turret, it will be checked if there are any weapons installed, cause it doesn't make sense to search enemies in a non-existent firing range. Tractorbeams don't count to weapons.

If there's no weapon installed, the script deactivates the enemy-searching mode, which it'll tell you acoustical.

If you turn on the enemy-searching mode, the first turret with installed weapons will automatically be selected.
For example, if you fly a Teladi Vulture, which has a rear-turret and no front weapons, it's senseless to activate the enemy-searching mode, apart from that you're in the turret yourself.
If you change your ship, the settings from the previous ship will be taken over - But the cockpit will be selected as the turret for enemy-searching. Pressing the mode changing hotkey after changing the ship will tell you the current mode instead of changing the mode.

If you want to use the six additional features, you have to install the Special Command Software MK I in your Ship
(stations, carriers, ware containers); Fight Command Software MK I (adverse capital ships); and MK II (missiles).


Uninstallation:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
There are two possibilities for uninstalling this script package:

First, you can simply run the script "plugin.targeting.uninstall" using the ScriptEditor. Every single hotkey will be uninstalled. Afterwards, you have to remove the script files.

The second way is to copy the file "!setup.plugin.targeting" from the Uninstall-folder to your "X3 Reunion\script"-directory.
Then, you need to load your savegame, confirm the uninstall-message, set the old hotkey configuration, save your game and close X3. Now, you have to remove the targeting-scriptfiles (every file with "targeting" in its name, please don't remove the lib-files)

X-Freak Cartman isn't liable for eventual disadvantages, the usage of this script happens at owner's risk.

Ressources:
¯¯¯¯¯¯¯¯¯¯¯
Files:
scripts\
!setup.plugin.targeting.xml
al.targeting.missiles.xml
lib.ad.racetoraceinteger.pck
lib.cm.find.gates.xml
lib.cm.interrupt.xml
lib.cm.isdecouplingkhaak.xml
lib.cm.isenemy.xml
lib.cm.isincomplex.xml
lib.cm.isknown.xml
lib.cm.page.id.xml
plugin.targeting.change.mode.xml
plugin.targeting.enemy.next.task.xml
plugin.targeting.enemy.next.xml
plugin.targeting.enemy.prev.task.xml
plugin.targeting.enemy.prev.xml
plugin.targeting.missile.next.tk.xml
plugin.targeting.missile.next.xml
plugin.targeting.next.carrier.xml
plugin.targeting.next.debris.xml
plugin.targeting.next.enemy.gks.xml
plugin.targeting.next.enemy.xml
plugin.targeting.next.gate.xml
plugin.targeting.next.missile.xml
plugin.targeting.next.player.xml
plugin.targeting.next.roid.notsc.xml
plugin.targeting.next.roid.sc.xml
plugin.targeting.next.station.xml
plugin.targeting.next.ware.xml
plugin.targeting.next.xml
plugin.targeting.prev.enemy.xml
plugin.targeting.prev.player.xml
plugin.targeting.prev.station.xml
plugin.targeting.prev.xml
plugin.targeting.setup.xml
plugin.targeting.shipchanged.xml
plugin.targeting.turret.xml
plugin.targeting.uninstall.xml
plugin.targeting.ware.next.task.xml
plugin.targeting.ware.next.xml

Uninstall\
!setup.plugin.targeting.xml

t\
447730.xml
497730.xml

Hotkeys:
This script adds 17 new hotkeys.


Version history:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
1.51
next enemy: new aim if Cluster decouples
1.5
Enemy searching advanced, CTD-Bug while using a joystick reduced (or hopefully removed)
1.4
Script optimized for X3Plus, 'Next warpgate' as well as 'Next (un)scanned asteroid' added, new t-file
1.31
Ship change fixed
1.3
Added 'restricted access' to the enemy-searching modes; minimal changes.
1.24 (no official release)
Added the turred-choice to the enemy-searching modes; new setup-script; NoSE-scripts
1.23
Added the enemy-searching mode; actualiced the library
1.22
Added auto-targeting to the missile-search; some comments adjusted
1.21
Bug fixed in the cap ship-search; added auto-targeting to warecontainer-search
1.2
Missile-search looks for missiles that have been fired to other ships than the playership; adjusted scripts for signing
1.1
Added six additional targeting-features
1.0
Release
__________________________________
© 2006/07 X-Freak Cartman

I wish a good profit for everyone
[ external image ] Version 1.51

German Topic
Last edited by X-Freak Cartman on Thu, 23. Aug 07, 22:25, edited 6 times in total.
User avatar
X-Freak Cartman
Posts: 4017
Joined: Mon, 2. Oct 06, 15:08
x3

Post by X-Freak Cartman »

What about some feedback?
It's no problem to include more features, you just have to ask for them.
I don't think 81 members reading this thread don't have new ideas ;)
User avatar
halo112358
Posts: 374
Joined: Thu, 16. Feb 06, 07:56
x3

Post by halo112358 »

This works very well, much better options than the default :D
*** modified ***

[ external image ]
User avatar
Krim
Posts: 80
Joined: Tue, 6. Apr 04, 00:10
x4

Post by Krim »

could you make us an .spk version?

otherwise its looking good so far
User avatar
X-Freak Cartman
Posts: 4017
Joined: Mon, 2. Oct 06, 15:08
x3

Post by X-Freak Cartman »

I'm working at the .spk version, but because of my single Script file, there's a problem with it. The Targeting will find the way into the X3Plus Community Pack, so it gets a new page id.

This takes just a few days ;)
User avatar
ezra-r
Posts: 3423
Joined: Fri, 14. Oct 05, 21:04
x4

Post by ezra-r »

Great script!!
User avatar
Arkblade
Posts: 93
Joined: Sun, 23. Jul 06, 04:13
x4

Post by Arkblade »

excellent! :D

However, i've demand on this script.

please add
- Next Gate
- Next Scaned Asteroid
- Next Unscaned Asteroid
hotkeys.
It becomes a better script if it does so. :)

ps.
I personally added Next Gate Command to this script.
Because it was very easy, I want this function in the next version.
User avatar
X-Freak Cartman
Posts: 4017
Joined: Mon, 2. Oct 06, 15:08
x3

Post by X-Freak Cartman »

OK, I'll work on the next version.
Release:

erm... hopefully today ;)
User avatar
X-Freak Cartman
Posts: 4017
Joined: Mon, 2. Oct 06, 15:08
x3

Post by X-Freak Cartman »

... and here's the new version:

[ external image ] Version 1.4

Updates
  • Script optimized for X3Plus
  • 'Next warpgate' added as well as 'Next (un)scanned asteroid'
  • new t-file --> no need to check if you've got the latest one
hf
- EL
User avatar
Arkblade
Posts: 93
Joined: Sun, 23. Jul 06, 04:13
x4

Post by Arkblade »

Great! :D
and thx!
Realspace
Posts: 1638
Joined: Wed, 15. Nov 06, 10:21
x4

Post by Realspace »

Still haven't tried it but seems really a very important add-on for the game :) :o ... I always wondered how poor the targeting system was in X (in comparison with thato of games as Freespace :( ).

Do you think it'd be pssible to add a "TARGET NEAREST HOSTILE"
... mean hostile, not only enemy but someone who is aiming to attack you.

Thanks
User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 »

I'd like to have a script that when I press Target Nearest Enemy, it skips enemy missiles.
User avatar
X-Freak Cartman
Posts: 4017
Joined: Mon, 2. Oct 06, 15:08
x3

Post by X-Freak Cartman »

@ arcana
Well, that was the case in an older version.
The users wanted me to write an own script for that, because there were too much missiles in enemy sectors. I'm sorry, but at present, I can't release a script like that.

If you're familiar with the script editor, you can simply add it by adding "find array of missiles aiming to me" with an unused variable ($Array.missiles) and the gosub script commands.

@ Realspace
Hmm... great Idea :thumb_up:
I'll add it. But as I'm working on another script for now (Fight Command Software MK3), It'll take a few days. I think, I can release a new version at the weekend... It'll include a script, that does, what arcana wants. You'd just have to overwrite the old script ;)
User avatar
arcana75
Posts: 2165
Joined: Tue, 2. Dec 03, 09:28
x3tc

Post by arcana75 »

X-Freak Cartman, good to hear!

Combine Realspace's suggestion of targeting only hostiles, with skipping missiles, and we have an ideal enemy-targeting solution!

I found it almost impossible to target an enemy when swams of Typhoons are gunning for me.

Last night I was fighting 4 M1s and my Python kept targetting Hornets the M1 was launching at me... :( I was using the target-under-crosshair tho... maybe that needs to be changed (or new command added) as well.
User avatar
KanineLupus
Posts: 591
Joined: Tue, 8. Mar 05, 07:47
x2

Post by KanineLupus »

Why not try this as a suggestion for the next version. I personally find if frustruting that the default X3 targetting system struggles to lock onto missiles so that I can take them out much more easilly a save on weapons energy. Why not have a seperate the targetting of enemy missiles - that way it won't make thing difficult as it presently does, but it is still available as a function when required. Now THAT would be an 'ideal enemy-targeting solution' :lol:

[url=http://forum.egosoft.com/profile.php?mode=editprofile][b]Fo[/b]rum[b]Pr[/b]ofile[/url]
User avatar
X-Freak Cartman
Posts: 4017
Joined: Mon, 2. Oct 06, 15:08
x3

Post by X-Freak Cartman »

erm...

As far as i understood your post, you want me to write a hotkey to target missiles aiming to me or other ships...
Well, that's already included in the current version.

Just tell me if i understood you wrong, but your post was hard to read to me...
User avatar
X-Freak Cartman
Posts: 4017
Joined: Mon, 2. Oct 06, 15:08
x3

Post by X-Freak Cartman »

New version :D

Improvements:
Everything out of the last few posts..

Plus: There won't be any CTD using a joystick... well, i hope so. There's no perfect test for that.

hf ^^
hahaya
Posts: 6
Joined: Thu, 31. May 07, 16:23

Post by hahaya »

Hi, X-Freak Cartman~ After I install the script, the added command shown as Readtext~~~ (The installation message also ReadText~~) . don't know why, I am using XTM.7a mod. is there any compatibility issue?
User avatar
X-Freak Cartman
Posts: 4017
Joined: Mon, 2. Oct 06, 15:08
x3

Post by X-Freak Cartman »

Hmm...

There are two possibilities:
1.) You installed X3Plus, which tries to set the page id globally...
2.) You didn't install the t-files

... 3.) Dunno...

I'll try something... Maybe, there's a problem with the new page id libscript.

btw: I'm using the XTM, too, so there won't be any incompatibility with that mod ;)
hahaya
Posts: 6
Joined: Thu, 31. May 07, 16:23

Post by hahaya »

1.didn't use the X3plus~
2.I am sure the T file in the folder~~~

anyway~

here is the script list for my X3 V2.002 with bonus pack 3.1.05:
--------------------
Trad MK3 improve 1.29.7
Fighter MK3 1.11
Remove rock 1.03 (starup only)
-----------------------
Sat deploy V1.12 ForSatLimMK3
Sat Early warning network V1.20
AUTO Sector Lock V1.0
-----------------------
Advance Jump V1.5+addon
Self Repairing Hull Tech V1.3
Salvage Insurance V1.01
Overtune BBs V1.5
Captial ship crew~

XTM.7

I will try to install a clean X3 to test it tonight~~

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