Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIGetInActivity.c
Go to the documentation of this file.
2{
3 ref SCR_BTParam<IEntity> m_Vehicle = new SCR_BTParam<IEntity>(SCR_AIActionTask.ENTITY_PORT);
4 ref SCR_BTParam<SCR_AIBoardingParameters> m_BoardingParameters = new SCR_BTParam<SCR_AIBoardingParameters>(SCR_AIActionTask.BOARDING_PARAMS_PORT);
5 ref SCR_BTParam<ECompartmentType> m_eRoleInVehicle = new SCR_BTParam<ECompartmentType>(SCR_AIActionTask.ROLEINVEHICLE_PORT);
7
8 void InitParameters(IEntity vehicle, SCR_AIBoardingParameters parameters, ECompartmentType role, float priorityLevel)
9 {
10 m_Vehicle.Init(this, vehicle);
11 m_BoardingParameters.Init(this, parameters);
12 m_eRoleInVehicle.Init(this, role);
13 m_fPriorityLevel.Init(this, priorityLevel);
14 }
15
16 //------------------------------------------------------------------------------------------------
17 void SCR_AIGetInActivity(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint, IEntity vehicle, SCR_AIBoardingParameters boardingParameters = null, ECompartmentType role = ECompartmentType.CARGO, float priority = PRIORITY_ACTIVITY_GET_IN, float priorityLevel = PRIORITY_LEVEL_NORMAL)
18 {
19 InitParameters(vehicle, boardingParameters, role, priorityLevel);
20 m_sBehaviorTree = "AI/BehaviorTrees/Chimera/Group/ActivityGetIn.bt";
21 SetPriority(priority);
22 if (utility)
23 m_OwnerGroup = utility.m_Owner;
24 }
25
26 //------------------------------------------------------------------------------------------------
27 override string GetActionDebugInfo()
28 {
29 return this.ToString() + " moving to " + m_Vehicle.m_Value.ToString() + " as " + m_eRoleInVehicle.m_Value.ToString();
30 }
31
32 //------------------------------------------------------------------------------------------------
33 override void OnActionDeselected()
34 {
35 m_OwnerGroup.ReleaseCompartments();
36 super.OnActionDeselected();
37 }
38
39 //------------------------------------------------------------------------------------------------
40 override void OnActionSelected()
41 {
42 if (m_Vehicle.m_Value)
43 {
44 SCR_AIVehicleUsageComponent vehicleUsageComp = SCR_AIVehicleUsageComponent.FindOnNearestParent(m_Vehicle.m_Value, m_Vehicle.m_Value);
45 if (vehicleUsageComp)
46 m_Utility.AddUsableVehicle(vehicleUsageComp);
47 }
48
49 super.OnActionDeselected();
50 }
51
52 //------------------------------------------------------------------------------------------------
53 override void OnActionCompleted()
54 {
55 super.OnActionCompleted();
57 m_OwnerGroup.CompleteWaypoint(m_RelatedWaypoint);
58 }
59
60 //------------------------------------------------------------------------------------------------
61 override void OnActionFailed()
62 {
63 super.OnActionFailed();
65
66 if (m_Vehicle.m_Value)
67 {
68 SCR_AIVehicleUsageComponent vehicleUsageComp = SCR_AIVehicleUsageComponent.FindOnNearestParent(m_Vehicle.m_Value, m_Vehicle.m_Value);
69 if (vehicleUsageComp)
70 m_Utility.RemoveUsableVehicle(vehicleUsageComp);
71 }
72
74 m_OwnerGroup.CompleteWaypoint(m_RelatedWaypoint);
75 }
76
77 //------------------------------------------------------------------------------------------------
79 {
80 m_Vehicle.m_Value = null;
81 }
82};
ECompartmentType
ref SCR_BTParam< float > m_fPriorityLevel
enum EAIActionFailReason PRIORITY_LEVEL_NORMAL
ResourceName m_sBehaviorTree
void SendCancelMessagesToAllAgents()
void SCR_AIActivityBase(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint)
enum SCR_EAIActivityCause m_Utility
AIWaypoint m_RelatedWaypoint
override void OnActionCompleted()
override string GetActionDebugInfo()
void InitParameters(IEntity vehicle, SCR_AIBoardingParameters parameters, ECompartmentType role, float priorityLevel)
override void OnActionSelected()
override void OnActionDeselected()
override void OnActionFailed()
void SCR_AIGetInActivity(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint, IEntity vehicle, SCR_AIBoardingParameters boardingParameters=null, ECompartmentType role=ECompartmentType.CARGO, float priority=PRIORITY_ACTIVITY_GET_IN, float priorityLevel=PRIORITY_LEVEL_NORMAL)
static SCR_AIVehicleUsageComponent FindOnNearestParent(notnull IEntity ent, out IEntity componentOwner)
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.