Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_AIFollowActivity.c
Go to the documentation of this file.
1
class
SCR_AIFollowActivity
:
SCR_AIActivityBase
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
;
6
protected
bool
m_bTargetEntityIsCharacter
;
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
{
32
m_bTargetEntityIsCharacter
=
true
;
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)
47
if
(
m_bTargetEntityIsCharacter
)
48
{
49
// Fail if target character to follow is null or unconscious
50
if
(!
m_TargetCharacterController
||
m_TargetCharacterController
.IsUnconscious())
51
Fail
();
52
}
53
54
return
GetPriority
();
55
}
56
57
//------------------------------------------------------------------------------------------------
58
override
void
OnActionCompleted
()
59
{
60
super.OnActionCompleted();
61
SendCancelMessagesToAllAgents
();
62
}
63
64
//------------------------------------------------------------------------------------------------
65
override
void
OnActionFailed
()
66
{
67
super.OnActionFailed();
68
SendCancelMessagesToAllAgents
();
69
}
70
71
//------------------------------------------------------------------------------------------------
72
override
void
OnActionDeselected
()
73
{
74
super.OnActionDeselected();
75
SendCancelMessagesToAllAgents
();
76
}
77
};
m_fPriorityLevel
ref SCR_BTParam< float > m_fPriorityLevel
Definition
SCR_AIAction.c:87
PRIORITY_LEVEL_NORMAL
enum EAIActionFailReason PRIORITY_LEVEL_NORMAL
m_sBehaviorTree
ResourceName m_sBehaviorTree
Definition
SCR_AIAction.c:89
Fail
void Fail(bool doNotCompleteWaypoint)
Definition
SCR_AIActivity.c:75
SendCancelMessagesToAllAgents
void SendCancelMessagesToAllAgents()
Definition
SCR_AIActivity.c:51
SCR_AIActivityBase
void SCR_AIActivityBase(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint)
Definition
SCR_AIActivity.c:44
distance
float distance
Definition
SCR_DestructibleTreeV2.c:29
ChimeraCharacter
Definition
ChimeraCharacter.c:13
IEntity
Definition
IEntity.c:13
SCR_AIActionTask
Definition
SCR_AIBehaviorTask.c:2
SCR_AIFollowActivity::OnActionDeselected
override void OnActionDeselected()
Definition
SCR_AIFollowActivity.c:72
SCR_AIFollowActivity::OnActionCompleted
override void OnActionCompleted()
Definition
SCR_AIFollowActivity.c:58
SCR_AIFollowActivity::InitParameters
void InitParameters(IEntity entity, float priorityLevel)
Definition
SCR_AIFollowActivity.c:9
SCR_AIFollowActivity::SCR_AIFollowActivity
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)
Definition
SCR_AIFollowActivity.c:17
SCR_AIFollowActivity::CustomEvaluate
override float CustomEvaluate()
Definition
SCR_AIFollowActivity.c:44
SCR_AIFollowActivity::OnActionFailed
override void OnActionFailed()
Definition
SCR_AIFollowActivity.c:65
SCR_AIFollowActivity::m_TargetCharacterController
CharacterControllerComponent m_TargetCharacterController
Definition
SCR_AIFollowActivity.c:5
SCR_AIFollowActivity::m_bTargetEntityIsCharacter
bool m_bTargetEntityIsCharacter
Definition
SCR_AIFollowActivity.c:6
SCR_AIFollowActivity::GetActionDebugInfo
override string GetActionDebugInfo()
Definition
SCR_AIFollowActivity.c:38
SCR_AIGroupUtilityComponent
Definition
SCR_AIGroupUtilityComponent.c:18
vector
Definition
vector.c:13
EMovementType
EMovementType
Definition
EMovementType.c:13
GetPriority
int GetPriority()
Definition
SCR_BaseManualCameraComponent.c:247
ToString
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.
scripts
Game
AI
Behavior
SCR_AIFollowActivity.c
Generated by
1.17.0