Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
SCR_AICombatComponent Interface Reference
Inheritance diagram for SCR_AICombatComponent:
[legend]

Public Member Functions

void SetGroupSuppressClusterState (SCR_AITargetClusterState state)
 
void SetGroupFireRateCoef (float coef=1, bool overridePersistent=false)
 
void SetFireRateCoef (float coef=1, bool persistent=false)
 
float GetFireRateCoef ()
 
EAISkill GetAISkill ()
 
void SetAISkill (EAISkill skill)
 Use this to change AIskill dynamically.
 
void SetPerceptionFactor (float value)
 Sets perception ability.
 
void ResetAISkill ()
 use this to reset AI skill to default
 
BaseWeaponComponent GetCurrentWeapon ()
 
EWeaponType GetCurrentWeaponType (bool overrideWithMuzzle=false)
 
BaseTarget GetCurrentTarget ()
 
BaseTarget GetRetreatTarget ()
 
BaseTarget GetLastSeenEnemy ()
 
BaseTarget GetEndangeringEnemy ()
 
bool IsEnemyKnown (IEntity ent)
 
void EvaluateWeaponAndTarget (out bool outWeaponEvent, out bool outSelectedTargetChanged, out BaseTarget outPrevTarget, out BaseTarget outCurrentTarget, out bool outRetreatTargetChanged, out bool outCompartmentChanged)
 
vector GetTargetDestinationPos ()
 
SCR_AIInfoComponent GetAIInfoComponent ()
 
bool EvaluateLowAmmo (BaseWeaponComponent weaponComp, int muzzleId)
 Checks amount of magazines for given weapon, and if low on ammo, reports that to group.
 
int GetWeaponLowMagThreshold (BaseWeaponComponent weapon)
 
void Update (float timeSliceMs)
 
bool DismountTurretCondition (inout vector targetPos, bool targetPosProvided)
 Condition to dismount turret Returns true when we should dismount it immediately.
 
void TryAddDismountTurretActions (vector targetPos, bool addGetOut=true, bool addInvestigate=true, bool addGetIn=true)
 Adds action to dismount turret, investigate, and go back.
 
vector FindNextCoverPosition ()
 
bool IsActionAllowed (EAICombatActions action)
 
EAICombatActions GetAllowedActions ()
 
void SetHoldFire (bool isHoldFire)
 
EAICombatType GetCombatType ()
 
void SetCombatType (EAICombatType combatType)
 
void SetDefaultCombatType (EAICombatType combatType)
 When AI use reset e.g.
 
void ResetCombatType ()
 
bool IsFriendlyInAim ()
 
bool IsTargetVisible (notnull BaseTarget target)
 Checks if given target can be considered visible.
 
void SetAssignedTargets (array< IEntity > assignedTargets, SCR_AITargetClusterState clusterState)
 Either array of targets or target cluster must be provided.
 
void ResetAssignedTargets ()
 
void SetExpectedEnemyType (EAIUnitType expectedEnemyType)
 
void ResetExpectedEnemyType ()
 
void GetSelectedWeaponAndMagazine (out BaseWeaponComponent outWeaponComp, out int outMuzzleId, out BaseMagazineComponent outMagazineComp)
 Getters which return the weapon which combat component thinks is best against current target If there is no current target, then there is no selected weapon as well! In that case use GetExpectedWeapon.
 
void GetSelectedWeapon (out BaseWeaponComponent outWeaponComp, out int outMuzzleId)
 
EWeaponType GetSelectedWeaponType ()
 
void GetSelectedWeaponProperties (out float outMinDistance, out float outMaxDistance, out bool outDirectDamage)
 
bool GetSelectedWeaponDirectDamage ()
 
float GetSelectedWeaponMinDist ()
 
float GetSelectedWeaponMaxDist ()
 
ResourceName GetSelectedWeaponResource ()
 
EAIUnitType GetUnitTypesCanAttack ()
 
void EvaluateExpectedWeapon (out BaseWeaponComponent outWeaponComp, out int outMuzzleId, out BaseMagazineComponent outMagazineComp)
 Returns weapon which combat component thinks is expected to be used this situation This should be used for selecting fallback weapon in a situation without an actively attacked target.
 
void EvaluateSuppressionWeapon (EAIUnitType targetUnitType, float distanceToTarget, out BaseWeaponComponent outWeaponComp, out int outMuzzleId, out BaseMagazineComponent outMagazineComp)
 Returns optimal weapon which can be used for suppressing target of given type at given range.
 
bool HasWeaponOfType (EWeaponType weaponType)
 
BaseWeaponComponent FindWeaponOfType (EWeaponType weaponType)
 
int GetMagazineCount (TypeName magazineWell, bool countMagazineInWeapon=false)
 
override void OnPostInit (IEntity owner)
 
override void EOnInit (IEntity owner)
 
override void OnDelete (IEntity owner)
 
void SetTargetSelectionProperties (bool closeCombat)
 
void UpdatePerceptionFactor (PerceptionComponent perceptionComp, SCR_AIThreatSystem threatSystem)
 
void ~SCR_AICombatComponent ()
 
void DebugPrintToWidget (TextWidget w)
 Used by AIDebugInfoComponent.
 
SCR_ChimeraAIAgent GetAiAgent ()
 
BaseTarget FindTargetByEntity (IEntity ent)
 
void UpdateLastSeenPosition (IEntity entity, notnull SCR_AITargetInfo targetInfo)
 
