Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIProcessCombatMoveRequest.c
Go to the documentation of this file.
1 /*
2 Logic common to all combat move request types.
3 */
4 
5 class SCR_AIProcessCombatMoveRequest : AITaskScripted
6 {
7  // Inputs
8  protected static const string PORT_REQUEST = "Request";
9 
10  // Outputs
11  protected static const string PORT_TYPE = "Type";
12 
13  protected SCR_AICombatMoveState m_State;
14 
15  //--------------------------------------------------------------------------------------------
16  override void OnInit(AIAgent owner)
17  {
18  SCR_AIUtilityComponent utilityComp = SCR_AIUtilityComponent.Cast(owner.FindComponent(SCR_AIUtilityComponent));
19  if (utilityComp)
20  m_State = utilityComp.m_CombatMoveState;
21  }
22 
23  //---------------------------------------------------------------------------
24  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
25  {
26  if (!m_State)
27  return ENodeResult.FAIL;
28 
30  if (!GetVariableIn(PORT_REQUEST, rq))
31  return ENodeResult.FAIL;
32 
33  SetVariableOut(PORT_TYPE, rq.m_eType);
34 
35  // Common logic for all request
36  m_State.m_bAimAtTarget = rq.m_bAimAtTarget;
37  rq.m_eState = SCR_EAICombatMoveRequestState.EXECUTING;
38  rq.m_eFailReason = SCR_EAICombatMoveRequestFailReason.NONE;
39 
40  return ENodeResult.SUCCESS;
41  }
42 
43 
44  //---------------------------------------------------------------------------
45  protected static ref TStringArray s_aVarsOut = {
46  PORT_TYPE
47  };
48  override TStringArray GetVariablesOut()
49  {
50  return s_aVarsOut;
51  }
52 
53  protected static ref TStringArray s_aVarsIn = {
55  };
56  override TStringArray GetVariablesIn()
57  {
58  return s_aVarsIn;
59  }
60 
61  override bool VisibleInPalette() { return true; }
62 }
SCR_AIProcessCombatMoveRequest
Definition: SCR_AIProcessCombatMoveRequest.c:5
SCR_AICombatMoveRequestBase
Definition: SCR_AICombatMoveRequest.c:37
s_aVarsOut
SCR_AIPickupInventoryItemsBehavior s_aVarsOut
Definition: SCR_AIGetCombatMoveRequestParameters.c:149
PORT_REQUEST
SCR_AISetCombatMoveRequestState PORT_REQUEST
m_State
private EEditableEntityState m_State
Definition: SCR_BaseEntitiesEditorUIEffect.c:3
SCR_EAICombatMoveRequestState
SCR_EAICombatMoveRequestState
Definition: SCR_AICombatMoveState.c:1