Arma Reforger Script API
|
Public Member Functions | |
proto external void | Init (notnull IEntity owner) |
Some functions accept minimal magazine count specification array: array<int> minMagCountSpec. | |
proto external void | SetSelectionProperties (float maxLastSeenDirect, float maxLastSeenIndirect, float maxLastSeen, float minTraceFractionIndirect, float maxDistanceInfantry, float maxDistanceVehicles, float maxTimeSinceEndangered, float maxDistanceDisarmed) |
Initializes properties for target/weapon selection. | |
proto external void | SetTargetScoreConstants (EAIUnitType targetUnitType, float offset, float slope) |
Sets constants for target score calculation. | |
proto external bool | SelectWeaponAndTarget (notnull array< IEntity > assignedTargets, float assignedTargetsScoreIncrement, float dangerTargetsScoreIncrement, bool useCompartmentWeapons, array< int > weaponTypesWhitelist=null, array< int > weaponTypesBlacklist=null) |
Selects weapon and target. | |
proto BaseTarget | GetSelectedTarget () |
Returns selected target. | |
proto void | GetSelectedWeapon (out BaseWeaponComponent outWeapon, out int outMuzzleId, out BaseMagazineComponent outMagazine) |
Returns selected weapon, muzzle, magazine. | |
proto external EAIUnitType | GetUnitTypesCanAttack () |
Return unit types which we can attack based on available weapons. | |
proto void | GetSelectedWeaponProperties (out float outMinDistance, out float outMaxDistance, out bool outDirectDamage) |
Returns properties of selected weapon/magazine. | |
proto void | GetMostRelevantTargetCantAttack (out BaseTarget target, out float targetScore) |
Returns most relevant target which we can't attack. | |
proto external bool | SelectWeaponAgainstUnitType (EAIUnitType targetUnitType, bool useCompartmentWeapons, array< int > minMagCountSpec=null) |
Selects weapon against abstract target of given type. | |
proto external bool | SelectWeaponAgainstUnitTypeAndDistance (EAIUnitType targetUnitType, float distance, bool preferDirectAttackWeapon, bool useCompartmentWeapons, array< int > weaponTypesWhitelist=null, array< int > weaponTypesBlacklist=null, array< int > minMagCountSpec=null) |
Selects weapon against abstract target of given type, but takes distance into account. | |
proto external float | CalculateTargetScore (BaseTarget target) |
Returns score of the target. | |
proto external bool | HasWeaponOfType (EWeaponType weaponType, bool searchCompartment) |
Methods below perform fast lookup from inventory caches. | |
proto external BaseWeaponComponent | FindWeaponOfType (EWeaponType weaponType, bool searchCompartment) |
proto external int | GetMagazineCount (TypeName magazineWellType, bool searchCompartment) |
Returns amount of magazines for magazine well. | |
proto external BaseMagazineComponent | FindMagazineWithTraits (EAICombatPropertiesComponentTraits traits, bool searchCompartment) |
Finds magazine with given traits. Traits value is treated as flags. | |
proto BaseWeaponComponent | FindWeaponAndMuzzleForMagazineWell (TypeName magazineWellType, bool searchCompartment, out int muzzleId) |
Finds a weapon and muzzle compatible with given magazine well. | |
proto external float AIWeaponTargetSelector.CalculateTargetScore | ( | BaseTarget | target | ) |
Returns score of the target.
proto external BaseMagazineComponent AIWeaponTargetSelector.FindMagazineWithTraits | ( | EAICombatPropertiesComponentTraits | traits, |
bool | searchCompartment | ||
) |
Finds magazine with given traits. Traits value is treated as flags.
proto BaseWeaponComponent AIWeaponTargetSelector.FindWeaponAndMuzzleForMagazineWell | ( | TypeName | magazineWellType, |
bool | searchCompartment, | ||
out int | muzzleId | ||
) |
Finds a weapon and muzzle compatible with given magazine well.
proto external BaseWeaponComponent AIWeaponTargetSelector.FindWeaponOfType | ( | EWeaponType | weaponType, |
bool | searchCompartment | ||
) |
proto external int AIWeaponTargetSelector.GetMagazineCount | ( | TypeName | magazineWellType, |
bool | searchCompartment | ||
) |
Returns amount of magazines for magazine well.
proto void AIWeaponTargetSelector.GetMostRelevantTargetCantAttack | ( | out BaseTarget | target, |
out float | targetScore | ||
) |
Returns most relevant target which we can't attack.
proto BaseTarget AIWeaponTargetSelector.GetSelectedTarget | ( | ) |
Returns selected target.
proto void AIWeaponTargetSelector.GetSelectedWeapon | ( | out BaseWeaponComponent | outWeapon, |
out int | outMuzzleId, | ||
out BaseMagazineComponent | outMagazine | ||
) |
Returns selected weapon, muzzle, magazine.
proto void AIWeaponTargetSelector.GetSelectedWeaponProperties | ( | out float | outMinDistance, |
out float | outMaxDistance, | ||
out bool | outDirectDamage | ||
) |
Returns properties of selected weapon/magazine.
proto external EAIUnitType AIWeaponTargetSelector.GetUnitTypesCanAttack | ( | ) |
Return unit types which we can attack based on available weapons.
Uses cached value from last SelectWeaponAndTarget call.
proto external bool AIWeaponTargetSelector.HasWeaponOfType | ( | EWeaponType | weaponType, |
bool | searchCompartment | ||
) |
Methods below perform fast lookup from inventory caches.
They should be prefered for weapon or magazine searches for AI instead of inventory queries. searchCompartments - if true, the inventory cache for current compartment is used. Otherwise character's cache is used.
proto external void AIWeaponTargetSelector.Init | ( | notnull IEntity | owner | ) |
Some functions accept minimal magazine count specification array: array<int> minMagCountSpec.
This array lets you exclude weapons which have lower amount of magazines than specified. The array is of following format: {DefaultValue, WeaponType0, MagCount0, WeaponType1, MagCount1, ...}.
proto external bool AIWeaponTargetSelector.SelectWeaponAgainstUnitType | ( | EAIUnitType | targetUnitType, |
bool | useCompartmentWeapons, | ||
array< int > | minMagCountSpec = null |
||
) |
Selects weapon against abstract target of given type.
Call GetSelectedWeapon, GetSelectedWeaponProperties to get result.
proto external bool AIWeaponTargetSelector.SelectWeaponAgainstUnitTypeAndDistance | ( | EAIUnitType | targetUnitType, |
float | distance, | ||
bool | preferDirectAttackWeapon, | ||
bool | useCompartmentWeapons, | ||
array< int > | weaponTypesWhitelist = null , |
||
array< int > | weaponTypesBlacklist = null , |
||
array< int > | minMagCountSpec = null |
||
) |
Selects weapon against abstract target of given type, but takes distance into account.
Call GetSelectedWeapon, GetSelectedWeaponProperties to get result.
proto external bool AIWeaponTargetSelector.SelectWeaponAndTarget | ( | notnull array< IEntity > | assignedTargets, |
float | assignedTargetsScoreIncrement, | ||
float | dangerTargetsScoreIncrement, | ||
bool | useCompartmentWeapons, | ||
array< int > | weaponTypesWhitelist = null , |
||
array< int > | weaponTypesBlacklist = null |
||
) |
Selects weapon and target.
Returns true when a valid option is selected. Call GetSelectedTarget, GetSelectedWeapon, GetSelectedWeaponProperties to get result.
proto external void AIWeaponTargetSelector.SetSelectionProperties | ( | float | maxLastSeenDirect, |
float | maxLastSeenIndirect, | ||
float | maxLastSeen, | ||
float | minTraceFractionIndirect, | ||
float | maxDistanceInfantry, | ||
float | maxDistanceVehicles, | ||
float | maxTimeSinceEndangered, | ||
float | maxDistanceDisarmed | ||
) |
Initializes properties for target/weapon selection.
proto external void AIWeaponTargetSelector.SetTargetScoreConstants | ( | EAIUnitType | targetUnitType, |
float | offset, | ||
float | slope | ||
) |
Sets constants for target score calculation.
Formula is: score = offset + slope*distance