void UpdateLastSeenPosition (notnull BaseTarget tgt, notnull SCR_AITargetInfo targetInfo)
 

Public Attributes

ref AIWeaponTargetSelector m_WeaponTargetSelector = new AIWeaponTargetSelector()
 

Static Public Attributes

static const int TARGET_ENDANGERED_TIMEOUT_S = 10
 How long after last time target was endangering we stop treating it as such.
 
static const float ENDANGERING_TARGET_SCORE_MULTIPLIER = 1.05
 Multiplier of target score if target is considered endangering.
 
static const float TARGET_MAX_LAST_SEEN_VISIBLE = 0.5
 'IsTargetVisible' variable in attack tree relies on this
 
static const float TARGET_MIN_LAST_SEEN_INDIRECT_ATTACK = 2.0
 
static const float TARGET_MAX_LAST_SEEN_INDIRECT_ATTACK = 7.0
 
static const float TARGET_MAX_LAST_SEEN_INDIRECT_ATTACK_MG = 14.0
 
static const float TARGET_MAX_LAST_SEEN_INDIRECT_ATTACK_CLOSE = 20.0
 
static const float TARGET_MAX_LAST_SEEN = 11.0
 
static const float TARGET_SCORE_HIGH_PRIORITY_ATTACK = 98.5
 Threshold for high priority attack.
 
static const float CLOSE_RANGE_COMBAT_DISTANCE = 35.0
 Within this distance AI considers combat as 'close range', used in firing times.
 
static const float CLOSE_RANGE_COMBAT_DISTANCE_SQ = CLOSE_RANGE_COMBAT_DISTANCE * CLOSE_RANGE_COMBAT_DISTANCE
 
static const float LONG_RANGE_COMBAT_DISTANCE = 280.0
 Beyond this distance AI considers combat as 'long range', used for danger events and firing times.
 

Protected Member Functions

void EvaluateDismountTurret (float timeSliceMs)
 
void Event_OnInventoryChanged (IEntity item, BaseInventoryStorageComponent storageOwner)
 
void Event_OnTimerAfterInventoryChanged ()
 
void Event_OnCompartmentEntered (IEntity vehicle, BaseCompartmentManagerComponent manager, int mgrID, int slotID)
 
void Event_OnCompartmentLeft (IEntity vehicle, BaseCompartmentManagerComponent manager, int mgrID, int slotID)
 
void Event_OnGadgetStateChanged (IEntity gadget, bool isInHand, bool isOnGround)
 
void Event_OnGadgetFocusStateChanged (IEntity gadget, bool isFocused)
 
void Event_OnDamage (BaseDamageContext damageContext)
 
void Event_OnDamageEffectAdded (notnull SCR_DamageEffect dmgEffect)
 
void InitWeaponTargetSelector (IEntity owner)
 
void RecalculateEquipmentPerceptionFactor ()
 

Protected Attributes

SCR_ChimeraAIAgent m_Agent
 
SCR_CharacterControllerComponent m_CharacterController
 
SCR_InventoryStorageManagerComponent m_InventoryManager
 
BaseWeaponManagerComponent m_WpnManager
 
SCR_CompartmentAccessComponent m_CompartmentAccess
 
SCR_ExtendedDamageManagerComponent m_DamageManager
 
PerceptionComponent m_Perception
 
SCR_AIInfoComponent m_AIInfo
 
SCR_AIUtilityComponent m_Utility
 
IEntity m_CurrentVehicle
 Current vehicle.
 
bool m_bCurrentVehicleEvac
 True if we're exiting vehicle because of damage/fire.
 
SCR_BaseCompartmentManagerComponent m_CurrentVehicleCompartmentManager
 Vehicle's compartment manager.
 
BaseCompartmentSlot m_CurrentCompartmentSlot
 Current compartment slot.
 
TurretControllerComponent m_CurrentTurretController
 Current turret controller (if we are in a turret)
 
EAICombatActions m_iAllowedActions
 will be initialised with default combat type
 
EAICombatType m_eCombatType = EAICombatType.NORMAL
 
EAICombatType m_eDefaultCombatType = EAICombatType.NORMAL
 
EAISkill m_eAISkillDefault
 
EAISkill m_eAISkill
 
bool m_bFriendlyAimLastResult
 
ref Shape m_FriendlyAimShape
 
bool m_SelectedTargetVisible
 
vector m_SelectedTargetDestinationPos
 
ref BaseTarget m_SelectedRetreatTarget
 Target we should retreat from.
 
ref array< IEntity > m_aAssignedTargets = {}
 Array with assigned targets.
 
SCR_AITargetClusterState m_TargetClusterState
 Assigned target cluster from our group.
 
EAIUnitType m_eExpectedEnemyType = EAIUnitType.UnitType_Infantry
 Enemy type we expect to fight.
 
ResourceName m_SelectedWeaponResource
 selected weapon handle tree read from config
 
BaseWeaponComponent m_SelectedWeaponComp
 Weapon, muzzle and magazine which we want to equip.
 
BaseMagazineComponent m_SelectedMagazineComp
 Character might currently have a different one though.
 
int m_iSelectedMuzzle
 
float m_fSelectedWeaponMinDist
 
float m_fSelectedWeaponMaxDist
 
bool m_bSelectedWeaponDirectDamage
 
EAIUnitType m_eUnitTypesCanAttack
 
BaseCompartmentSlot m_WeaponEvaluationCompartment
 Compartment at previous weapon evaluation.
 
float m_fFireRateCoef = 1
 
bool m_bIsFireRatePersistent = false
 
