Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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 float CustomEvaluate()
31 {
32 if (m_Utility.HasActionOfType(SCR_AIHealActivity))
33 return 0;
34
35 return GetPriority();
36 }
37
38 //------------------------------------------------------------------------------------------------
39 override string GetActionDebugInfo()
40 {
41 return this.ToString() + " moving to " + m_vPosition.m_Value.ToString();
42 }
43
44 //------------------------------------------------------------------------------------------------
45 override void OnActionCompleted()
46 {
47 super.OnActionCompleted();
48 if (m_bUseVehicles.m_Value)
49 {
50 SCR_AIGroup group = SCR_AIGroup.Cast(m_Utility.GetAIAgent());
51 if (!group)
52 return;
53 group.ReleaseCompartments();
54 }
56 }
57
58 //------------------------------------------------------------------------------------------------
59 override void OnActionFailed()
60 {
61 super.OnActionFailed();
62 if (m_bUseVehicles.m_Value)
63 {
64 SCR_AIGroup group = SCR_AIGroup.Cast(m_Utility.GetAIAgent());
65 if (!group)
66 return;
67 group.ReleaseCompartments();
68 }
70 }
71
72 //------------------------------------------------------------------------------------------------
73 override void OnActionDeselected()
74 {
75 super.OnActionDeselected();
77 }
78};
ref SCR_BTParam< float > m_fPriorityLevel
enum EAIActionFailReason PRIORITY_LEVEL_NORMAL
ResourceName m_sBehaviorTree
void SendCancelMessagesToAllAgents()
void SCR_AIActivityBase(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint)
enum SCR_EAIActivityCause m_Utility
vector position
void ReleaseCompartments()
ref SCR_BTParamAssignable< vector > m_vPosition
override void OnActionDeselected()
ref SCR_BTParam< EMovementType > m_eMovementType
override float CustomEvaluate()
override string GetActionDebugInfo()
ref SCR_BTParam< IEntity > m_Entity
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)
override void OnActionFailed()
ref SCR_BTParam< bool > m_bUseVehicles
void InitParameters(vector position, IEntity entity, EMovementType movementType, bool useVehicles, float priorityLevel)
static const string MOVEMENT_TYPE_PORT
override void OnActionCompleted()
EMovementType
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.