The zip file contains a script (and example usage) that can be used to give subsystems & turrets a hot key. Requires 3.1.13 revision 6967 or higher to work, due to a issue with earlier revisions.
Use the script from FRED requires two string variables to be set
SubDShip - the ship name e.g. GTD Killer
SubDSubsys - the subsystem e.g. turret01
then a script-eval of subsystemdirec('key')
$Formula: ( when
( has-time-elapsed 0 )
( modify-variable
"@SubDShip[ ]"
"Fenris"
)
( modify-variable
"@SubDSubsys[ ]"
"turret09a-01-main"
)
( script-eval "subsystemdirec('F9')" )
( modify-variable
"@SubDSubsys[ ]"
"navigation"
)
( script-eval "subsystemdirec('F10')" )
( modify-variable
"@SubDSubsys[ ]"
"engine"
)
( script-eval "subsystemdirec('F10')" )
( modify-variable
"@SubDShip[ ]"
"Leviathan"
)
( modify-variable
"@SubDSubsys[ ]"
"turret09a-01-main"
)
NB multiple class to the subsystemdirec with the same key appends the ship/subsystem to the list it doesn't replace it.
Pressing the hotkey in game then cycles the targeting through the list, as long as the ship exists and the subsystem isn't at 0 health.
The other way to init is to create a script tbm like
$Mission: SubSysDirec-script.fs2
$On Mission Start:
[
subsysdirecs['f9'] = { 0, {'Fenris', 'turret09a-01-main'}, {'Leviathan', 'turret09a-01-main'} }
subsysdirecs['f10'] = { 0, {'Fenris', 'navigation'}, {'Fenris', 'engine'} }
subsysdirecs['f11'] = { 0, {'Leviathan', 'navigation'}, {'Leviathan', 'engine'} }
]
notice the keys have to in lower case
Hope somebody finds the useful.
files in the zip
------------------
SubsysHotKeysMain-sct.tbm - the scripting it self
SubSysDirec-fred.fs2 - a basic mission showing how to configure the keys from within FRED
SubSysDirec-script.fs2 - the same basic mission but uses the file SubHotKeys-scriptset-sct.tbm to set the keys
edit
updated zip file - fixed retargeting issue
edit 2
update zip again - now draws a small white box around the subsystems that aren't targeted
edit 3
zip update yet again - fixed a silly little bug the crept in with the first edit
[attachment deleted by ninja]