4 protected const static string PORT_COVER_QUERY_PROPERTIES =
"CoverQueryProps";
7 protected const static string PORT_POSITION =
"Position";
8 protected const static string PORT_RADIUS =
"Radius";
10 protected ref CoverQueryProperties m_CoverQueryProps =
new CoverQueryProperties();
13 protected float m_fRadius;
16 protected bool m_bSelectHighestScoreCover;
19 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
21 IEntity ownerEntity = owner.GetControlledEntity();
23 return ENodeResult.FAIL;
26 if (!GetVariableIn(PORT_RADIUS, radius))
29 vector queryPos = vector.Zero;
30 if (!GetVariableIn(PORT_POSITION, queryPos))
31 queryPos = ownerEntity.GetOrigin();
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;
37 m_CoverQueryProps.m_fQuerySectorAngleCosMin = -1.0;
38 m_CoverQueryProps.m_fSectorDistMin = 0;
39 m_CoverQueryProps.m_fSectorDistMax = radius;
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;
49 if (m_bSelectHighestScoreCover)
50 m_CoverQueryProps.m_fScoreWeightNavmeshRay = 0.2;
52 m_CoverQueryProps.m_fScoreWeightNavmeshRay = 5;
54 SetVariableOut(PORT_COVER_QUERY_PROPERTIES, m_CoverQueryProps);
56 return ENodeResult.SUCCESS;
62 override bool VisibleInPalette() {
return true; }
64 protected static ref TStringArray s_aVarsIn = {
68 override TStringArray GetVariablesIn() {
return s_aVarsIn; }
70 protected static ref TStringArray s_aVarsOut = {
71 PORT_COVER_QUERY_PROPERTIES
73 override TStringArray GetVariablesOut() {
return s_aVarsOut; }
75 override string GetOnHoverDescription() {
return "Creates CoverQueryProperties for basic circular query without threat visibility checking"; }