Skip to main content

TargetSelector

TargetSelector.

Properties

selectedTarget: AIHeroClient

Currently selected target

Functions

GetTarget

TargetSelector.GetTarget(
range: number,
damageType: DamageType,
from: Vector3,
addBoundingRadius: boolean
) AIHeroClient

ArgumentTypeDescription
rangenumberCheck range.
damageTypeDamageTypeDamage type.
fromVector3Check from.
addBoundingRadiusbooleanShould add target bounding radius.

Returns best target.


GetTarget

TargetSelector.GetTarget(
range: number,
damageType: DamageType,
from: Vector3,
addBoundingRadius: boolean,
filterFn: function
) AIHeroClient

ArgumentTypeDescription
rangenumberCheck range.
damageTypeDamageTypeDamage type.
fromVector3Check from.
addBoundingRadiusbooleanShould add target bounding radius.
filterFnfunctionCustom filter function.

Returns best target.


GetTargets

TargetSelector.GetTargets(
range: number,
damageType: DamageType,
from: Vector3,
addBoundingRadius: boolean
) AIHeroClient[]

ArgumentTypeDescription
rangenumberCheck range.
damageTypeDamageTypeDamage type.
fromVector3Check from.
addBoundingRadiusbooleanShould add target bounding radius.

Returns a list of possible targets, sorted by priority.


GetPriority

TargetSelector.GetPriority(
hero: AIHeroClient
) number

ArgumentTypeDescription
heroAIHeroClientGiven target.

Returns TS priority for given target.


GetSelectedTarget

TargetSelector.GetSelectedTarget() AIHeroClient

Returns currently selected target.


SetForcedTarget

TargetSelector.SetForcedTarget(
target: AIHeroClient
) void

ArgumentTypeDescription
targetAIHeroClientTarget to be forced. nil to clear.

Set forced target.

Example: Force target under our cursor.
Callback.Bind(CallbackType.OnTick, function()
local hover = Game.GetHoveredUnit()
TargetSelector.SetForcedTarget(hover and hover:IsValid() and hover or nil)
end)