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_ScenarioFrameworkActionAI.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_ContainerAIActionTitle
()]
2
class
SCR_ScenarioFrameworkActionAI
:
SCR_ScenarioFrameworkActionBase
3
{
4
[
Attribute
(
desc
:
"Target SlotAI for AI Action - if left empty, it will attempt to retrieve it from the Slot it is attached to. Additionally you can use Get Array Of LayerBases and this action will be executed on all of them."
)];
5
ref
SCR_ScenarioFrameworkGet
m_Getter;
6
7
[
Attribute
(
desc
:
"AI actions that will be executed on target AI"
)];
8
ref array<ref SCR_ScenarioFrameworkAIAction> m_aAIActions;
9
10
//------------------------------------------------------------------------------------------------
11
override
void
OnActivate
(
IEntity
object
)
12
{
13
if
(!CanActivate())
14
return
;
15
16
if
(!m_Getter)
17
{
18
ProcessEntity(
object
,
object
);
19
}
20
else
21
{
22
SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_Getter.Get());
23
if
(!entityWrapper)
24
{
25
SCR_ScenarioFrameworkParam<array<IEntity>> entityArrayWrapper = SCR_ScenarioFrameworkParam<array<IEntity>>.Cast(m_Getter.Get());
26
if
(!entityArrayWrapper)
27
{
28
Print
(
string
.Format(
"ScenarioFramework Action: Issue with Getter detected for Action %1."
,
this
),
LogLevel
.ERROR);
29
return
;
30
}
31
32
array<IEntity> entities = {};
33
entities = entityArrayWrapper.GetValue();
34
35
if
(entities.IsEmpty())
36
{
37
Print
(
string
.Format(
"ScenarioFramework Action: Array Getter for %1 has no elements to work with."
,
this
),
LogLevel
.ERROR);
38
return
;
39
}
40
41
foreach
(
IEntity
entity : entities)
42
{
43
ProcessEntity(
object
, entity);
44
}
45
46
return
;
47
}
48
49
IEntity
entity = entityWrapper.GetValue();
50
if
(!entity)
51
{
52
Print
(
string
.Format(
"ScenarioFramework Action: Entity not found for Action %1."
,
this
),
LogLevel
.ERROR);
53
return
;
54
}
55
56
ProcessEntity(
object
, entity);
57
}
58
}
59
60
//------------------------------------------------------------------------------------------------
61
void
ProcessEntity(
IEntity
object
,
IEntity
entity)
62
{
63
if
(!entity)
64
{
65
Print
(
string
.Format(
"ScenarioFramework Action: Entity not found for Action %1."
,
this
),
LogLevel
.ERROR);
66
return
;
67
}
68
69
SCR_ScenarioFrameworkSlotAI
slotAI =
SCR_ScenarioFrameworkSlotAI
.Cast(entity.
FindComponent
(
SCR_ScenarioFrameworkSlotAI
));
70
SCR_ScenarioFrameworkSlotTaskAI slotTaskAI = SCR_ScenarioFrameworkSlotTaskAI.Cast(entity.
FindComponent
(SCR_ScenarioFrameworkSlotTaskAI));
71
if
(!slotAI && !slotTaskAI)
72
{
73
Print
(
string
.Format(
"ScenarioFramework Action: SlotAI not found for Action %1."
,
this
),
LogLevel
.ERROR);
74
return
;
75
}
76
77
SCR_AIGroup
targetAIGroup;
78
if
(slotAI)
79
targetAIGroup = slotAI.m_AIGroup;
80
else
if
(slotTaskAI)
81
targetAIGroup = slotTaskAI.m_AIGroup;
82
83
if
(!targetAIGroup)
84
{
85
Print
(
string
.Format(
"ScenarioFramework Action: AI Group not found for Action %1."
,
this
),
LogLevel
.ERROR);
86
return
;
87
}
88
89
foreach
(
SCR_ScenarioFrameworkAIAction
AIAction : m_aAIActions)
90
{
91
AIAction.Init(targetAIGroup,
object
);
92
}
93
}
94
95
//------------------------------------------------------------------------------------------------
96
array<ref SCR_ScenarioFrameworkAIAction> GetSubActionsAI()
97
{
98
return
m_aAIActions;
99
}
100
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
OnActivate
override void OnActivate()
Definition
SCR_CharacterCommandLoiter.c:31
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_AIGroup
Definition
SCR_AIGroup.c:75
SCR_ContainerAIActionTitle
Definition
SCR_ContainerAIActionTitle.c:2
SCR_ScenarioFrameworkAIAction
Definition
SCR_ScenarioFrameworkAIAction.c:3
SCR_ScenarioFrameworkActionAI
Definition
SCR_ScenarioFrameworkActionAI.c:3
SCR_ScenarioFrameworkActionBase
Definition
SCR_ScenarioFrameworkActionBase.c:3
SCR_ScenarioFrameworkGet
Definition
SCR_ScenarioFrameworkGet.c:3
SCR_ScenarioFrameworkSlotAI
Definition
SCR_ScenarioFrameworkSlotAI.c:12
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
ScenarioFramework
Actions
AIActions
SCR_ScenarioFrameworkActionAI.c
Generated by
1.17.0