float m_fNextWeaponTargetEvaluation_ms = 0
 
SCR_AIConfigComponent m_ConfigComponent
 
float m_fDismountTurretTimer
 
float m_fEquipmentPerceptionFactor = 1.0
 How good we can spot targets based on our current equipment.
 
float m_fPerceptionFactor = 1.0
 Perception factor which is set by SetPerceptionFactor().
 
EGadgetType m_eCurrentGadgetType = -1
 Gadget state.
 
bool m_bGadgetFocus = false
 True when we are in gadget focus mode (like looking through binoculars)
 

Static Protected Attributes

static const float ASSIGNED_TARGETS_SCORE_INCREMENT = 30.0
 
static const float ENDANGERING_TARGETS_SCORE_INCREMENT = 15.0
 
static const float TARGET_MAX_LAST_SEEN_DIRECT_ATTACK = 1.6
 
static const float TARGET_MAX_LAST_SEEN_DIRECT_ATTACK_CLOSE = 4.5
 
static const float TARGET_MIN_INDIRECT_TRACE_FRACTION_MIN = 0.5
 Min value of TraceFraction for indirect attacks.
 
static const float TARGET_MAX_DISTANCE_INFANTRY = 500.0
 
static const float TARGET_MAX_DISTANCE_VEHICLE = 700.0
 
static const float TARGET_MAX_DISTANCE_DISARMED = 0.0
 Max distance at which disarmed targets are considered for attack.
 
static const float TARGET_MAX_TIME_SINCE_ENDANGERED = 5.0
 Max time since we were endangered to consider the enemy target endangering.
 
static const float TARGET_SCORE_RETREAT = 75.0
 Threshold for target score for retreating from that target.
 
static ref array< EWeaponTypes_aWeaponBlacklistFragGrenades = {EWeaponType.WT_FRAGGRENADE}
 
const float PERCEPTION_FACTOR_SAFE = 1.0
 We are safe and are good at recognising enemies.
 
const float PERCEPTION_FACTOR_VIGILANT = 2.5
 When vigilant and alert we are very good at recognising enemies.
 
const float PERCEPTION_FACTOR_ALERTED = 2.5
 
const float PERCEPTION_FACTOR_THREATENED = 0.4
 
const float PERCEPTION_FACTOR_EQUIPMENT_BINOCULARS = 3.0
 Looking through binoculars.
 
const float PERCEPTION_FACTOR_EQUIPMENT_NONE = 1.0
 Not using any special equipment, same recognition ability as usual.
 
const float FRAG_GRENADE_MAX_THREAT = 0.6
 
const float WEAPON_TARGET_UPDATE_PERIOD_MS = 500
 
static const float DISMOUNT_TURRET_TARGET_LAST_SEEN_MAX_S = 100
 
static const float TURRET_TARGET_EXCESS_ANGLE_THRESHOLD_DEG = 3.0
 We will dismount turret when target's angle exceeds turret limits by this value.
 
const float DISMOUNT_TURRET_TIMER_MS = 1200
 How much time must pass until we decide to dismount a turret if enemy is out of turret limits.
 
static ref array< EVehicleType > s_aForbidDismountTurretsOfVehicleTypes = { EVehicleType.APC }
 Array of vehicle types we should not dismount when turret cannot shoot the target.
 
static const float DISTANCE_MAX = 22
 
static const float DISTANCE_MIN = 6
 
const float m_StopDistance = 30 + Math.RandomFloat(0, 10)
 

Constructor & Destructor Documentation

◆ ~SCR_AICombatComponent()

void SCR_AICombatComponent.~SCR_AICombatComponent ( )

Member Function Documentation

◆ DebugPrintToWidget()

void SCR_AICombatComponent.DebugPrintToWidget ( TextWidget  w)

Used by AIDebugInfoComponent.

◆ DismountTurretCondition()

bool SCR_AICombatComponent.DismountTurretCondition ( inout vector  targetPos,
bool  targetPosProvided 
)

Condition to dismount turret Returns true when we should dismount it immediately.

Parameters
[in,out]targetPos
[in]targetPosProvided
Returns

◆ EOnInit()

override void SCR_AICombatComponent.EOnInit ( IEntity  owner)

◆ EvaluateDismountTurret()

void SCR_AICombatComponent.EvaluateDismountTurret ( float  timeSliceMs)
protected

◆ EvaluateExpectedWeapon()

void SCR_AICombatComponent.EvaluateExpectedWeapon ( out BaseWeaponComponent  outWeaponComp,
out int  outMuzzleId,
out BaseMagazineComponent  outMagazineComp 
)

Returns weapon which combat component thinks is expected to be used this situation This should be used for selecting fallback weapon in a situation without an actively attacked target.

Parameters
[out]outWeaponComp
[out]outMuzzleId
[out]outMagazineComp

◆ EvaluateLowAmmo()

bool SCR_AICombatComponent.EvaluateLowAmmo ( BaseWeaponComponent  weaponComp,
int  muzzleId 
)

Checks amount of magazines for given weapon, and if low on ammo, reports that to group.

Parameters
[in]weaponComp
[in]muzzleId
Returns

◆ EvaluateSuppressionWeapon()

void SCR_AICombatComponent.EvaluateSuppressionWeapon ( EAIUnitType  targetUnitType,
float  distanceToTarget,
out BaseWeaponComponent  outWeaponComp,
out int  outMuzzleId,
out BaseMagazineComponent  outMagazineComp 
)

