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_Tutorial_SquadLeadership_FollowingOrderWait.c
Go to the documentation of this file.
1
[
EntityEditorProps
(insertable:
false
)]
2
class
SCR_Tutorial_SquadLeadership_FollowingOrderWaitClass
:
SCR_BaseTutorialStageClass
3
{
4
}
5
6
//------------------------------------------------------------------------------------------------
7
class
SCR_Tutorial_SquadLeadership_FollowingOrderWait :
SCR_BaseTutorialStage
8
{
9
protected
ref array <IEntity>
m_aSoldiers
;
10
11
//------------------------------------------------------------------------------------------------
12
override
protected
void
Setup
()
13
{
14
m_aSoldiers
= {};
15
16
SCR_PlayerController
playerController =
SCR_PlayerController
.Cast(
GetGame
().
GetPlayerController
());
17
if
(!playerController)
18
return
;
19
20
SCR_PlayerControllerGroupComponent playerGroupComp = SCR_PlayerControllerGroupComponent.Cast(playerController.FindComponent(SCR_PlayerControllerGroupComponent));
21
if
(!playerGroupComp)
22
return
;
23
24
SCR_GroupsManagerComponent
groupsManager =
SCR_GroupsManagerComponent
.GetInstance();
25
if
(!groupsManager)
26
return
;
27
28
SCR_AIGroup
group = groupsManager.FindGroup(playerGroupComp.GetGroupID());
29
if
(!group)
30
return
;
31
32
array <AIAgent> agents = {};
33
group.
GetSlave
().GetAgents(agents);
34
if
(agents.IsEmpty())
35
return
;
36
37
IEntity
soldier;
38
foreach
(AIAgent agent : agents)
39
{
40
if
(!agent)
41
continue
;
42
43
soldier = agent.GetControlledEntity();
44
if
(!soldier)
45
continue
;
46
47
m_aSoldiers
.Insert(soldier);
48
RegisterWaypoint
(soldier,
""
,
"MISC"
);
49
}
50
}
51
52
//------------------------------------------------------------------------------------------------
53
override
protected
bool
GetIsFinished
()
54
{
55
if
(!
m_aSoldiers
)
56
return
false
;
57
58
vector
unitPos;
59
vector
playerPos =
m_Player
.GetOrigin();
60
61
for
(
int
i =
m_aSoldiers
.Count() - 1; i >= 0; i--)
62
{
63
if
(!
m_aSoldiers
[i])
64
continue
;
65
66
unitPos =
m_aSoldiers
[i].GetOrigin();
67
if
(
vector
.Distance(unitPos, playerPos) <= 10)
68
m_aSoldiers
.Remove(i);
69
}
70
71
return
m_aSoldiers
.IsEmpty();
72
}
73
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
m_Player
ChimeraCharacter m_Player
Definition
SCR_CameraLimitedEditorComponent.c:26
EntityEditorProps
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Definition
SCR_CompassComponent.c:10
SCR_GroupsManagerComponent
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_GroupsManagerComponent.c:1747
m_aSoldiers
SCR_Tutorial_SquadLeadership_FollowingOrderWaitClass m_aSoldiers
IEntity
Definition
IEntity.c:13
SCR_AIGroup
Definition
SCR_AIGroup.c:75
SCR_AIGroup::GetSlave
SCR_AIGroup GetSlave()
Definition
SCR_AIGroup.c:2604
SCR_BaseTutorialStageClass
Definition
SCR_BaseTutorialStage.c:3
SCR_BaseTutorialStage
Definition
SCR_BaseTutorialStage.c:8
SCR_BaseTutorialStage::Setup
void Setup()
Definition
SCR_BaseTutorialStage.c:208
SCR_BaseTutorialStage::GetIsFinished
bool GetIsFinished()
Definition
SCR_BaseTutorialStage.c:214
SCR_BaseTutorialStage::RegisterWaypoint
SCR_Waypoint RegisterWaypoint(string entityName, string title=string.Empty, string icon="MISC")
Definition
SCR_BaseTutorialStage.c:293
SCR_PlayerController
Definition
SCR_PlayerController.c:31
SCR_Tutorial_SquadLeadership_FollowingOrderWaitClass
Definition
SCR_Tutorial_SquadLeadership_FollowingOrderWait.c:3
vector
Definition
vector.c:13
GetPlayerController
proto external PlayerController GetPlayerController()
Definition
SCR_PlayerDeployMenuHandlerComponent.c:307
scripts
Game
GameMode
Tutorial
Stages
Commanding
SCR_Tutorial_SquadLeadership_FollowingOrderWait.c
Generated by
1.17.0