Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIFollowActivity.c
Go to the documentation of this file.
2{
3 ref SCR_BTParam<IEntity> m_Entity = new SCR_BTParam<IEntity>(SCR_AIActionTask.ENTITY_PORT);
4 ref SCR_BTParam<float> m_fCompletionDistance = new SCR_BTParam<float>(SCR_AIActionTask.DESIREDDISTANCE_PORT);
5 protected CharacterControllerComponent m_TargetCharacterController;
7
8 //------------------------------------------------------------------------------------------------
9 void InitParameters(IEntity entity,float priorityLevel)
10 {
11 m_Entity.Init(this, entity);
12 m_fPriorityLevel.Init(this, priorityLevel);
13 }
14
15 //------------------------------------------------------------------------------------------------
16 // SCR_AIBaseUtilityComponent utility, bool isWaypointRelated, vector pos, float priority = PRIORITY_ACTIVITY_MOVE, IEntity ent = null, bool useVehicles = true
17 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)
18 {
19 InitParameters(ent, priorityLevel);
20 m_fCompletionDistance.Init(this, distance);
21 m_sBehaviorTree = "AI/BehaviorTrees/Chimera/Group/ActivityFollow.bt";
22 SetPriority(priority);
23
24 if (!utility)
25 return;
26
27 ChimeraCharacter character = ChimeraCharacter.Cast(ent);
28 if (!character)
29 return;
30 else
31 {
33 m_TargetCharacterController = character.GetCharacterController();
34 }
35 }
36
37 //------------------------------------------------------------------------------------------------
38 override string GetActionDebugInfo()
39 {
40 return this.ToString() + " following entity " + m_Entity.m_Value.ToString();
41 }
42
43 //------------------------------------------------------------------------------------------------
44 override float CustomEvaluate()
45 {
46 // Check if followed entity is character (not vehicle)
48 {
49 // Fail if target character to follow is null or unconscious
51 Fail();
52 }
53
54 return GetPriority();
55 }
56
57 //------------------------------------------------------------------------------------------------
58 override void OnActionCompleted()
59 {
60 super.OnActionCompleted();
62 }
63
64 //------------------------------------------------------------------------------------------------
65 override void OnActionFailed()
66 {
67 super.OnActionFailed();
69 }
70
71 //------------------------------------------------------------------------------------------------
72 override void OnActionDeselected()
73 {
74 super.OnActionDeselected();
76 }
77};
ref SCR_BTParam< float > m_fPriorityLevel
enum EAIActionFailReason PRIORITY_LEVEL_NORMAL
ResourceName m_sBehaviorTree
void Fail(bool doNotCompleteWaypoint)
void SendCancelMessagesToAllAgents()
void SCR_AIActivityBase(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint)
float distance
override void OnActionDeselected()
override void OnActionCompleted()
void InitParameters(IEntity entity, float priorityLevel)
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)
override float CustomEvaluate()
override void OnActionFailed()
CharacterControllerComponent m_TargetCharacterController
override string GetActionDebugInfo()
EMovementType
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.