Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIGetEntityPosition.c
Go to the documentation of this file.
1 class SCR_AIGetEntityPosition : AITaskScripted
3 {
4  [Attribute("0 0 0", UIWidgets.Auto)]
5  protected vector m_fOffsetLocal;
6 
7  [Attribute("0 0 0", UIWidgets.Auto)]
8  protected vector m_fOffsetWorld;
9 
10  protected static const string ENTITY_PORT = "Entity";
11  protected static const string POSITION_PORT = "Position";
12 
13  override bool VisibleInPalette() { return true; }
14 
15  override string GetOnHoverDescription()
16  {
17  return "Returns position of entity with local and world space offset.";
18  }
19 
20  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
21  {
22  IEntity myEntity = owner.GetControlledEntity();
23 
24  IEntity entity;
25  GetVariableIn(ENTITY_PORT, entity);
26  if (!entity && !myEntity)
27  return ENodeResult.FAIL;
28 
29  if (!entity)
30  entity = myEntity;
31 
32  vector posOut = entity.CoordToParent(m_fOffsetLocal);
33  posOut = posOut + m_fOffsetWorld;
34  SetVariableOut(POSITION_PORT, posOut);
35 
36  return ENodeResult.SUCCESS;
37  }
38 
39  protected static ref TStringArray s_aVarsIn = { ENTITY_PORT };
40  override TStringArray GetVariablesIn() { return s_aVarsIn; }
41 
42  protected static ref TStringArray s_aVarsOut = { POSITION_PORT };
43  override TStringArray GetVariablesOut() { return s_aVarsOut; }
44 }
s_aVarsOut
SCR_AIPickupInventoryItemsBehavior s_aVarsOut
Definition: SCR_AIGetCombatMoveRequestParameters.c:149
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_AIGetEntityPosition
Returns a position of entity with local space offset.
Definition: SCR_AIGetEntityPosition.c:2