Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIMoveActivity.c
Go to the documentation of this file.
2 {
3  protected static const string MOVEMENT_TYPE_PORT = "MovementType";
4 
5  ref SCR_BTParamAssignable<vector> m_vPosition = new SCR_BTParamAssignable<vector>(SCR_AIActionTask.POSITION_PORT);
6  ref SCR_BTParam<IEntity> m_Entity = new SCR_BTParam<IEntity>(SCR_AIActionTask.ENTITY_PORT);
7  ref SCR_BTParam<bool> m_bUseVehicles = new SCR_BTParam<bool>(SCR_AIActionTask.USE_VEHICLES_PORT);
8  ref SCR_BTParam<EMovementType> m_eMovementType = new SCR_BTParam<EMovementType>(MOVEMENT_TYPE_PORT);
9 
10  //------------------------------------------------------------------------------------------------
11  void InitParameters(vector position, IEntity entity, EMovementType movementType, bool useVehicles, float priorityLevel)
12  {
13  m_vPosition.Init(this, position);
14  m_vPosition.m_AssignedOut = (position != vector.Zero);
15  m_Entity.Init(this, entity);
16  m_bUseVehicles.Init(this, useVehicles);
17  m_eMovementType.Init(this, movementType);
18  m_fPriorityLevel.Init(this, priorityLevel);
19  }
20 
21  //------------------------------------------------------------------------------------------------
22  void SCR_AIMoveActivity(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint, vector pos, IEntity ent, EMovementType movementType = EMovementType.RUN, bool useVehicles = true, float priority = PRIORITY_ACTIVITY_MOVE, float priorityLevel = PRIORITY_LEVEL_NORMAL)
23  {
24  InitParameters(pos, ent, movementType, useVehicles, priorityLevel);
25  m_sBehaviorTree = "AI/BehaviorTrees/Chimera/Group/ActivityMove.bt";
26  SetPriority(priority);
27  }
28 
29  //------------------------------------------------------------------------------------------------
30  override string GetActionDebugInfo()
31  {
32  return this.ToString() + " moving to " + m_vPosition.ValueToString();
33  }
34 
35  //------------------------------------------------------------------------------------------------
36  override void OnActionCompleted()
37  {
38  super.OnActionCompleted();
39  if (m_bUseVehicles.m_Value)
40  {
41  SCR_AIGroup group = SCR_AIGroup.Cast(m_Utility.GetAIAgent());
42  if (!group)
43  return;
44  group.ReleaseCompartments();
45  }
46  SendCancelMessagesToAllAgents();
47  }
48 
49  //------------------------------------------------------------------------------------------------
50  override void OnActionFailed()
51  {
52  super.OnActionFailed();
53  if (m_bUseVehicles.m_Value)
54  {
55  SCR_AIGroup group = SCR_AIGroup.Cast(m_Utility.GetAIAgent());
56  if (!group)
57  return;
58  group.ReleaseCompartments();
59  }
60  SendCancelMessagesToAllAgents();
61  }
62 
63  override void OnActionDeselected()
64  {
65  super.OnActionDeselected();
66  SendCancelMessagesToAllAgents();
67  }
68 };
69 
71 {
72  void SCR_AISeekAndDestroyActivity(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint, vector pos, IEntity ent, EMovementType movementType = EMovementType.RUN, bool useVehicles = false, float priority = PRIORITY_ACTIVITY_SEEK_AND_DESTROY, float priorityLevel = PRIORITY_LEVEL_NORMAL)
73  {
74  //m_bRemoveOnCompletion = false; removed: after S&D move was not realized, completed S&D was not removed
75  m_sBehaviorTree = "AI/BehaviorTrees/Chimera/Group/ActivitySeekDestroy.bt";
76  }
77 
78  override string GetActionDebugInfo()
79  {
80  return this.ToString() + " seek and destroy around" + m_Entity.ValueToString();
81  }
82 };
83 
85 {
86  ref SCR_BTParam<float> m_fCompletionDistance = new SCR_BTParam<float>(SCR_AIActionTask.DESIREDDISTANCE_PORT);
87 
88  // SCR_AIBaseUtilityComponent utility, bool isWaypointRelated, vector pos, float priority = PRIORITY_ACTIVITY_MOVE, IEntity ent = null, bool useVehicles = true
89  void SCR_AIFollowActivity(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint, vector pos, IEntity ent, EMovementType movementType = EMovementType.RUN, bool useVehicles = false, float priority = PRIORITY_ACTIVITY_FOLLOW, float priorityLevel = PRIORITY_LEVEL_NORMAL, float distance = 1.0)
90  {
91  m_sBehaviorTree = "AI/BehaviorTrees/Chimera/Group/ActivityFollow.bt";
92  m_fCompletionDistance.Init(this, distance);
93  }
94 
95  override string GetActionDebugInfo()
96  {
97  return this.ToString() + " following entity " + m_Entity.ValueToString();
98  }
99 };
SCR_AIFollowActivity
Definition: SCR_AIMoveActivity.c:84
SCR_AISeekAndDestroyActivity
Definition: SCR_AIMoveActivity.c:70
EMovementType
EMovementType
Definition: EMovementType.c:12
m_fPriorityLevel
float m_fPriorityLevel
Definition: SendGoalMessage.c:3
m_Entity
enum EAITargetInfoCategory m_Entity
SCR_AIActivityBase
Definition: SCR_AIActivity.c:1
distance
float distance
Definition: SCR_DestructibleTreeV2.c:29
m_eMovementType
EMovementType m_eMovementType
Definition: SCR_AICombatMoveRequest.c:84
SCR_AIMoveActivity
Definition: SCR_AIMoveActivity.c:1
SCR_AIGroup
Definition: SCR_AIGroup.c:68
m_bUseVehicles
bool m_bUseVehicles
Definition: SendGoalMessage.c:284
m_vPosition
vector m_vPosition
Definition: SCR_AITalkRequest.c:23
SCR_AIActionTask
Definition: SCR_AIBehaviorTask.c:1
position
vector position
Definition: SCR_DestructibleTreeV2.c:30