Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SetSmartActionReserved.c
Go to the documentation of this file.
1 class SCR_AISetSmartActionReserved : AITaskScripted
2 {
3  static const string SMART_ACTION_PORT = "SmartActionIn";
4  static const string OWNER_PORT = "OwnerAgentIn";
5 
6  //----------------------------------------------------------------------------------------------------------------------------------------------
7  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
8  {
9  SCR_AISmartActionComponent smartActionComponent;
10  AIAgent ownerAgent;
11 
12  if (!GetVariableIn(SMART_ACTION_PORT, smartActionComponent))
13  return NodeError(this, owner, "No smartaction to reserve!");
14  if (!GetVariableIn(OWNER_PORT, ownerAgent))
15  ownerAgent = owner;
16 
17  smartActionComponent.ReserveAction(ownerAgent);
18  return ENodeResult.SUCCESS;
19  }
20 
21  //----------------------------------------------------------------------------------------------------------------------------------------------
22  protected static ref TStringArray s_aVarsIn = {
23  OWNER_PORT,
24  SMART_ACTION_PORT
25  };
26 
27  //----------------------------------------------------------------------------------------------------------------------------------------------
28  override TStringArray GetVariablesIn()
29  {
30  return s_aVarsIn;
31  };
32 
33  //----------------------------------------------------------------------------------------------------------------------------------------------
34  override bool VisibleInPalette()
35  {
36  return true;
37  };
38 
39  //----------------------------------------------------------------------------------------------------------------------------------------------
40  override string GetOnHoverDescription()
41  {
42  return "SetSmartActionInaccessible: makes the smart action reserved for other AIs, it is released when performActionBehavior completes/ fails.";
43  };
44 };
SCR_AISmartActionComponent
Definition: SCR_AISmartActionComponent.c:9
NodeError
ENodeResult NodeError(Node node, AIAgent owner, string msg)
Error call to be used in scripted BT nodes.
Definition: NodeError.c:3
SCR_AISetSmartActionReserved
Definition: SetSmartActionReserved.c:1