3 static const string PORT_ENEMY =
"Enemy";
4 static const string PORT_ENEMY_POSITION =
"EnemyPosition";
5 static const string PORT_KEEP_SIDE =
"KeepSide";
6 static const string PORT_POSITION =
"PositionOut";
9 [
Attribute(
"4", UIWidgets.EditBox,
"Distance from origin")]
10 private float m_fDistance;
12 private int m_iSide = 0;
13 private IEntity m_OwnerEntity;
16 override void OnEnter(AIAgent owner)
18 if (GetVariableType(
false, PORT_POSITION) != vector)
20 NodeError(
this, owner, PORT_POSITION +
" has to be vector");
25 NodeError(
this, owner,
"Owner must be a character!");
30 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
35 if (!GetVariableIn(PORT_KEEP_SIDE, keepSide) || !keepSide)
36 m_iSide = Math.RandomInt(0,2);
38 if (GetVariableIn(PORT_ENEMY, enemy))
40 direction = vector.Direction(enemy.GetOrigin(), origin);
43 else if (GetVariableIn(PORT_ENEMY_POSITION, enemyPos))
45 direction = vector.Direction(enemyPos, origin);
68 SetVariableOut(PORT_POSITION, origin);
70 return ENodeResult.SUCCESS;
74 override bool VisibleInPalette()
80 override protected string GetOnHoverDescription()
82 return "Returns position from owner entity that is either on random side of the direction towards enemy pos or the keeps the same side as previously if KeepSide is true";
86 protected static ref TStringArray s_aVarsIn = {
91 override TStringArray GetVariablesIn()
97 protected static ref TStringArray s_aVarsOut = {
100 override TStringArray GetVariablesOut()