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_LookAtGroupCommand.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
[
BaseContainerProps
(),
SCR_BaseGroupCommandTitleField
(
"m_sCommandName"
)]
3
class
SCR_LookAtGroupCommand
:
SCR_BaseGroupCommand
4
{
5
//------------------------------------------------------------------------------------------------
6
override
bool
Execute(
IEntity
cursorTarget,
IEntity
target,
vector
targetPosition,
int
playerID,
bool
isClient)
7
{
8
if
(isClient && playerID ==
SCR_PlayerController
.
GetLocalPlayerId
())
9
return
true
;
10
11
if
(!target || !targetPosition)
12
return
false
;
13
14
return
LookAtPosition(target, targetPosition, playerID);
15
}
16
17
//------------------------------------------------------------------------------------------------
18
bool
LookAtPosition(
IEntity
target,
vector
targetPosition,
int
playerID)
19
{
20
SCR_AIGroup
group =
SCR_AIGroup
.Cast(target);
21
if
(!target)
22
return
false
;
23
24
array<AIAgent> agents = {};
25
group.GetAgents(agents);
26
27
SCR_AIUtilityComponent utilityComponent;
28
foreach
(AIAgent agent : agents)
29
{
30
if
(!agent)
31
continue
;
32
33
utilityComponent = SCR_AIUtilityComponent.Cast(agent.FindComponent(SCR_AIUtilityComponent));
34
if
(!utilityComponent)
35
continue
;
36
37
utilityComponent.LookAt(targetPosition);
38
}
39
40
return
true
;
41
}
42
43
//------------------------------------------------------------------------------------------------
44
override
bool
CanBeShown
()
45
{
46
if
(!
CanBeShownInCurrentLifeState
())
47
return
false
;
48
49
SCR_PlayerControllerGroupComponent groupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
50
return
groupController &&
CanRoleShow
();
51
}
52
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
IEntity
Definition
IEntity.c:13
SCR_AIGroup
Definition
SCR_AIGroup.c:75
SCR_BaseGroupCommand
Definition
SCR_BaseGroupCommand.c:4
SCR_BaseGroupCommand::CanRoleShow
override bool CanRoleShow()
Definition
SCR_BaseGroupCommand.c:44
SCR_BaseGroupCommand::CanBeShownInCurrentLifeState
override bool CanBeShownInCurrentLifeState()
Definition
SCR_BaseGroupCommand.c:101
SCR_BaseGroupCommandTitleField
Definition
SCR_PlayerCommandsConfig.c:155
SCR_BaseRadialCommand::CanBeShown
bool CanBeShown()
Definition
SCR_BaseRadialCommand.c:85
SCR_LookAtGroupCommand
Definition
SCR_LookAtGroupCommand.c:4
SCR_PlayerController
Definition
SCR_PlayerController.c:31
SCR_PlayerController::GetLocalPlayerId
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
Definition
SCR_PlayerController.c:481
vector
Definition
vector.c:13
scripts
Game
Commanding
Commands
SCR_LookAtGroupCommand.c
Generated by
1.17.0