[MOD] More Hotkeys: Advanced Targeting

The place to discuss scripting and game modifications for X4: Foundations.

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

Post Reply
Trajan von Olb
Posts: 544
Joined: Wed, 4. Feb 04, 21:39
x3tc

[MOD] More Hotkeys: Advanced Targeting

Post by Trajan von Olb » Mon, 31. May 21, 23:19

MORE HOTKEYS: ADVANCED TARGETING
by Trajan von Olb

AKTUELLE VERSION: 1.1 - DOWNLOAD LINK!

ATTENTION!
Only works with SirNukes "Mod support apis" (or Steam) incl. Pipe-Server! To assign the keys, a game state MUST beactive (new or loaded) - but the settings apply to all game states afterwards. PLEASE THEN DELETE THE EGOSOFT KEY ASSIGNMENTS AND REPLACE THEM WITH THOSE OF THE MOD! (Unfortunately, I did not succeed in replacing the Egosoft routines, but if you can, help is welcome).

MORE HOTKEYS: ADVANCED TARGETING improves Egosoft's target switching and adds many new ways to find and select targets using additional hotkeys, such as incoming missiles or owned ships. Line-of-sight target selection has also been improved, allowing ships, surface elements, factories and gates to be brought into focus much more precisely. Large, visible targets (gates, factories) can now be selected from a long distance without using the mouse, but remain unknown to the player if the distance is too great for detection. Overall, the range is now based on the radar, apart from named large targets.

Basically, the mechanics of how targets are switched through have been changed. "Next target" and "Previous target" now always follow the rules of the previously activated target (exception: line of sight, mouse selection of a target or if no target was activated before). After selecting enemies, these buttons will continue to switch through enemies, after selecting own ships, only own ships, etc. This is valid as long as one of these targets is in focus and is interrupted if a) a target is selected with the mouse, b) a target is switched on via "in the line of sight", c) the target has been lost in some way, e.g. it has been destroyed or has disappeared from the sector or d) the target has been deselected with "no target". In these cases and at the start of the game, targeting goes into rule-free mode: If no target is selected, the closest target to the player ship (ship, station, gate, enemy, asteroid, treasure chest) is selected. If a target is already in focus, the target that is further away or closer is switched on.

The surface elements have a special status. These modes are activated either by the corresponding keys or when a surface element is selected by "in the line of sight" or with the mouse. If the surface element is destroyed, the surface mode is NOT deactivated, whereby e.g. "next target" selects the next surface element again. The mode is only interrupted by switching on a target that is NOT a surface element or by actively deselecting the target with the corresponding key or the mouse (click into the void).

For the special modes of the surface elements (engines, weapon towers and shield generators), a fall-back system applies after the destruction of the target, i.e. as long as you switch on an element of the same type with the mouse or "in the line of sight", the mode remains. If an element of a different type is switched on or if no corresponding element is left, all surface elements are switched through again from then on; if this is not possible, the target switching changes back to the rule-free mode. The aim of this mechanism is to logically support the preparation for boarding while maintaining full control.

It all sounds more complicated than it is - just try it out! All functions were created according to criteria of usability and logic and should be very easy to use.


ADDED HOTKEYS:

LINE OF SIGHT - selects a target directly under the target cross in the centre of the screen. In doing so, the target acquisition first searches precisely in the centre. If no target is found, the search angle is increasingly widened in several steps up to 25 degrees. This means that the central targets are always reliably selected, but you still have the effect as with the Egosoft search that targets in front of the ship in the vicinity can also be found well. Even distant targets are selected if they are large and visible: Gates and factories always, Capital ships at double radar visibility. Surface elements are found in this way from 8km (if you want to search for surface elements further away, you can use the corresponding keys that refer to the current target). If a surface element is switched on in this way, the target detection changes to the mode "surface elements".

SELECT NEXT TARGET - switches to the next target in order of distance, following the rules of the previously active mode. If no mode was active, the next target within range is switched on or the next target after the respective switched on target.

SELECT PREVIOUS TARGET - like "next target".

SELECT NO TARGET - deletes the current destination from the target detection and resets the current mode to "no filter".

ENEMIES - switches on the nearest enemy and changes to "enemies" mode.

MISSILES - captures nearest missile targeting the player and switches to "missiles" mode.

ENEMIES XS-M - captures nearest XS, S and M sized enemy and switches to the corresponding mode.

ENEMIES L-XL - captures nearest enemy of size L and XL and switches to the corresponding mode.

OWN SHIPS - captures nearest owned ship and enters corresponding mode.

OWN SHIPS FOR LANDING - targets nearest owned ship that can be landed on with the player ship. This makes it possible to quickly retreat to the nearest capital ship with a fighter despite a confusing overview situation (possibly linking the command to obtaining a landing permission in the future to show the green dots). Also change to the appropriate mode.

STATIONS - captures nearest station and switches to the appropriate mode.

GATES - captures nearest highway, accelerator or nearest jump gate and enters the appropriate mode.

COLLECTABLES - detects nearest collectable. This includes asteroids with "contents", e.g. space fly eggs and switches to the appropriate mode.

ASTEROIDS - detects nearest asteroids and switches to the corresponding mode. This function is intended for manual mining.

SURFACE ELEMENTS - captures the nearest surface element of the current target. If no current target is selected, the next surface element of the closest object is selected. Switches to "Surface Elements" mode.

