Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIBehavior.c
Go to the documentation of this file.
2 {
3  SCR_AIUtilityComponent m_Utility;
4 
5  float m_fThreat = 0.0; // This threat value will be added to the calculated threat level in threat system
6  bool m_bAllowLook = true;
7  bool m_bResetLook = false;
8  bool m_bUseCombatMove = false;
9 
10  //---------------------------------------------------------------------------------------------------------------------------------
11  void SCR_AIBehaviorBase(SCR_AIUtilityComponent utility, SCR_AIActivityBase groupActivity)
12  {
13  m_Utility = utility;
14  SetRelatedGroupActivity(groupActivity);
15  }
16 
17  //---------------------------------------------------------------------------------------------------------------------------------
18  SCR_AIActivityBase GetGroupActivityContext()
19  {
20  return SCR_AIActivityBase.Cast(GetRelatedGroupActivity());
21  }
22 
23  //---------------------------------------------------------------------------------------------------------------------------------
24  override void OnActionSelected()
25  {
26  super.OnActionSelected();
27  if (m_bResetLook)
28  m_Utility.m_LookAction.Cancel();
29  }
30 
31  //---------------------------------------------------------------------------------------------------------------------------------
32  #ifdef AI_DEBUG
33  override protected void AddDebugMessage(string str)
34  {
35  SCR_AIInfoBaseComponent infoComp = SCR_AIInfoBaseComponent.Cast(m_Utility.GetOwner().FindComponent(SCR_AIInfoBaseComponent));
36  infoComp.AddDebugMessage(string.Format("%1: %2", this, str), msgType: EAIDebugMsgType.ACTION);
37  }
38  #endif
39 };
40 
42 {
43  void SCR_AIWaitBehavior(SCR_AIUtilityComponent utility, SCR_AIActivityBase groupActivity)
44  {
45  m_sBehaviorTree = "AI/BehaviorTrees/Chimera/Soldier/Wait.bt";
46  SetPriority(10);
47  }
48 };
49 
51 {
52  void SCR_AIIdleBehavior(SCR_AIUtilityComponent utility, SCR_AIActivityBase groupActivity)
53  {
54  if (!utility)
55  return;
56  m_sBehaviorTree = "AI/BehaviorTrees/Chimera/Soldier/Idle.bt";
57  SetPriority(1.0);
58  }
59 
60  override void OnActionSelected()
61  {
62  super.OnActionSelected();
63 
64  // Temporary solution to make AI select some generic weapon suitable against infantry, like a rifle.
65  m_Utility.m_CombatComponent.SetExpectedEnemyType(EAIUnitType.UnitType_Infantry);
66  }
67 };
68 
SCR_AIIdleBehavior
Definition: SCR_AIBehavior.c:50
EAIDebugMsgType
EAIDebugMsgType
Definition: SCR_AIDebugMessage.c:1
SCR_AIActionBase
Definition: SCR_AIAction.c:1
SCR_AIActivityBase
Definition: SCR_AIActivity.c:1
EAIUnitType
EAIUnitType
Definition: EAIUnitType.c:12
SCR_AIBehaviorBase
Definition: SCR_AIBehavior.c:1
SCR_AIWaitBehavior
Definition: SCR_AIBehavior.c:41