fa
fa copied to clipboard
Integrated STP with Category Support
This PR integrates @4z0t's ui mod called Specific Target Priorities to the game. This mod allows a player to select with a hotkey the kind of unit they with their units to target. In addition to integrating the current mod i am also making modifications that will allow the targeting of all variations of units (different factions) without selecting each on individually.
Things to do here:
- Add default TP hotkey
- Make hotkey look cleaner
- Finish/rework the category table
- check with @Garanas that performance is not effected by this change
@Spikey84 I set Hotkey to Units to P and this is my error that i get
@MrRowey do u have ATP and/or STP?
You can set the target priority to units of yourself, which isn't necessarily a bad thing but just wanted to point it out.
The code needs some fail safes (for modded units, in particular) when a certain field does not exist. Take the command unit, it has no tech level.
As a few examples:
{ -- Shield disruptor
categories.dal0310,
categories.TECH3 * categories.AEON * categories.DIRECTFIRE * categories.LAND,
categories.TECH3 * categories.DIRECTFIRE * categories.LAND,
categories.DIRECTFIRE * categories.LAND,
categories.LAND
}
{ -- Janus
categories.dea0202,
categories.TECH2 * categories.UEF * categories.ANTIAIR * categories.AIR,
categories.TECH2 * categories.ANTIAIR * categories.AIR,
categories.ANTIAIR * categories.AIR,
categories.AIR
}
{ -- Bouncer
categories.dal0310,
categories.TECH3 * categories.AEON * categories.DIRECTFIRE * categories.LAND,
categories.TECH3 * categories.DIRECTFIRE * categories.LAND,
categories.DIRECTFIRE * categories.LAND,
categories.LAND
}
The logic can be found in the changes, but roughly:
- unit id that we hover over
- common categories that the unit we hover over may share with similar units, including faction
- common categories that the unit we hover over may share with similar units
- common categories that the unit we hover over may share with similar units of any tech
- common categories that the unit we hover over may share with similar units of the same layer