SURFACE ELEMENTS: ENGINES - same as surface elements, but only engines are detected. Switches to "Surface Elements" mode with "Engines" filter.

SURFACE ELEMENTS: TURRETS - same as surface elements, but only turrets are detected. Switches to "Surface Elements" mode with "Turrets" filter.

SURFACE ELEMENTS: SHIELD GENERATORS - like surface elements, but only shield generators are detected. Switches to "Surface Elements" mode with "Shield Generators" filter.


COMPATIBILITY

The MOD is savegame compatible. It should work with all other mods as long as they do not bring their own targeting.


REQUIRED OTHER MODS

SirNukes Mod Support APIs (or on steam).
SirNukes Python pipe server (exe version recommended)


HIGHLY RECOMMENDED MODS / SETTINGS

Stations, Ships and Effects Draw Distances (for more visibility, especially of stations!).
Basically, setting the maximum visibility is recommended!


MORE HOTKEYS series

The "MORE HOTKEYS" series adds many more hotkeys to the game. The aim is that HOTAS and joystick players will need to use the mouse less often, making the experience of being in space feel more direct. Some Parts add extra equipment, giving the game new features.
PARTS:
MORE HOTKEYS: ADVANCED TARGETING (released).
MORE HOTKEYS: MAP AND MENUS (in progress)
MORE HOTKEYS: WING MANAGEMENT (presumably obsolete due to the MOD Wing Hotkeys)
MORE HOTKEYS: FAVORITES (in planning)
MORE HOTKEYS: EQUIPMENT AND MISC (in progress, will be expanded in the long term, suggestions are welcome!)


INSTALLATION / SETUP

1. download SirNukes Python-Pipe-Server, unpack it into a directory of your choice and always start it before starting the game (according to SirNukes, the tool only collects keystrokes when X4 is currently in focus, i.e. you are playing)
2. download the mod file and copy the folder "tvo_more_hotkeys_adv_targeting" into the directory "extensions" in the Egosoft folder, normally under C:\Program Files (x86)\Steam\steamapps\common\X4 Foundations\extensions, for presupposed as well as recommended MODS proceed in the same way!
3. start the pipe server
4. start game
5. load savegame / start new game (otherwise you can't set up keys for mods)
6. delete all key assignments for targeting from Egosoft
7. assign keys (at the very bottom of the menu), watch out for duplications - with mods there is no query as to which keys have already been used.
8. have fun :D


UNINSTALLATION

1. delete the folder "tvo_more_hotkeys_adv_targeting" in the extensions folder in the game directory.
2. restore key assignment for targeting from Egosoft.


MANY THANKS TO:

- SirNukes for the hotkey support, without which this mod would have been pointless
- Forleyor for basics and the LUA code
- Kuertee, without whose patient answers to my endless beginner questions I would be much, much dumber!
- Egosoft for the intrinsically wonderful game, but still in need of improvement, the great music of all parts and the fantastic graphics!


HISTORY:

1.0, 2021-05-31
Initial Release

1.1, 2021-06-03
- Error corrected: Enemies were all found when the enemy button was pressed, but afterwards only ships were switched through, no laser turrets etc.
- Change: Enemies are now only found up to radar range, if they are capitalships or already known, they can be found up to double radar range.
- Small text errors corrected



https://staticdelivery.nexusmods.com/mo ... 05332.jpeg
Last edited by Trajan von Olb on Thu, 3. Jun 21, 01:17, edited 3 times in total.
Mein Traum vom Glück ist der Traum von einer anderen Menschheit. (S. Lem)

kuertee
EGOSOFT
EGOSOFT
Posts: 789
Joined: Sun, 14. Dec 03, 13:05
x4

Re: [MOD] More Hotkeys: Advanced Targeting

Post by kuertee » Tue, 1. Jun 21, 05:09

Excellent work, Trajan!
Mods: RPG: Reputations and Professions, Social Standings and Citizenships, Crime has Consequences, Alternatives to Death. Missions/NPCs: Emergent Missions, NPC Reactions, Mod Parts Trader, High-sec Rooms are Locked, Hacking Outcomes, More Generic Missions, Waypoint Fields for Deployment. Others: Auto-cam, Friendly Fire Tweaks, Teleport From Transporter Room, Wear and Tear. QoL: Trade Analytics, Loot Mining, Ship Scanner, Signal Leak Hunter, Station Scanner, Surface Element Targeting, etc.

Trajan von Olb
Posts: 544
Joined: Wed, 4. Feb 04, 21:39
x3tc

Re: [MOD] More Hotkeys: Advanced Targeting

Post by Trajan von Olb » Thu, 3. Jun 21, 01:22

kuertee wrote:
Tue, 1. Jun 21, 05:09
Excellent work, Trajan!
Thank you, Kuertee!

NEW VERSION: 1.1 - DOWNLOAD LINK!

1.1, 2021-06-03
- Error corrected: Enemies were all found when the enemy button was pressed, but afterwards only ships were switched through, no laser turrets etc.
- Change: Enemies are now only found up to radar range, if they are capitalships or already known, they can be found up to double radar range.
- Small text errors corrected
Mein Traum vom Glück ist der Traum von einer anderen Menschheit. (S. Lem)

Post Reply

Return to “X4: Foundations - Scripts and Modding”