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_GetIntoSelectedVehicleGroupCommand.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
[
BaseContainerProps
(),
SCR_BaseGroupCommandTitleField
(
"m_sCommandName"
)]
3
class
SCR_GetINtoSelectedVehicleGroupCommand
:
SCR_WaypointGroupCommand
4
{
5
//------------------------------------------------------------------------------------------------
6
override
bool
Execute(
IEntity
cursorTarget,
IEntity
target,
vector
targetPosition,
int
playerID,
bool
isClient)
7
{
8
if
(isClient)
9
{
10
//place to place a logic that would be executed for other players
11
return
true
;
12
}
13
14
if
(
GetWaypointPrefab
().
IsEmpty
())
15
return
false
;
16
17
SCR_AIGroup
slaveGroup =
SCR_AIGroup
.Cast(target);
18
if
(!slaveGroup)
19
return
false
;
20
21
PlayerCamera camera =
GetGame
().GetPlayerController().GetPlayerCamera();
22
if
(!camera)
23
return
false
;
24
25
Vehicle
vehicle =
Vehicle
.Cast(cursorTarget);
26
if
(!vehicle)
27
return
false
;
28
29
Resource
waypointPrefab =
Resource
.Load(
GetWaypointPrefab
());
30
if
(!waypointPrefab.IsValid())
31
{
32
//add custom error
33
return
false
;
34
}
35
36
CheckPreviousWaypoints
(slaveGroup);
37
38
EntitySpawnParams
params
=
EntitySpawnParams
();
39
params
.TransformMode = ETransformMode.WORLD;
40
params
.Transform[3] = vehicle.GetOrigin();
41
42
AIWaypoint wp = AIWaypoint.Cast(
GetGame
().SpawnEntityPrefabLocal(waypointPrefab, null,
params
));
43
if
(wp)
44
slaveGroup.AddWaypoint(wp);
45
46
return
true
;
47
}
48
49
//------------------------------------------------------------------------------------------------
50
override
bool
CanBeShown
()
51
{
52
if
(!
CanBeShownInCurrentLifeState
())
53
return
false
;
54
55
PlayerCamera camera =
GetGame
().GetPlayerController().GetPlayerCamera();
56
if
(!camera)
57
return
false
;
58
59
SCR_PlayerControllerGroupComponent groupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
60
if
(!groupController)
61
return
false
;
62
63
if
(!
CanRoleShow
())
64
return
false
;
65
66
IEntity
cursorTarget = camera.GetCursorTarget();
67
Vehicle
vehicle =
Vehicle
.Cast(cursorTarget);
68
return
(vehicle != null);
69
}
70
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
IEntity
Definition
IEntity.c:13
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
SCR_AIGroup
Definition
SCR_AIGroup.c:75
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_GetINtoSelectedVehicleGroupCommand
Definition
SCR_GetIntoSelectedVehicleGroupCommand.c:4
SCR_WaypointGroupCommand
Definition
SCR_WaypointGroupCommand.c:4
SCR_WaypointGroupCommand::CanBeShown
override bool CanBeShown()
Definition
SCR_WaypointGroupCommand.c:183
SCR_WaypointGroupCommand::GetWaypointPrefab
ResourceName GetWaypointPrefab()
Definition
SCR_WaypointGroupCommand.c:121
SCR_WaypointGroupCommand::CheckPreviousWaypoints
void CheckPreviousWaypoints(SCR_AIGroup slaveGroup)
Definition
SCR_WaypointGroupCommand.c:160
vector
Definition
vector.c:13
Vehicle
enum EPhysicsLayerPresets Vehicle
Definition
gameLib.c:24
EntitySpawnParams
void EntitySpawnParams()
Definition
gameLib.c:130
IsEmpty
proto native bool IsEmpty()
scripts
Game
Commanding
Commands
SCR_GetIntoSelectedVehicleGroupCommand.c
Generated by
1.17.0