Returns optimal weapon which can be used for suppressing target of given type at given range.

This will first of all return weapons which are configured in prefabs to cause indirect damage.

◆ EvaluateWeaponAndTarget()

void SCR_AICombatComponent.EvaluateWeaponAndTarget ( out bool  outWeaponEvent,
out bool  outSelectedTargetChanged,
out BaseTarget  outPrevTarget,
out BaseTarget  outCurrentTarget,
out bool  outRetreatTargetChanged,
out bool  outCompartmentChanged 
)
Parameters
[out]outWeaponEventwhen true, selected weapon, muzzle or magazine has changed
[out]outSelectedTargetChangedwhen true, selected target has changed
[out]outPrevTarget
[out]outCurrentTarget
[out]outRetreatTargetChangedwhen true, the most dangerous target we should retreat from has changed since last evaluation
[out]outCompartmentChangedwhen true, compartment has changed since last evaluation

◆ Event_OnCompartmentEntered()

void SCR_AICombatComponent.Event_OnCompartmentEntered ( IEntity  vehicle,
BaseCompartmentManagerComponent  manager,
int  mgrID,
int  slotID 
)
protected
Parameters
[in]vehicle
[in]manager
[in]mgrID
[in]slotID

◆ Event_OnCompartmentLeft()

void SCR_AICombatComponent.Event_OnCompartmentLeft ( IEntity  vehicle,
BaseCompartmentManagerComponent  manager,
int  mgrID,
int  slotID 
)
protected
Parameters
[in]vehicle
[in]manager
[in]mgrID
[in]slotID

◆ Event_OnDamage()

void SCR_AICombatComponent.Event_OnDamage ( BaseDamageContext  damageContext)
protected

◆ Event_OnDamageEffectAdded()

void SCR_AICombatComponent.Event_OnDamageEffectAdded ( notnull SCR_DamageEffect  dmgEffect)
protected

◆ Event_OnGadgetFocusStateChanged()

void SCR_AICombatComponent.Event_OnGadgetFocusStateChanged ( IEntity  gadget,
bool  isFocused 
)
protected

◆ Event_OnGadgetStateChanged()

void SCR_AICombatComponent.Event_OnGadgetStateChanged ( IEntity  gadget,
bool  isInHand,
bool  isOnGround 
)
protected

◆ Event_OnInventoryChanged()

void SCR_AICombatComponent.Event_OnInventoryChanged ( IEntity  item,
BaseInventoryStorageComponent  storageOwner 
)
protected

◆ Event_OnTimerAfterInventoryChanged()

void SCR_AICombatComponent.Event_OnTimerAfterInventoryChanged ( )
protected

◆ FindNextCoverPosition()

vector SCR_AICombatComponent.FindNextCoverPosition ( )
Returns

◆ FindTargetByEntity()

BaseTarget SCR_AICombatComponent.FindTargetByEntity ( IEntity  ent)
Parameters
[in]ent
Returns

◆ FindWeaponOfType()

BaseWeaponComponent SCR_AICombatComponent.FindWeaponOfType ( EWeaponType  weaponType)
Parameters
[in]weaponType
Returns

◆ GetAiAgent()

SCR_ChimeraAIAgent SCR_AICombatComponent.GetAiAgent ( )
Returns

◆ GetAIInfoComponent()

SCR_AIInfoComponent SCR_AICombatComponent.GetAIInfoComponent ( )

◆ GetAISkill()

EAISkill SCR_AICombatComponent.GetAISkill ( )
Returns

◆ GetAllowedActions()

EAICombatActions SCR_AICombatComponent.GetAllowedActions ( )
Returns

◆ GetCombatType()

EAICombatType SCR_AICombatComponent.GetCombatType ( )
Returns

◆ GetCurrentTarget()

BaseTarget SCR_AICombatComponent.GetCurrentTarget ( )
Returns

◆ GetCurrentWeapon()

BaseWeaponComponent SCR_AICombatComponent.GetCurrentWeapon ( )

◆ GetCurrentWeaponType()

EWeaponType SCR_AICombatComponent.GetCurrentWeaponType ( bool  overrideWithMuzzle = false)
Returns

◆ GetEndangeringEnemy()

BaseTarget SCR_AICombatComponent.GetEndangeringEnemy ( )
Returns

◆ GetFireRateCoef()

float SCR_AICombatComponent.GetFireRateCoef ( )

◆ GetLastSeenEnemy()

BaseTarget SCR_AICombatComponent.GetLastSeenEnemy ( )
Returns

◆ GetMagazineCount()

int SCR_AICombatComponent.GetMagazineCount ( TypeName  magazineWell,
bool  countMagazineInWeapon = false 
)
Parameters
[in]magazineWell
[in]countMagazineInWeapon
Returns

◆ GetRetreatTarget()

BaseTarget SCR_AICombatComponent.GetRetreatTarget ( )
Returns

◆ GetSelectedWeapon()

void SCR_AICombatComponent.GetSelectedWeapon ( out BaseWeaponComponent  outWeaponComp,
out int  outMuzzleId 
)
Parameters
[out]outWeaponComp
[out]outMuzzleId

◆ GetSelectedWeaponAndMagazine()

void SCR_AICombatComponent.GetSelectedWeaponAndMagazine ( out BaseWeaponComponent  outWeaponComp,
out int  outMuzzleId,
out BaseMagazineComponent  outMagazineComp 
)

Getters which return the weapon which combat component thinks is best against current target If there is no current target, then there is no selected weapon as well! In that case use GetExpectedWeapon.

