fa icon indicating copy to clipboard operation
fa copied to clipboard

Integrated STP with Category Support

Open Spikey84 opened this issue 2 years ago • 4 comments

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.

Spikey84 avatar Aug 06 '22 22:08 Spikey84

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 avatar Aug 06 '22 22:08 Spikey84

image @Spikey84 I set Hotkey to Units to P and this is my error that i get

MrRowey avatar Aug 15 '22 21:08 MrRowey

@MrRowey do u have ATP and/or STP?

Spikey84 avatar Aug 15 '22 22:08 Spikey84

You can set the target priority to units of yourself, which isn't necessarily a bad thing but just wanted to point it out.

image 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.

Garanas avatar Aug 16 '22 07:08 Garanas

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

Garanas avatar Sep 06 '22 20:09 Garanas