Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CreateAIExtraMoveParams_CombatMove.c
Go to the documentation of this file.
1// Special node which creates extra move parameters for SCR_AICombatMoveRequest_Move
3{
4 // Inputs
5 protected static const string PORT_REQUEST = "Request";
6 protected static const string PORT_MOVING_TO_COVER = "InMovingToCover";
7
8 // Outputs
9 protected static const string PORT_PARAMS = "OutParams";
10
12
13 protected static const float STRAIGHT_PATH_COST_MODIFIER = 4.5; // Modifier when we want to find a flanking path
14
15 //----------------------------------------------------------------------------------------
16 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
17 {
21
22 if (!rq)
23 return ENodeResult.FAIL;
24
25 bool movingToCover;
26 GetVariableIn(PORT_MOVING_TO_COVER, movingToCover);
27
28 if (movingToCover || rq.m_vAvoidStraightPathDir == vector.Zero)
29 {
30 // No flanking requested, or we are moving to cover point
31 // There is no need to use extra move parameters
32 AIExtraMoveParams nullParams = null;
33 SetVariableOut(PORT_PARAMS, nullParams); // Otherwise it complains about variable type mismatch
34 return ENodeResult.SUCCESS;
35 }
36
37 // Initialize extra parameters
38 if (!m_Params)
40 m_Params.Reset();
41
42 m_Params.SetStraightPathCostModifier(STRAIGHT_PATH_COST_MODIFIER, rq.m_vAvoidStraightPathDir);
43
45
46 return ENodeResult.SUCCESS;
47 };
48
49 //----------------------------------------------------------------------------------------
50 static override bool VisibleInPalette() { return true; }
51
52 protected static ref TStringArray s_aVarsOut = { PORT_PARAMS };
54
56 override TStringArray GetVariablesIn() { return s_aVarsIn; }
57}
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