Parameters
[out]outWeaponComp
[out]outMuzzleId
[out]outMagazineComp

◆ GetSelectedWeaponDirectDamage()

bool SCR_AICombatComponent.GetSelectedWeaponDirectDamage ( )
Returns

◆ GetSelectedWeaponMaxDist()

float SCR_AICombatComponent.GetSelectedWeaponMaxDist ( )
Returns

◆ GetSelectedWeaponMinDist()

float SCR_AICombatComponent.GetSelectedWeaponMinDist ( )
Returns

◆ GetSelectedWeaponProperties()

void SCR_AICombatComponent.GetSelectedWeaponProperties ( out float  outMinDistance,
out float  outMaxDistance,
out bool  outDirectDamage 
)
Parameters
[out]outMinDistance
[out]outMaxDistance
[out]outDirectDamage

◆ GetSelectedWeaponResource()

ResourceName SCR_AICombatComponent.GetSelectedWeaponResource ( )
Returns

◆ GetSelectedWeaponType()

EWeaponType SCR_AICombatComponent.GetSelectedWeaponType ( )
Returns

◆ GetTargetDestinationPos()

vector SCR_AICombatComponent.GetTargetDestinationPos ( )

◆ GetUnitTypesCanAttack()

EAIUnitType SCR_AICombatComponent.GetUnitTypesCanAttack ( )
Returns

◆ GetWeaponLowMagThreshold()

int SCR_AICombatComponent.GetWeaponLowMagThreshold ( BaseWeaponComponent  weapon)

◆ HasWeaponOfType()

bool SCR_AICombatComponent.HasWeaponOfType ( EWeaponType  weaponType)
Parameters
[in]weaponType
Returns

◆ InitWeaponTargetSelector()

void SCR_AICombatComponent.InitWeaponTargetSelector ( IEntity  owner)
protected

◆ IsActionAllowed()

bool SCR_AICombatComponent.IsActionAllowed ( EAICombatActions  action)
Parameters
[in]action
Returns

◆ IsEnemyKnown()

bool SCR_AICombatComponent.IsEnemyKnown ( IEntity  ent)
Parameters
[in]ent
Returns

◆ IsFriendlyInAim()

bool SCR_AICombatComponent.IsFriendlyInAim ( )
Returns

◆ IsTargetVisible()

bool SCR_AICombatComponent.IsTargetVisible ( notnull BaseTarget  target)

Checks if given target can be considered visible.

Parameters
[in]target
Returns

◆ OnDelete()

override void SCR_AICombatComponent.OnDelete ( IEntity  owner)

◆ OnPostInit()

override void SCR_AICombatComponent.OnPostInit ( IEntity  owner)

◆ RecalculateEquipmentPerceptionFactor()

void SCR_AICombatComponent.RecalculateEquipmentPerceptionFactor ( )
protected

◆ ResetAISkill()

void SCR_AICombatComponent.ResetAISkill ( )

use this to reset AI skill to default

◆ ResetAssignedTargets()

void SCR_AICombatComponent.ResetAssignedTargets ( )

◆ ResetCombatType()

void SCR_AICombatComponent.ResetCombatType ( )

◆ ResetExpectedEnemyType()

void SCR_AICombatComponent.ResetExpectedEnemyType ( )

◆ SetAISkill()

void SCR_AICombatComponent.SetAISkill ( EAISkill  skill)

Use this to change AIskill dynamically.

Parameters
[in]skill

◆ SetAssignedTargets()

void SCR_AICombatComponent.SetAssignedTargets ( array< IEntity >  assignedTargets,
SCR_AITargetClusterState  clusterState 
)

Either array of targets or target cluster must be provided.

Parameters
[in]assignedTargets
[in]clusterState

◆ SetCombatType()

void SCR_AICombatComponent.SetCombatType ( EAICombatType  combatType)
Parameters
[in]combatType

◆ SetDefaultCombatType()

void SCR_AICombatComponent.SetDefaultCombatType ( EAICombatType  combatType)

When AI use reset e.g.

after bounding overwatch it is resetted to default combat type You have to also call SetCombatType to have immediate effect.

Parameters
[in]combatType

◆ SetExpectedEnemyType()

void SCR_AICombatComponent.SetExpectedEnemyType ( EAIUnitType  expectedEnemyType)
Parameters
[in]expectedEnemyType

◆ SetFireRateCoef()

void SCR_AICombatComponent.SetFireRateCoef ( float  coef = 1,
bool  persistent = false 
)

◆ SetGroupFireRateCoef()

void SCR_AICombatComponent.SetGroupFireRateCoef ( float  coef = 1,
bool  overridePersistent = false 
)

◆ SetGroupSuppressClusterState()

void SCR_AICombatComponent.SetGroupSuppressClusterState ( SCR_AITargetClusterState  state)

◆ SetHoldFire()

void SCR_AICombatComponent.SetHoldFire ( bool  isHoldFire)
Parameters
[in]isHoldFire

◆ SetPerceptionFactor()

void SCR_AICombatComponent.SetPerceptionFactor ( float  value)

Sets perception ability.

Affects speed at which perception detects targets. Bigger value means proportionally faster detection. Provided value must be non-negative !!! Now it only affects visual detection.

Parameters
[in]value

◆ SetTargetSelectionProperties()

void SCR_AICombatComponent.SetTargetSelectionProperties ( bool  closeCombat)

◆ TryAddDismountTurretActions()

