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_ScenarioFrameworkActionOnAllChildrenSpawned.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_ContainerAIActionTitle
()]
2
class
SCR_ScenarioFrameworkActionOnAllChildrenSpawned
:
SCR_ScenarioFrameworkActionBase
3
{
4
[
Attribute
(
desc
:
"Getter for scenarioFramework layerBase (or inherited class), which will be checked"
)];
5
ref
SCR_ScenarioFrameworkGet
m_Getter;
6
7
[
Attribute
(
desc
:
"Actions to be called"
)]
8
ref array<ref SCR_ScenarioFrameworkActionBase> m_aActions;
9
10
//------------------------------------------------------------------------------------------------
11
override
void
OnActivate
(
IEntity
object
)
12
{
13
if
(!CanActivate())
14
return
;
15
16
//Process Array
17
SCR_ScenarioFrameworkParam<array<IEntity>> entityArrayWrapper = SCR_ScenarioFrameworkParam<array<IEntity>>.Cast(m_Getter.Get());
18
if
(entityArrayWrapper)
19
{
20
array<IEntity> entities = {};
21
entities = entityArrayWrapper.GetValue();
22
23
if
(entities.IsEmpty())
24
{
25
Print
(
string
.Format(
"ScenarioFramework Action: Array Getter for %1 has no elements to work with."
,
this
),
LogLevel
.ERROR);
26
return
;
27
}
28
29
foreach
(
IEntity
entity : entities)
30
{
31
ProcessEntity(entity);
32
}
33
34
return
;
35
}
36
37
//Process single entity
38
SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_Getter.Get());
39
IEntity
entity = entityWrapper.GetValue();
40
if
(!entity)
41
{
42
Print
(
string
.Format(
"ScenarioFramework Action: Entity not found for Action %1."
,
this
),
LogLevel
.ERROR);
43
return
;
44
}
45
46
ProcessEntity(entity);
47
}
48
49
//------------------------------------------------------------------------------------------------
50
void
ProcessEntity(
IEntity
ent)
51
{
52
SCR_ScenarioFrameworkLayerBase
layerBase =
SCR_ScenarioFrameworkLayerBase
.Cast(ent.
FindComponent
(
SCR_ScenarioFrameworkLayerBase
));
53
if
(!layerBase)
54
{
55
//Pass entities directly to Actions
56
foreach
(
SCR_ScenarioFrameworkActionBase
action : m_aActions)
57
{
58
action.OnActivate(ent);
59
}
60
61
return
;
62
}
63
64
if
(layerBase.GetIsInitiated())
65
ActivateActions
(layerBase);
66
67
layerBase.GetOnAllChildrenSpawned().Insert(ActivateActions);
68
69
}
70
71
//------------------------------------------------------------------------------------------------
72
void
ActivateActions
(notnull
SCR_ScenarioFrameworkLayerBase
layerBase)
73
{
74
foreach
(
SCR_ScenarioFrameworkActionBase
action : m_aActions)
75
{
76
action.OnActivate(layerBase.GetOwner());
77
}
78
}
79
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
OnActivate
override void OnActivate()
Definition
SCR_CharacterCommandLoiter.c:31
ActivateActions
void ActivateActions()
Definition
SCR_MenuActionsComponent.c:171
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
SCR_ScenarioFrameworkLayerBase
void SCR_ScenarioFrameworkLayerBase(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_ScenarioFrameworkLayerBase.c:1411
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_ContainerAIActionTitle
Definition
SCR_ContainerAIActionTitle.c:2
SCR_ScenarioFrameworkActionBase
Definition
SCR_ScenarioFrameworkActionBase.c:3
SCR_ScenarioFrameworkActionOnAllChildrenSpawned
Definition
SCR_ScenarioFrameworkActionOnAllChildrenSpawned.c:3
SCR_ScenarioFrameworkGet
Definition
SCR_ScenarioFrameworkGet.c:3
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
SCR_ScenarioFrameworkActionOnAllChildrenSpawned.c
Generated by
1.17.0