Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIGetLookParameters.c
Go to the documentation of this file.
2{
3 static const string PORT_LOOK = "bLook";
4 static const string PORT_CANCEL = "bCancel";
5 static const string PORT_RESTART = "bRestart";
6 static const string PORT_POSITION = "vPosition";
7 static const string PORT_DURATION = "vDuration";
8
9 SCR_AILookAction m_LookAction;
10 SCR_AISectorThreatFilter m_ThreatFilter;
11
12 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
13 {
14 if (!m_LookAction)
15 return ENodeResult.FAIL;
16
17 bool look, cancelLook, restartLook;
18 vector lookPos;
19 float lookDuration;
20 m_LookAction.MoveLookParametersToNode(look, lookPos, lookDuration, cancelLook, restartLook);
21
22 SetVariableOut(PORT_LOOK, look);
23
24 if (look)
25 {
26 SetVariableOut(PORT_CANCEL, cancelLook);
27 SetVariableOut(PORT_RESTART, restartLook);
28
29 SetVariableOut(PORT_POSITION, lookPos);
30 SetVariableOut(PORT_DURATION, lookDuration);
31 }
32
33 return ENodeResult.SUCCESS;
34 }
35
36 protected static override bool VisibleInPalette() {return true;}
37 protected static override string GetOnHoverDescription() {return "Gets parameters of a lookAction";}
38
39 override void OnInit(AIAgent owner)
40 {
41 SCR_AIUtilityComponent utility = SCR_AIUtilityComponent.Cast(owner.FindComponent(SCR_AIUtilityComponent));
42
43 if (utility)
44 {
45 m_LookAction = utility.m_LookAction;
46 m_ThreatFilter = utility.m_SectorThreatFilter;
47 }
48 }
49
50 protected static ref TStringArray s_aVarsOut = {
51 PORT_LOOK,
52 PORT_CANCEL,
53 PORT_RESTART,
54 PORT_POSITION,
55 PORT_DURATION
56 };
58 {
59 return s_aVarsOut;
60 }
61};
proto void SetVariableOut(string name, void val)
static ref TStringArray s_aVarsOut
override TStringArray GetVariablesOut()
override void OnInit(AIAgent owner)
static override bool VisibleInPalette()
static override string GetOnHoverDescription()
ENodeResult
Definition ENodeResult.c:13
array< string > TStringArray
Definition Types.c:385