void SCR_AICombatComponent.TryAddDismountTurretActions ( vector  targetPos,
bool  addGetOut = true,
bool  addInvestigate = true,
bool  addGetIn = true 
)

Adds action to dismount turret, investigate, and go back.

Parameters
[in]targetPos
[in]addGetOut
[in]addInvestigate
[in]addGetIn

◆ Update()

void SCR_AICombatComponent.Update ( float  timeSliceMs)
Parameters
[in]timeSliceMs

◆ UpdateLastSeenPosition() [1/2]

void SCR_AICombatComponent.UpdateLastSeenPosition ( IEntity  entity,
notnull SCR_AITargetInfo  targetInfo 
)
Parameters
[in]entity
[in]targetInfo

◆ UpdateLastSeenPosition() [2/2]

void SCR_AICombatComponent.UpdateLastSeenPosition ( notnull BaseTarget  tgt,
notnull SCR_AITargetInfo  targetInfo 
)
Parameters
[in]tgt
[in]targetInfo

◆ UpdatePerceptionFactor()

void SCR_AICombatComponent.UpdatePerceptionFactor ( PerceptionComponent  perceptionComp,
SCR_AIThreatSystem  threatSystem 
)
Parameters
[in]perceptionComp
[in]threatSystem

Member Data Documentation

◆ ASSIGNED_TARGETS_SCORE_INCREMENT

const float SCR_AICombatComponent.ASSIGNED_TARGETS_SCORE_INCREMENT = 30.0
staticprotected

◆ CLOSE_RANGE_COMBAT_DISTANCE

const float SCR_AICombatComponent.CLOSE_RANGE_COMBAT_DISTANCE = 35.0
static

Within this distance AI considers combat as 'close range', used in firing times.

◆ CLOSE_RANGE_COMBAT_DISTANCE_SQ

const float SCR_AICombatComponent.CLOSE_RANGE_COMBAT_DISTANCE_SQ = CLOSE_RANGE_COMBAT_DISTANCE * CLOSE_RANGE_COMBAT_DISTANCE
static

◆ DISMOUNT_TURRET_TARGET_LAST_SEEN_MAX_S

const float SCR_AICombatComponent.DISMOUNT_TURRET_TARGET_LAST_SEEN_MAX_S = 100
staticprotected

◆ DISMOUNT_TURRET_TIMER_MS

const float SCR_AICombatComponent.DISMOUNT_TURRET_TIMER_MS = 1200
staticprotected

How much time must pass until we decide to dismount a turret if enemy is out of turret limits.

◆ DISTANCE_MAX

const float SCR_AICombatComponent.DISTANCE_MAX = 22
staticprotected

◆ DISTANCE_MIN

const float SCR_AICombatComponent.DISTANCE_MIN = 6
staticprotected

◆ ENDANGERING_TARGET_SCORE_MULTIPLIER

const float SCR_AICombatComponent.ENDANGERING_TARGET_SCORE_MULTIPLIER = 1.05
static

Multiplier of target score if target is considered endangering.

◆ ENDANGERING_TARGETS_SCORE_INCREMENT

const float SCR_AICombatComponent.ENDANGERING_TARGETS_SCORE_INCREMENT = 15.0
staticprotected

◆ FRAG_GRENADE_MAX_THREAT

const float SCR_AICombatComponent.FRAG_GRENADE_MAX_THREAT = 0.6
staticprotected

◆ LONG_RANGE_COMBAT_DISTANCE

const float SCR_AICombatComponent.LONG_RANGE_COMBAT_DISTANCE = 280.0
static

Beyond this distance AI considers combat as 'long range', used for danger events and firing times.

◆ m_aAssignedTargets

ref array<IEntity> SCR_AICombatComponent.m_aAssignedTargets = {}
protected

Array with assigned targets.

Their score is increased.

◆ m_Agent

SCR_ChimeraAIAgent SCR_AICombatComponent.m_Agent
protected

◆ m_AIInfo

SCR_AIInfoComponent SCR_AICombatComponent.m_AIInfo
protected

◆ m_bCurrentVehicleEvac

bool SCR_AICombatComponent.m_bCurrentVehicleEvac
protected

True if we're exiting vehicle because of damage/fire.

◆ m_bFriendlyAimLastResult

bool SCR_AICombatComponent.m_bFriendlyAimLastResult
protected

◆ m_bGadgetFocus

bool SCR_AICombatComponent.m_bGadgetFocus = false
protected

True when we are in gadget focus mode (like looking through binoculars)

◆ m_bIsFireRatePersistent

bool SCR_AICombatComponent.m_bIsFireRatePersistent = false
protected

◆ m_bSelectedWeaponDirectDamage

bool SCR_AICombatComponent.m_bSelectedWeaponDirectDamage
protected

◆ m_CharacterController

SCR_CharacterControllerComponent SCR_AICombatComponent.m_CharacterController
protected

◆ m_CompartmentAccess

SCR_CompartmentAccessComponent SCR_AICombatComponent.m_CompartmentAccess
protected

◆ m_ConfigComponent

SCR_AIConfigComponent SCR_AICombatComponent.m_ConfigComponent
protected

◆ m_CurrentCompartmentSlot

BaseCompartmentSlot SCR_AICombatComponent.m_CurrentCompartmentSlot
protected

Current compartment slot.

◆ m_CurrentTurretController

TurretControllerComponent SCR_AICombatComponent.m_CurrentTurretController
protected

Current turret controller (if we are in a turret)

◆ m_CurrentVehicle

