Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AILimitStance.c
Go to the documentation of this file.
1 class SCR_AILimitStance : AITaskScripted
2 {
3  protected static const string STANCE_OUT_PORT = "StanceOut";
4  protected static const string STANCE_IN_PORT = "StanceIn";
5 
6  protected SCR_AIUtilityComponent m_Utility;
7 
8  [Attribute(ECharacterStance.STAND.ToString(), UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(ECharacterStance), desc: "Upper or lower limit")]
9  protected ECharacterStance m_eStanceLimit0;
10 
11  [Attribute(ECharacterStance.STAND.ToString(), UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(ECharacterStance), desc: "Upper or lower limit")]
12  protected ECharacterStance m_eStanceLimit1;
13 
14  //------------------------------------------------------------------------------------
15  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
16  {
17  int stanceIn;
18  GetVariableIn(STANCE_IN_PORT, stanceIn);
19 
20  int stanceOut;
21  if (m_eStanceLimit0 < m_eStanceLimit1)
22  stanceOut = Math.ClampInt(stanceIn, m_eStanceLimit0, m_eStanceLimit1);
23  else
24  stanceOut = Math.ClampInt(stanceIn, m_eStanceLimit1, m_eStanceLimit0);
25  SetVariableOut(STANCE_OUT_PORT, stanceOut);
26 
27  return ENodeResult.SUCCESS;
28  }
29 
30  //------------------------------------------------------------------------------------
31  override bool VisibleInPalette() { return true; }
32 
33  //------------------------------------------------------------------------------------
34  protected static ref TStringArray s_aVarsOut = { STANCE_OUT_PORT };
35  override TStringArray GetVariablesOut() { return s_aVarsOut; }
36 
37  protected static ref TStringArray s_aVarsIn = { STANCE_IN_PORT };
38  override TStringArray GetVariablesIn() { return s_aVarsIn; }
39 
40  //------------------------------------------------------------------------------------
41  override string GetNodeMiddleText()
42  {
43  string s0 = string.Format("Stance Limit 0: %1\n", typename.EnumToString(ECharacterStance, m_eStanceLimit0));
44  string s1 = string.Format("Stance Limit 1: %1\n", typename.EnumToString(ECharacterStance, m_eStanceLimit1));
45  return s0 + s1;
46  }
47 
48  //------------------------------------------------------------------------------------
49  override string GetOnHoverDescription() { return "Limits stance value within a range"; };
50 }
ECharacterStance
ECharacterStance
Definition: ECharacterStance.c:12
s_aVarsOut
SCR_AIPickupInventoryItemsBehavior s_aVarsOut
Definition: SCR_AIGetCombatMoveRequestParameters.c:149
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_AILimitStance
Definition: SCR_AILimitStance.c:1