3 static const string PORT_DURATION =
"DurationIn";
4 static const string PORT_SHOOT_START =
"ShootStartIn";
5 static const string PORT_SHOOT_END =
"ShootEndIn";
6 static const string PORT_AIM_POSITION =
"AimPositionOut";
7 static const string PORT_AIM_TIME =
"AimTimeOut";
8 static const string PORT_RESET_TIME =
"ResetTime";
9 static const string PORT_RESET_TIME_OUT =
"ResetTimeOut";
11 [
Attribute(
"50", UIWidgets.EditBox,
desc:
"Number of LERP steps" )]
14 private float m_fIterativeStep,m_fCurrentTime,m_fDuration;
16 private vector m_vStart,m_vEnd,m_vDirection;
18 protected static ref TStringArray s_aVarsIn = {
24 override array<string> GetVariablesIn()
29 protected static ref TStringArray s_aVarsOut = {
34 override array<string> GetVariablesOut()
39 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
43 GetVariableIn(PORT_RESET_TIME, reset);
47 SetVariableOut(PORT_RESET_TIME_OUT,
false);
51 return ENodeResult.FAIL;
52 m_fIterativeStep = 1 / m_fSteps;
54 if (!GetVariableIn(PORT_SHOOT_START,m_vStart) || !GetVariableIn(PORT_SHOOT_END,m_vEnd))
55 return ENodeResult.FAIL;
58 m_vDirection = (m_vEnd - m_vStart);
60 m_vDirection *= Math.Clamp(m_fCurrentTime,0,1);
63 SetVariableOut(PORT_AIM_POSITION,m_vStart + m_vDirection);
64 m_fCurrentTime += m_fIterativeStep;
66 return ENodeResult.SUCCESS;
69 protected override string GetOnHoverDescription()
71 return "Calculate position to shoot at during suppressive fire";
74 override bool VisibleInPalette()