IEntity SCR_AICombatComponent.m_CurrentVehicle
protected

Current vehicle.

It's not always same as compartment owner!

◆ m_CurrentVehicleCompartmentManager

SCR_BaseCompartmentManagerComponent SCR_AICombatComponent.m_CurrentVehicleCompartmentManager
protected

Vehicle's compartment manager.

◆ m_DamageManager

SCR_ExtendedDamageManagerComponent SCR_AICombatComponent.m_DamageManager
protected

◆ m_eAISkill

EAISkill SCR_AICombatComponent.m_eAISkill
protected

◆ m_eAISkillDefault

EAISkill SCR_AICombatComponent.m_eAISkillDefault
protected

◆ m_eCombatType

EAICombatType SCR_AICombatComponent.m_eCombatType = EAICombatType.NORMAL
protected

◆ m_eCurrentGadgetType

EGadgetType SCR_AICombatComponent.m_eCurrentGadgetType = -1
protected

Gadget state.

Used for detection when we use binoculars.

◆ m_eDefaultCombatType

EAICombatType SCR_AICombatComponent.m_eDefaultCombatType = EAICombatType.NORMAL
protected

◆ m_eExpectedEnemyType

EAIUnitType SCR_AICombatComponent.m_eExpectedEnemyType = EAIUnitType.UnitType_Infantry
protected

Enemy type we expect to fight.

◆ m_eUnitTypesCanAttack

EAIUnitType SCR_AICombatComponent.m_eUnitTypesCanAttack
protected

◆ m_fDismountTurretTimer

float SCR_AICombatComponent.m_fDismountTurretTimer
protected

◆ m_fEquipmentPerceptionFactor

float SCR_AICombatComponent.m_fEquipmentPerceptionFactor = 1.0
protected

How good we can spot targets based on our current equipment.

Updated by RecalculateEquipmentPerceptionFactor().

◆ m_fFireRateCoef

float SCR_AICombatComponent.m_fFireRateCoef = 1
protected

◆ m_fNextWeaponTargetEvaluation_ms

float SCR_AICombatComponent.m_fNextWeaponTargetEvaluation_ms = 0
protected

◆ m_fPerceptionFactor

float SCR_AICombatComponent.m_fPerceptionFactor = 1.0
protected

Perception factor which is set by SetPerceptionFactor().

It acts as multiplier.

◆ m_FriendlyAimShape

ref Shape SCR_AICombatComponent.m_FriendlyAimShape
protected

◆ m_fSelectedWeaponMaxDist

float SCR_AICombatComponent.m_fSelectedWeaponMaxDist
protected

◆ m_fSelectedWeaponMinDist

float SCR_AICombatComponent.m_fSelectedWeaponMinDist
protected

◆ m_iAllowedActions

EAICombatActions SCR_AICombatComponent.m_iAllowedActions
protected

will be initialised with default combat type

◆ m_InventoryManager

SCR_InventoryStorageManagerComponent SCR_AICombatComponent.m_InventoryManager
protected

◆ m_iSelectedMuzzle

int SCR_AICombatComponent.m_iSelectedMuzzle
protected

◆ m_Perception

PerceptionComponent SCR_AICombatComponent.m_Perception
protected

◆ m_SelectedMagazineComp

BaseMagazineComponent SCR_AICombatComponent.m_SelectedMagazineComp
protected

Character might currently have a different one though.

◆ m_SelectedRetreatTarget

ref BaseTarget SCR_AICombatComponent.m_SelectedRetreatTarget
protected

Target we should retreat from.

◆ m_SelectedTargetDestinationPos

vector SCR_AICombatComponent.m_SelectedTargetDestinationPos
protected

◆ m_SelectedTargetVisible

bool SCR_AICombatComponent.m_SelectedTargetVisible
protected

◆ m_SelectedWeaponComp

BaseWeaponComponent SCR_AICombatComponent.m_SelectedWeaponComp
protected

Weapon, muzzle and magazine which we want to equip.

◆ m_SelectedWeaponResource

ResourceName SCR_AICombatComponent.m_SelectedWeaponResource
protected

selected weapon handle tree read from config

◆ m_StopDistance

const float SCR_AICombatComponent.m_StopDistance = 30 + Math.RandomFloat(0, 10)
staticprotected

◆ m_TargetClusterState

SCR_AITargetClusterState SCR_AICombatComponent.m_TargetClusterState
protected

Assigned target cluster from our group.

◆ m_Utility

SCR_AIUtilityComponent SCR_AICombatComponent.m_Utility
protected

◆ m_WeaponEvaluationCompartment

BaseCompartmentSlot SCR_AICombatComponent.m_WeaponEvaluationCompartment
protected

Compartment at previous weapon evaluation.

◆ m_WeaponTargetSelector

ref AIWeaponTargetSelector SCR_AICombatComponent.m_WeaponTargetSelector = new AIWeaponTargetSelector()

◆ m_WpnManager

BaseWeaponManagerComponent SCR_AICombatComponent.m_WpnManager
protected

◆ PERCEPTION_FACTOR_ALERTED

const float SCR_AICombatComponent.PERCEPTION_FACTOR_ALERTED = 2.5
staticprotected

◆ PERCEPTION_FACTOR_EQUIPMENT_BINOCULARS

const float SCR_AICombatComponent.PERCEPTION_FACTOR_EQUIPMENT_BINOCULARS = 3.0
staticprotected

Looking through binoculars.

◆ PERCEPTION_FACTOR_EQUIPMENT_NONE

