Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AISetAIState.c
Go to the documentation of this file.
1 class SCR_AISetAIState : AITaskScripted
2 {
3  static const string PORT_AI_STATE = "AIState";
4 
5  [Attribute("0", UIWidgets.ComboBox, "State of AI", "", ParamEnumArray.FromEnum(EUnitAIState) )]
6  protected EUnitAIState m_stateToSet;
7 
8  protected override bool VisibleInPalette()
9  {
10  return true;
11  }
12 
13  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
14  {
15  EUnitAIState state;
16  if(!GetVariableIn(PORT_AI_STATE,state))
17  state = m_stateToSet;
18  SCR_ChimeraAIAgent chimeraAgent = SCR_ChimeraAIAgent.Cast(owner);
19  if (!chimeraAgent)
20  return SCR_AgentMustChimera(this, owner);
21 
22  SCR_AIInfoComponent infoComp = chimeraAgent.m_InfoComponent;
23  if (!infoComp)
24  ENodeResult.FAIL;
25 
26  infoComp.SetAIState(state);
27  return ENodeResult.SUCCESS;
28  }
29 
30  override string GetOnHoverDescription()
31  {
32  return "Sets AI state either on self";
33  };
34 
35  protected static ref TStringArray s_aVarsIn = {
36  PORT_AI_STATE
37  };
38  override TStringArray GetVariablesIn()
39  {
40  return s_aVarsIn;
41  }
42 };
SCR_AgentMustChimera
ENodeResult SCR_AgentMustChimera(Node node, AIAgent owner)
Definition: NodeError.c:21
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_ChimeraAIAgent
Definition: SCR_ChimeraAIAgent.c:5
SCR_AISetAIState
Definition: SCR_AISetAIState.c:1