I didn't have analyze the Selection Behaviour in Detail:
But from my Observations I think the Selection of a Unit is depending on the defined Categories in the Unit Blueprint File.
The Sparky has these Categories:
Categories = {
'PRODUCTFA',
'SELECTABLE',
'BUILTBYLANDTIER2FACTORY',
'BUILTBYLANDTIER3FACTORY',
'BUILTBYAIRTIER2FACTORY',
'BUILTBYAIRTIER3FACTORY',
'BUILTBYNAVALTIER2FACTORY',
'BUILTBYNAVALTIER3FACTORY',
'UEF',
'MOBILE',
'AMPHIBIOUS',
'LAND',
'TECH2',
'CONSTRUCTION',
'ENGINEER',
'REPAIR',
'RECLAIM',
'FIELDENGINEER',
'CAPTURE',
'VISIBLETORECON',
'RECLAIMABLE',
'PATROLHELPER',
'SHOWQUEUE',
'OVERLAYRADAR',
'OVERLAYCOUNTERINTEL',
'OVERLAYDIRECTFIRE',
},
I would add the Category 'TANK', to it.
So the Sparky should be Selected as Well If you double Click on any Tank
So you will need to modify the Blueprint File of the Sparky with this small Change but I think this will make it functional.
Regarding to a Shortcut:
I think that is possible somehow.
The Game has several useful Functions to Check the Existence of a Unit Ingame.
For example the Function GetListofUnits which can be used in the aiBrain.lua as following
CheckSparkyExistence = function(self)
while true do
local unit =
self:GetListOfUnits(categories.SPARKY, true)
if table.getn(unit) > 0 then
-- Give them a New Shortcut
end
WaitSeconds(1)
end
end
You will actually need to add the Category 'SPARKY', to Blueprint File of the Sparky as Well. Of course that needs to be tested Out and I personally don't know how to Set a New Shortcut in Terms of the Code. Maybe this will help you or anyone else who want to Work on it.