const float SCR_AICombatComponent.PERCEPTION_FACTOR_EQUIPMENT_NONE = 1.0
staticprotected

Not using any special equipment, same recognition ability as usual.

◆ PERCEPTION_FACTOR_SAFE

const float SCR_AICombatComponent.PERCEPTION_FACTOR_SAFE = 1.0
staticprotected

We are safe and are good at recognising enemies.

◆ PERCEPTION_FACTOR_THREATENED

const float SCR_AICombatComponent.PERCEPTION_FACTOR_THREATENED = 0.4
staticprotected

◆ PERCEPTION_FACTOR_VIGILANT

const float SCR_AICombatComponent.PERCEPTION_FACTOR_VIGILANT = 2.5
staticprotected

When vigilant and alert we are very good at recognising enemies.

◆ s_aForbidDismountTurretsOfVehicleTypes

ref array<EVehicleType> SCR_AICombatComponent.s_aForbidDismountTurretsOfVehicleTypes = { EVehicleType.APC }
staticprotected

Array of vehicle types we should not dismount when turret cannot shoot the target.

◆ s_aWeaponBlacklistFragGrenades

ref array<EWeaponType> SCR_AICombatComponent.s_aWeaponBlacklistFragGrenades = {EWeaponType.WT_FRAGGRENADE}
staticprotected

◆ TARGET_ENDANGERED_TIMEOUT_S

const int SCR_AICombatComponent.TARGET_ENDANGERED_TIMEOUT_S = 10
static

How long after last time target was endangering we stop treating it as such.

◆ TARGET_MAX_DISTANCE_DISARMED

const float SCR_AICombatComponent.TARGET_MAX_DISTANCE_DISARMED = 0.0
staticprotected

Max distance at which disarmed targets are considered for attack.

Now it's 0, so they never shoot disarmed targets

◆ TARGET_MAX_DISTANCE_INFANTRY

const float SCR_AICombatComponent.TARGET_MAX_DISTANCE_INFANTRY = 500.0
staticprotected

◆ TARGET_MAX_DISTANCE_VEHICLE

const float SCR_AICombatComponent.TARGET_MAX_DISTANCE_VEHICLE = 700.0
staticprotected

◆ TARGET_MAX_LAST_SEEN

const float SCR_AICombatComponent.TARGET_MAX_LAST_SEEN = 11.0
static

◆ TARGET_MAX_LAST_SEEN_DIRECT_ATTACK

const float SCR_AICombatComponent.TARGET_MAX_LAST_SEEN_DIRECT_ATTACK = 1.6
staticprotected

◆ TARGET_MAX_LAST_SEEN_DIRECT_ATTACK_CLOSE

const float SCR_AICombatComponent.TARGET_MAX_LAST_SEEN_DIRECT_ATTACK_CLOSE = 4.5
staticprotected

◆ TARGET_MAX_LAST_SEEN_INDIRECT_ATTACK

const float SCR_AICombatComponent.TARGET_MAX_LAST_SEEN_INDIRECT_ATTACK = 7.0
static

◆ TARGET_MAX_LAST_SEEN_INDIRECT_ATTACK_CLOSE

const float SCR_AICombatComponent.TARGET_MAX_LAST_SEEN_INDIRECT_ATTACK_CLOSE = 20.0
static

◆ TARGET_MAX_LAST_SEEN_INDIRECT_ATTACK_MG

const float SCR_AICombatComponent.TARGET_MAX_LAST_SEEN_INDIRECT_ATTACK_MG = 14.0
static

◆ TARGET_MAX_LAST_SEEN_VISIBLE

const float SCR_AICombatComponent.TARGET_MAX_LAST_SEEN_VISIBLE = 0.5
static

'IsTargetVisible' variable in attack tree relies on this

◆ TARGET_MAX_TIME_SINCE_ENDANGERED

const float SCR_AICombatComponent.TARGET_MAX_TIME_SINCE_ENDANGERED = 5.0
staticprotected

Max time since we were endangered to consider the enemy target endangering.

◆ TARGET_MIN_INDIRECT_TRACE_FRACTION_MIN

const float SCR_AICombatComponent.TARGET_MIN_INDIRECT_TRACE_FRACTION_MIN = 0.5
staticprotected

Min value of TraceFraction for indirect attacks.

See also
BaseTarget.GetTraceFraction.

◆ TARGET_MIN_LAST_SEEN_INDIRECT_ATTACK

const float SCR_AICombatComponent.TARGET_MIN_LAST_SEEN_INDIRECT_ATTACK = 2.0
static

◆ TARGET_SCORE_HIGH_PRIORITY_ATTACK

const float SCR_AICombatComponent.TARGET_SCORE_HIGH_PRIORITY_ATTACK = 98.5
static

Threshold for high priority attack.

◆ TARGET_SCORE_RETREAT

const float SCR_AICombatComponent.TARGET_SCORE_RETREAT = 75.0
staticprotected

Threshold for target score for retreating from that target.

◆ TURRET_TARGET_EXCESS_ANGLE_THRESHOLD_DEG

const float SCR_AICombatComponent.TURRET_TARGET_EXCESS_ANGLE_THRESHOLD_DEG = 3.0
staticprotected

We will dismount turret when target's angle exceeds turret limits by this value.

◆ WEAPON_TARGET_UPDATE_PERIOD_MS

const float SCR_AICombatComponent.WEAPON_TARGET_UPDATE_PERIOD_MS = 500
staticprotected

The documentation for this interface was generated from the following file: