Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AICreateBasicCoverQueryProps.c
Go to the documentation of this file.
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
11
12 [Attribute("0", UIWidgets.EditBox)]
13 protected float m_fRadius;
14
15 [Attribute("0", UIWidgets.CheckBox)]
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
35 m_CoverQueryProps.m_vSectorPos = queryPos;
36 m_CoverQueryProps.m_vSectorDir = vector.Zero;
37 m_CoverQueryProps.m_vThreatPos = queryPos; // Threat pos is not provided here, it's a basic query in radius
38 m_CoverQueryProps.m_fQuerySectorAngleCosMin = -1.0;
39 m_CoverQueryProps.m_fSectorDistMin = 0;
40 m_CoverQueryProps.m_fSectorDistMax = radius;
41 //m_CoverQueryProps.m_fCoverHeightMin;
42 //m_CoverQueryProps.m_fCoverHeightMax = 10.0;
43 m_CoverQueryProps.m_fCoverToThreatAngleCosMin = -1.0;
44 m_CoverQueryProps.m_fScoreWeightDirection = 0;
45 m_CoverQueryProps.m_fScoreWeightDistance = 1.0;
46 m_CoverQueryProps.m_bCheckVisibility = false;
47 m_CoverQueryProps.m_bSelectHighestScore = m_bSelectHighestScoreCover;
49
51
52 return ENodeResult.SUCCESS;
53 }
54
55
56
57 //---------------------------------------------------------------
58 static override bool VisibleInPalette() { return true; }
59
60 protected static ref TStringArray s_aVarsIn = {
63 };
64 override TStringArray GetVariablesIn() { return s_aVarsIn; }
65
66 protected static ref TStringArray s_aVarsOut = {
68 };
70
71 static override string GetOnHoverDescription() { return "Creates CoverQueryProperties for basic circular query without threat visibility checking"; }
72}
proto external vector GetOrigin()
proto void SetVariableOut(string name, void val)
proto bool GetVariableIn(string name, out void val)
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
const float NAVMESH_AREA_COST_SCALE
const int MAX_COVERS_LOW_PRIORITY
const vector NEAREST_POLY_HALF_EXTEND
ENodeResult
Definition ENodeResult.c:13
SCR_FieldOfViewSettings Attribute
array< string > TStringArray
Definition Types.c:385