Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIGetTargetInfoProperties.c
Go to the documentation of this file.
2{
3 protected static const string TARGET_INFO_PORT = "TargetInfo";
4
5 protected static const string ENTITY_PORT = "Entity";
6 protected static const string LAST_SEEN_POSITION_PORT = "LastSeenPosition";
7 protected static const string TIME_SINCE_SEEN_PORT = "TimeSinceSeen";
8
10 override TStringArray GetVariablesIn() { return s_aVarsIn; }
11
18
19 static override bool VisibleInPalette() { return true; }
20
21 static override string GetOnHoverDescription() { return "Returns properties of provided BaseTarget or TargetInfo"; };
22
23 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
24 {
25 BaseTarget baseTarget;
26 SCR_AITargetInfo targetInfo;
27
28 if(!GetVariableIn(TARGET_INFO_PORT, targetInfo))
29 return ENodeResult.FAIL;
30
31 if (targetInfo)
32 {
33 SetVariableOut(ENTITY_PORT, targetInfo.m_Entity);
34 SetVariableOut(LAST_SEEN_POSITION_PORT, targetInfo.m_vWorldPos);
35 SetVariableOut(TIME_SINCE_SEEN_PORT, targetInfo.m_fTimestamp);
36 return ENodeResult.SUCCESS;
37 }
38 return ENodeResult.FAIL;
39 }
40}
proto void SetVariableOut(string name, void val)
proto bool GetVariableIn(string name, out void val)
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
ENodeResult
Definition ENodeResult.c:13
array< string > TStringArray
Definition Types.c:385