Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SetSmartActionReserved.c
Go to the documentation of this file.
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 //----------------------------------------------------------------------------------------------------------------------------------------------
29 {
30 return s_aVarsIn;
31 };
32
33 //----------------------------------------------------------------------------------------------------------------------------------------------
34 static override bool VisibleInPalette()
35 {
36 return true;
37 };
38
39 //----------------------------------------------------------------------------------------------------------------------------------------------
40 static override string GetOnHoverDescription()
41 {
42 return "SetSmartActionInaccessible: makes the smart action reserved for other AIs, it is released when performActionBehavior completes/ fails.";
43 };
44};
ENodeResult NodeError(Node node, AIAgent owner, string msg)
Error call to be used in scripted BT nodes.
Definition NodeError.c:3
proto bool GetVariableIn(string name, out void val)
static ref TStringArray s_aVarsIn
override TStringArray GetVariablesIn()
static override bool VisibleInPalette()
static override string GetOnHoverDescription()
ENodeResult
Definition ENodeResult.c:13
array< string > TStringArray
Definition Types.c:385