Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AISetCompartmentAccessible.c
Go to the documentation of this file.
1 class SCR_AISetCompartmentAccessible : AITaskScripted
2 {
3  static const string COMPARTMENT_PORT = "CompartmentIn";
4 
5  protected bool m_bAbortDone;
6 
7  //----------------------------------------------------------------------------------------------------------------------------------------------
8  override void OnEnter(AIAgent owner)
9  {
10  m_bAbortDone = false;
11  }
12 
13  //----------------------------------------------------------------------------------------------------------------------------------------------
14  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
15  {
16  return ENodeResult.RUNNING;
17  }
18 
19  //----------------------------------------------------------------------------------------------------------------------------------------------
20  override void OnAbort(AIAgent owner, Node nodeCausingAbort)
21  {
22  if (m_bAbortDone)
23  return;
24 
25  m_bAbortDone = true;
26  BaseCompartmentSlot compartment;
27  if (!GetVariableIn(COMPARTMENT_PORT, compartment))
28  return;
29  compartment.SetCompartmentAccessible(true);
30  }
31 
32  //----------------------------------------------------------------------------------------------------------------------------------------------
33  protected static ref TStringArray s_aVarsIn = {
34  COMPARTMENT_PORT
35  };
36 
37  override TStringArray GetVariablesIn()
38  {
39  return s_aVarsIn;
40  };
41 
42  override bool VisibleInPalette()
43  {
44  return true;
45  };
46 
47  override string GetOnHoverDescription()
48  {
49  return "SetCompartmnetAccessible: makes the compartment accessible by other AIs OnAbort";
50  };
51 
52  override bool CanReturnRunning()
53  {
54  return true;
55  };
56 };
SCR_AISetCompartmentAccessible
Definition: SCR_AISetCompartmentAccessible.c:1