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_ScenarioFrameworkGetArrayOfPlayers.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_ContainerActionTitle
()]
2
class
SCR_ScenarioFrameworkGetArrayOfPlayers
:
SCR_ScenarioFrameworkGet
3
{
4
[
Attribute
(defvalue:
""
,
UIWidgets
.EditComboBox,
desc
:
"(Optional) You can filter players by putting the Faction Key of desired faction(s). If not used, all players will be fetched."
)]
5
ref array<string> m_aFactionKeys;
6
7
ref array<IEntity> m_aEntities = {};
8
9
//------------------------------------------------------------------------------------------------
10
override
SCR_ScenarioFrameworkParamBase
Get()
11
{
12
m_aEntities.Clear();
13
GetPlayerEntities(m_aEntities);
14
15
return
new
SCR_ScenarioFrameworkParam<array<IEntity>>(m_aEntities);
16
}
17
18
//------------------------------------------------------------------------------------------------
20
void
GetPlayerEntities(out notnull array<IEntity> aEntities)
21
{
22
array<int> playerIDs = {};
23
GetGame
().GetPlayerManager().GetPlayers(playerIDs);
24
25
IEntity
playerEntity;
26
SCR_ChimeraCharacter chimeraCharacter;
27
bool
factionKeyIsEmpty = m_aFactionKeys.IsEmpty();
28
29
if
(!factionKeyIsEmpty)
30
{
31
// Resolve Alias
32
SCR_FactionAliasComponent factionAliasComponent = SCR_FactionAliasComponent.Cast(
GetGame
().GetFactionManager().FindComponent(SCR_FactionAliasComponent));
33
if
(factionAliasComponent)
34
{
35
array<string> aliasedFactionKeys = {};
36
foreach
(
string
factionKey : m_aFactionKeys)
37
{
38
aliasedFactionKeys.Insert(factionAliasComponent.ResolveFactionAlias(factionKey))
39
}
40
41
if
(!aliasedFactionKeys.IsEmpty())
42
{
43
m_aFactionKeys.Clear();
44
m_aFactionKeys.InsertAll(aliasedFactionKeys);
45
46
}
47
}
48
}
49
50
foreach
(
int
playerID : playerIDs)
51
{
52
playerEntity =
GetGame
().GetPlayerManager().GetPlayerControlledEntity(playerID);
53
if
(!playerEntity)
54
continue
;
55
56
if
(!factionKeyIsEmpty)
57
{
58
chimeraCharacter = SCR_ChimeraCharacter.Cast(playerEntity);
59
if
(!chimeraCharacter || !m_aFactionKeys.Contains(chimeraCharacter.GetFactionKey()))
60
continue
;
61
}
62
63
aEntities.Insert(playerEntity);
64
}
65
}
66
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
IEntity
Definition
IEntity.c:13
SCR_ContainerActionTitle
Definition
SCR_ContainerActionTitle.c:2
SCR_ScenarioFrameworkGetArrayOfPlayers
Definition
SCR_ScenarioFrameworkGetArrayOfPlayers.c:3
SCR_ScenarioFrameworkGet
Definition
SCR_ScenarioFrameworkGet.c:3
SCR_ScenarioFrameworkParamBase
Definition
SCR_ScenarioFrameworkParamBase.c:2
UIWidgets
Definition
attributes.c:40
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
ScenarioFramework
Actions
ActionGetters
SCR_ScenarioFrameworkGetArrayOfPlayers.c
Generated by
1.17.0