Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIGetOutActivity.c
Go to the documentation of this file.
1class SCR_AIGetOutActivity : SCR_AIActivityBase
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
6 //-----------------------------------------------------------------------------------------------------------------------------------
7 void InitParameters(IEntity vehicle, SCR_AIBoardingParameters boardingParameters, float priorityLevel)
8 {
9 m_Vehicle.Init(this, vehicle);
10 m_fPriorityLevel.Init(this, priorityLevel);
11 m_BoardingParameters.Init(this, boardingParameters);
12 }
13
14 //-----------------------------------------------------------------------------------------------------------------------------------
15 void SCR_AIGetOutActivity(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint, IEntity vehicle, SCR_AIBoardingParameters boardingParameters = null, float priority = PRIORITY_ACTIVITY_GET_OUT, float priorityLevel = PRIORITY_LEVEL_NORMAL)
16 {
17 InitParameters(vehicle, boardingParameters, priorityLevel);
18
19 m_sBehaviorTree = "AI/BehaviorTrees/Chimera/Group/ActivityGetOut.bt";
20 SetPriority(priority);
21 }
22
23 //-----------------------------------------------------------------------------------------------------------------------------------
24 override void OnActionCompleted()
25 {
27 m_Utility.m_Owner.CompleteWaypoint(m_RelatedWaypoint);
28 if (m_Vehicle.m_Value)
29 {
30 SCR_AIVehicleUsageComponent vehicleUsageComp = SCR_AIVehicleUsageComponent.FindOnNearestParent(m_Vehicle.m_Value, m_Vehicle.m_Value);
31 if (vehicleUsageComp)
32 m_Utility.m_VehicleMgr.RemoveVehicle(vehicleUsageComp);
33 }
34 else
35 {
36 array<ref SCR_AIGroupVehicle> groupVehicles = {};
37 m_Utility.m_VehicleMgr.GetAllVehicles(groupVehicles);
38 foreach (SCR_AIGroupVehicle vehicle : groupVehicles)
39 m_Utility.m_VehicleMgr.RemoveVehicle(vehicle.GetVehicleUsageComponent());
40 }
41 super.OnActionCompleted();
42 }
43
44 //-----------------------------------------------------------------------------------------------------------------------------------
45 override string GetActionDebugInfo()
46 {
47 string vehicleRef;
48 if (!m_Vehicle.m_Value)
49 vehicleRef = "all vehicles";
50 else
51 vehicleRef = m_Vehicle.m_Value.ToString();
52 return this.ToString() + " leaving " + vehicleRef;
53 }
54};
55
ref SCR_BTParam< float > m_fPriorityLevel
void OnActionCompleted()
enum EAIActionFailReason PRIORITY_LEVEL_NORMAL
ResourceName m_sBehaviorTree
string GetActionDebugInfo()
void SCR_AIActivityBase(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint)
enum SCR_EAIActivityCause m_Utility
AIWaypoint m_RelatedWaypoint
This class is used for keeping track of vehicles assigned to group.
static SCR_AIVehicleUsageComponent FindOnNearestParent(notnull IEntity ent, out IEntity componentOwner)
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.