Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AICreateBasicCoverQueryProps.c
Go to the documentation of this file.
1 class SCR_AICreateBasicCoverQueryProps : AITaskScripted
2 {
3  // Outputs
4  protected const static string PORT_COVER_QUERY_PROPERTIES = "CoverQueryProps";
5 
6  // Inputs
7  protected const static string PORT_POSITION = "Position";
8  protected const static string PORT_RADIUS = "Radius";
9 
10  protected ref CoverQueryProperties m_CoverQueryProps = new CoverQueryProperties();
11 
12  [Attribute("0", UIWidgets.EditBox)]
13  protected float m_fRadius;
14 
15  [Attribute("0", UIWidgets.CheckBox)]
16  protected bool m_bSelectHighestScoreCover;
17 
18  //---------------------------------------------------------------
19  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
20  {
21  IEntity ownerEntity = owner.GetControlledEntity();
22  if (!ownerEntity)
23  return ENodeResult.FAIL;
24 
25  float radius = 0;
26  if (!GetVariableIn(PORT_RADIUS, radius))
27  radius = m_fRadius;
28 
29  vector queryPos = vector.Zero;
30  if (!GetVariableIn(PORT_POSITION, queryPos))
31  queryPos = ownerEntity.GetOrigin();
32 
33  m_CoverQueryProps.m_vSectorPos = queryPos;
34  m_CoverQueryProps.m_vAgentPos = queryPos;
35  m_CoverQueryProps.m_vSectorDir = vector.Zero;
36  m_CoverQueryProps.m_vThreatPos = queryPos; // Threat pos is not provided here, it's a basic query in radius
37  m_CoverQueryProps.m_fQuerySectorAngleCosMin = -1.0;
38  m_CoverQueryProps.m_fSectorDistMin = 0;
39  m_CoverQueryProps.m_fSectorDistMax = radius;
40  //m_CoverQueryProps.m_fCoverHeightMin;
41  //m_CoverQueryProps.m_fCoverHeightMax = 10.0;
42  m_CoverQueryProps.m_fCoverToThreatAngleCosMin = -1.0;
43  m_CoverQueryProps.m_fScoreWeightDirection = 0;
44  m_CoverQueryProps.m_fScoreWeightDistance = 1.0;
45  m_CoverQueryProps.m_bCheckVisibility = false;
46  m_CoverQueryProps.m_bSelectHighestScore = m_bSelectHighestScoreCover;
47  m_CoverQueryProps.m_iMaxCoversToCheck = SCR_CoverQueryComponent.MAX_COVERS_LOW_PRIORITY;
48 
49  if (m_bSelectHighestScoreCover)
50  m_CoverQueryProps.m_fScoreWeightNavmeshRay = 0.2;
51  else
52  m_CoverQueryProps.m_fScoreWeightNavmeshRay = 5;
53 
54  SetVariableOut(PORT_COVER_QUERY_PROPERTIES, m_CoverQueryProps);
55 
56  return ENodeResult.SUCCESS;
57  }
58 
59 
60 
61  //---------------------------------------------------------------
62  override bool VisibleInPalette() { return true; }
63 
64  protected static ref TStringArray s_aVarsIn = {
65  PORT_POSITION,
66  PORT_RADIUS
67  };
68  override TStringArray GetVariablesIn() { return s_aVarsIn; }
69 
70  protected static ref TStringArray s_aVarsOut = {
71  PORT_COVER_QUERY_PROPERTIES
72  };
73  override TStringArray GetVariablesOut() { return s_aVarsOut; }
74 
75  override string GetOnHoverDescription() { return "Creates CoverQueryProperties for basic circular query without threat visibility checking"; }
76 }
SCR_AICreateBasicCoverQueryProps
Definition: SCR_AICreateBasicCoverQueryProps.c:1
s_aVarsOut
SCR_AIPickupInventoryItemsBehavior s_aVarsOut
Definition: SCR_AIGetCombatMoveRequestParameters.c:149
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_fRadius
float m_fRadius
Definition: SCR_AITargetClusterState.c:30
SCR_CoverQueryComponent
void SCR_CoverQueryComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_CoverQueryComponent.c:17