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_AIGetUsableVehicle.c
Go to the documentation of this file.
1
class
SCR_AIGetUsableVehicle
:
AITaskScripted
2
{
3
static
const
string
PORT_COMPARTMENT_TYPE =
"CompartmentTypeIn"
;
4
static
const
string
PORT_VEHICLE =
"VehicleOut"
;
5
static
const
string
PORT_COMPARTMENT =
"CompartmentOut"
;
6
7
[
Attribute
(
"0"
,
UIWidgets
.ComboBox,
"Find vehicle for:"
,
""
, ParamEnumArray.FromEnum(
ECompartmentType
) )]
8
protected
ECompartmentType
m_eCompartmentType
;
9
10
[
Attribute
(
"0"
,
UIWidgets
.CheckBox,
"Reserve compartment?"
)]
11
protected
bool
m_bReserveCompartment
;
12
13
protected
ref array<BaseCompartmentSlot>
m_aOutCompartments
= {};
14
15
//----------------------------------------------------------------------------------------------------------------------------------------
16
override
ENodeResult
EOnTaskSimulate
(AIAgent owner,
float
dt)
17
{
18
BaseCompartmentSlot
compartmentOut;
19
ECompartmentType
compType;
20
SCR_AIGroup
group =
SCR_AIGroup
.Cast(owner);
21
if
(!group)
22
group =
SCR_AIGroup
.Cast(owner.GetParentGroup());
23
if
(!group)
24
return
ENodeResult
.FAIL;
25
26
if
(!
GetVariableIn
(PORT_COMPARTMENT_TYPE,compType))
27
compType =
m_eCompartmentType
;
28
29
array<IEntity> vehicles = {};
30
group.
GetGroupUtilityComponent
().
m_VehicleMgr
.
GetAllVehicleEntities
(vehicles);
31
if
(!vehicles || vehicles.IsEmpty())
32
return
ENodeResult
.FAIL;
33
34
IEntity
vehicle;
35
if
(
SCR_AICompartmentHandling
.FindAvailableCompartmentInVehicles(vehicles, compType, compartmentOut, vehicle))
36
{
37
if
(
m_bReserveCompartment
)
38
group.
AllocateCompartment
(compartmentOut);
39
SetVariableOut
(PORT_COMPARTMENT, compartmentOut);
40
SetVariableOut
(PORT_VEHICLE, vehicle);
41
return
ENodeResult
.SUCCESS;
42
}
43
ClearVariable
(PORT_VEHICLE);
44
return
ENodeResult
.FAIL;
45
}
46
47
//----------------------------------------------------------------------------------------------------------------------------------------
48
protected
static
ref
TStringArray
s_aVarsIn
= {
49
PORT_COMPARTMENT_TYPE
50
};
51
52
//----------------------------------------------------------------------------------------------------------------------------------------
53
override
TStringArray
GetVariablesIn
()
54
{
55
return
s_aVarsIn
;
56
}
57
58
//----------------------------------------------------------------------------------------------------------------------------------------
59
protected
static
ref
TStringArray
s_aVarsOut
= {
60
PORT_VEHICLE,PORT_COMPARTMENT
61
};
62
63
//----------------------------------------------------------------------------------------------------------------------------------------
64
override
TStringArray
GetVariablesOut
()
65
{
66
return
s_aVarsOut
;
67
}
68
69
//----------------------------------------------------------------------------------------------------------------------------------------
70
static
override
bool
VisibleInPalette
()
71
{
72
return
true
;
73
}
74
75
//----------------------------------------------------------------------------------------------------------------------------------------
76
static
override
string
GetOnHoverDescription
()
77
{
78
return
"GetUsableVehicle: takes vehicles from the list of known vehicles of group and checks if the slot of m_compartmentType is available.\n It does not relaese reservation the found compartment!"
;
79
}
80
};
ECompartmentType
ECompartmentType
Definition
ECompartmentType.c:8
AITaskScripted
Definition
AITaskScripted.c:13
BaseCompartmentSlot
Definition
BaseCompartmentSlot.c:2
IEntity
Definition
IEntity.c:13
Node::SetVariableOut
proto void SetVariableOut(string name, void val)
Node::GetVariableIn
proto bool GetVariableIn(string name, out void val)
Node::ClearVariable
proto void ClearVariable(string name)
SCR_AICompartmentHandling
Definition
SCR_AIUtils.c:153
SCR_AIGetUsableVehicle
Definition
SCR_AIGetUsableVehicle.c:2
SCR_AIGetUsableVehicle::EOnTaskSimulate
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
Definition
SCR_AIGetUsableVehicle.c:16
SCR_AIGetUsableVehicle::s_aVarsIn
static ref TStringArray s_aVarsIn
Definition
SCR_AIGetUsableVehicle.c:48
SCR_AIGetUsableVehicle::m_aOutCompartments
ref array< BaseCompartmentSlot > m_aOutCompartments
Definition
SCR_AIGetUsableVehicle.c:13
SCR_AIGetUsableVehicle::GetOnHoverDescription
static override string GetOnHoverDescription()
Definition
SCR_AIGetUsableVehicle.c:76
SCR_AIGetUsableVehicle::m_bReserveCompartment
bool m_bReserveCompartment
Definition
SCR_AIGetUsableVehicle.c:11
SCR_AIGetUsableVehicle::VisibleInPalette
static override bool VisibleInPalette()
Definition
SCR_AIGetUsableVehicle.c:70
SCR_AIGetUsableVehicle::s_aVarsOut
static ref TStringArray s_aVarsOut
Definition
SCR_AIGetUsableVehicle.c:59
SCR_AIGetUsableVehicle::m_eCompartmentType
ECompartmentType m_eCompartmentType
Definition
SCR_AIGetUsableVehicle.c:8
SCR_AIGetUsableVehicle::GetVariablesOut
override TStringArray GetVariablesOut()
Definition
SCR_AIGetUsableVehicle.c:64
SCR_AIGetUsableVehicle::GetVariablesIn
override TStringArray GetVariablesIn()
Definition
SCR_AIGetUsableVehicle.c:53
SCR_AIGroup
Definition
SCR_AIGroup.c:75
SCR_AIGroup::AllocateCompartment
void AllocateCompartment(BaseCompartmentSlot compartment)
Definition
SCR_AIGroup.c:1995
SCR_AIGroup::GetGroupUtilityComponent
SCR_AIGroupUtilityComponent GetGroupUtilityComponent()
Definition
SCR_AIGroup.c:208
SCR_AIGroupUtilityComponent::m_VehicleMgr
ref SCR_AIGroupVehicleManager m_VehicleMgr
Definition
SCR_AIGroupUtilityComponent.c:63
SCR_AIGroupVehicleManager::GetAllVehicleEntities
void GetAllVehicleEntities(array< IEntity > outAllVehicles)
Definition
SCR_AIGroupVehicleManager.c:47
UIWidgets
Definition
attributes.c:40
ENodeResult
ENodeResult
Definition
ENodeResult.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
ScriptedNodes
Vehicles
SCR_AIGetUsableVehicle.c
Generated by
1.17.0