Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIPickupInventoryItemsBehavior.c
Go to the documentation of this file.
2 {
3  protected static const string PICKUP_POSITION_PORT = "PickupPosition";
4  static const string MAGAZINE_WELL_TYPE_PORT = "MagazineWellType";
5 
6  ref SCR_BTParam<vector> m_vPickupPosition = new SCR_BTParam<vector>(PICKUP_POSITION_PORT);
7  ref SCR_BTParam<typename> m_MagazineWellType = new SCR_BTParam<typename>(MAGAZINE_WELL_TYPE_PORT);
8 
9  ref SCR_AIMoveIndividuallyBehavior m_MoveBehavior;
10 
11  //-------------------------------------------------------------------------------------------------------------
12  void InitProperties(vector pickupPosition, typename magazineWellType)
13  {
14  m_vPickupPosition.Init(this, pickupPosition);
15  m_MagazineWellType.Init(this, magazineWellType);
16  }
17 
18  //-------------------------------------------------------------------------------------------------------------
19  void SCR_AIPickupInventoryItemsBehavior(SCR_AIUtilityComponent utility, SCR_AIActivityBase groupActivity,
20  vector pickupPosition, typename magazineWellType, float priorityLevel = PRIORITY_LEVEL_NORMAL)
21  {
22  SetPriority(SCR_AIActionBase.PRIORITY_BEHAVIOR_PICKUP_INVENTORY_ITEMS);
23  m_fPriorityLevel.m_Value = priorityLevel;
24  m_sBehaviorTree = "{8522FD17F6E08C47}AI/BehaviorTrees/Chimera/Soldier/PickupInventoryItems.bt";
25 
26  SetIsUniqueInActionQueue(true);
27  InitProperties(pickupPosition, magazineWellType);
28 
29  if (!utility)
30  return;
31 
32  float movePriority = GetPriority() + 0.1;
33  m_MoveBehavior = new SCR_AIMoveIndividuallyBehavior(utility, groupActivity, pickupPosition, priority: movePriority, priorityLevel: priorityLevel, radius: 0.3);
34  utility.AddAction(m_MoveBehavior);
35  }
36 
37  //------------------------------------------------------------------------------------------------------------------------------------
38  override void OnActionCompleted()
39  {
40  super.OnActionCompleted();
41  if (m_MoveBehavior)
42  m_MoveBehavior.Complete();
43  }
44 
45  //------------------------------------------------------------------------------------------------------------------------------------
46  override void OnActionFailed()
47  {
48  super.OnActionFailed();
49  if (m_MoveBehavior)
50  m_MoveBehavior.Fail();
51  }
52 }
53 
54 class SCR_AIGetPickupInventoryItemsParameters: SCR_AIGetActionParameters
55 {
56  static ref TStringArray s_aVarsOut = (new SCR_AIPickupInventoryItemsBehavior(null, null, vector.Zero, BaseMagazineWell)).GetPortNames();
57  override TStringArray GetVariablesOut() { return s_aVarsOut; }
58  override bool VisibleInPalette() { return true; }
59 };
GetVariablesOut
override TStringArray GetVariablesOut()
Definition: SCR_AIPickupInventoryItemsBehavior.c:57
m_MagazineWellType
m_MagazineWellType
Definition: SCR_AIMessage.c:478
SCR_AIActionBase
Definition: SCR_AIAction.c:1
m_vPickupPosition
SCR_AIMessage_ProvideAmmo m_vPickupPosition
s_aVarsOut
SCR_AIPickupInventoryItemsBehavior s_aVarsOut
Definition: SCR_AIGetCombatMoveRequestParameters.c:149
m_fPriorityLevel
float m_fPriorityLevel
Definition: SendGoalMessage.c:3
SCR_AIPickupInventoryItemsBehavior
Definition: SCR_AIPickupInventoryItemsBehavior.c:1
SCR_AIActivityBase
Definition: SCR_AIActivity.c:1
GetPriority
int GetPriority()
Definition: SCR_BaseManualCameraComponent.c:107
VisibleInPalette
override bool VisibleInPalette()
Definition: SCR_AIPickupInventoryItemsBehavior.c:58
BaseMagazineWell
Definition: BaseMagazineWell.c:12
SCR_AIMoveIndividuallyBehavior
Definition: SCR_AIMoveBehavior.c:30
SCR_AIGetActionParameters
Definition: SCR_AIGetActionParameters.c:22
SCR_AIBehaviorBase
Definition: SCR_AIBehavior.c:1