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_ScenarioFrameworkAIActionJoinGroup.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_ContainerAIActionTitle
()]
2
class
SCR_ScenarioFrameworkAIActionJoinGroup
:
SCR_ScenarioFrameworkAIAction
3
{
4
[
Attribute
(
desc
:
"SlotAI with group to join (optional)"
)];
5
ref
SCR_ScenarioFrameworkGetLayerBase
m_Getter;
6
7
[
Attribute
(defvalue:
"0"
,
desc
:
"Id of Player in group to join (optional)"
,
params
:
"0 inf 1"
)];
8
int
m_iPlayerId;
9
10
//------------------------------------------------------------------------------------------------
11
override
void
OnActivate
()
12
{
13
SCR_AIGroup
group;
14
SCR_PlayerControllerGroupComponent pControllerGroupComponent;
15
16
//Get target group
17
if
(m_Getter)
18
{
19
SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_Getter.Get());
20
if
(!entityWrapper)
21
{
22
PrintFormat
(
"ScenarioFramework Action: Issue with Getter detected for Action %1."
,
this
, level:
LogLevel
.ERROR);
23
return
;
24
}
25
26
IEntity
entity = entityWrapper.GetValue();
27
if
(!entity)
28
{
29
PrintFormat
(
"ScenarioFramework Action: Entity not found for Action %1"
,
this
, level:
LogLevel
.ERROR);
30
return
;
31
}
32
33
SCR_ScenarioFrameworkSlotAI
slotAI =
SCR_ScenarioFrameworkSlotAI
.Cast(entity.
FindComponent
(
SCR_ScenarioFrameworkSlotAI
));
34
if
(slotAI)
35
group = slotAI.m_AIGroup;
36
}
37
else
if
(m_iPlayerId > 0)
38
{
39
pControllerGroupComponent = SCR_PlayerControllerGroupComponent.GetPlayerControllerComponent(m_iPlayerId);
40
if
(!pControllerGroupComponent)
41
{
42
PrintFormat
(
"ScenarioFramework Action: SCR_PlayerControllerGroupComponent not found for Action %1."
,
this
, level:
LogLevel
.ERROR);
43
return
;
44
}
45
46
group = pControllerGroupComponent.GetPlayersGroup();
47
}
48
49
if
(!group)
50
{
51
PrintFormat
(
"ScenarioFramework Action: No SCR_AIGroup found for %1."
,
this
, level:
LogLevel
.ERROR);
52
return
;
53
}
54
55
//get all agents from the group
56
array<AIAgent> agents = {};
57
m_AIGroup.GetAgents(agents);
58
59
if
(group.
IsPlayable
())
60
{
61
int
leaderId = group.
GetLeaderID
();
62
pControllerGroupComponent = SCR_PlayerControllerGroupComponent.GetPlayerControllerComponent(leaderId);
63
if
(!pControllerGroupComponent)
64
{
65
PrintFormat
(
"ScenarioFramework Action: SCR_PlayerControllerGroupComponent not found for Action %1."
,
this
, level:
LogLevel
.ERROR);
66
return
;
67
}
68
69
foreach
(AIAgent agent : agents)
70
{
71
pControllerGroupComponent.RequestAddAIAgent(SCR_ChimeraCharacter.Cast(agent.GetControlledEntity()), leaderId);
72
}
73
}
74
else
75
{
76
foreach
(AIAgent agent : agents)
77
{
78
group.
AddAIEntityToGroup
(agent.GetControlledEntity());
79
}
80
}
81
}
82
}
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
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_AIGroup
Definition
SCR_AIGroup.c:75
SCR_AIGroup::GetLeaderID
int GetLeaderID()
Definition
SCR_AIGroup.c:499
SCR_AIGroup::AddAIEntityToGroup
bool AddAIEntityToGroup(IEntity entity)
Definition
SCR_AIGroup.c:1906
SCR_AIGroup::IsPlayable
bool IsPlayable()
Definition
SCR_AIGroup.c:1580
SCR_ContainerAIActionTitle
Definition
SCR_ContainerAIActionTitle.c:2
SCR_ScenarioFrameworkAIAction
Definition
SCR_ScenarioFrameworkAIAction.c:3
SCR_ScenarioFrameworkAIActionJoinGroup
Definition
SCR_ScenarioFrameworkAIActionJoinGroup.c:3
SCR_ScenarioFrameworkGetLayerBase
Definition
SCR_ScenarioFrameworkGetLayerBase.c:3
SCR_ScenarioFrameworkSlotAI
Definition
SCR_ScenarioFrameworkSlotAI.c:12
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
PrintFormat
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
ScenarioFramework
Actions
AIActions
SCR_ScenarioFrameworkAIActionJoinGroup.c
Generated by
1.17.0