20 super.OnActionSelected();
21 m_Utility.m_AIInfo.SetAIState(EUnitAIState.BUSY);
26 m_Utility.m_AIInfo.SetAIState(EUnitAIState.AVAILABLE);
27 super.OnActionCompleted();
32 m_Utility.m_AIInfo.SetAIState(EUnitAIState.AVAILABLE);
33 super.OnActionFailed();
39 ref SCR_BTParam<EAICompartmentType> m_eRoleInVehicle =
new SCR_BTParam<EAICompartmentType>(
SCR_AIActionTask.ROLEINVEHICLE_PORT);
40 ref SCR_BTParam<BaseCompartmentSlot> m_CompartmentToGetIn =
new SCR_BTParam<BaseCompartmentSlot>(
SCR_AIActionTask.COMPARTMENT_PORT);
45 m_CompartmentToGetIn.Init(
this, slot);
50 BaseCompartmentSlot slot;
51 InitParameters(role, slot);
53 m_sBehaviorTree =
"AI/BehaviorTrees/Chimera/Soldier/GetInVehicle.bt";
54 SetPriority(priority);
59 BaseCompartmentManagerComponent compManager = BaseCompartmentManagerComponent.Cast(vehicleEntity.FindComponent(BaseCompartmentManagerComponent));
66 IEntity agentEntity = m_Utility.m_OwnerEntity;
73 array<BaseCompartmentSlot> compartments = {};
74 compManager.GetCompartments(compartments);
76 foreach (BaseCompartmentSlot comp: compartments)
81 IEntity occupant = comp.GetOccupant();
82 if (occupant && occupant != agentEntity)
85 comp.SetReserved(agentEntity);
86 comp.SetCompartmentAccessible(
true);
87 m_CompartmentToGetIn.m_Value = comp;
92 override void OnActionCompleted()
94 if (m_CompartmentToGetIn.m_Value)
96 m_CompartmentToGetIn.m_Value.SetCompartmentAccessible(
true);
97 m_CompartmentToGetIn.m_Value.SetReserved(
null);
99 super.OnActionCompleted();
102 override void OnActionFailed()
104 if (m_CompartmentToGetIn.m_Value)
106 m_CompartmentToGetIn.m_Value.SetCompartmentAccessible(
true);
107 m_CompartmentToGetIn.m_Value.SetReserved(
null);
109 super.OnActionFailed();
112 override string GetActionDebugInfo()
121 void SCR_AIGetOutVehicle(SCR_AIUtilityComponent utility,
SCR_AIActivityBase groupActivity, IEntity vehicleEntity,
float priority = PRIORITY_BEHAVIOR_GET_OUT_VEHICLE,
float priorityLevel = PRIORITY_LEVEL_NORMAL)
123 m_sBehaviorTree =
"AI/BehaviorTrees/Chimera/Soldier/GetOutVehicle.bt";
124 SetPriority(priority);
128 override string GetActionDebugInfo()
130 return this.ToString() +
" leaving " +
m_Vehicle.ValueToString();