Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_AIDecoTargetWithinTurretAimingLimits.c
Go to the documentation of this file.
1
class
SCR_AIDecoTargetWithinTurretAimingLimits
:
DecoratorScripted
2
{
3
// Inputs
4
protected
static
const
string
PORT_TURRET_ENTITY
=
"TurretEntity"
;
5
protected
static
const
string
PORT_TARGET_POS
=
"TargetPos"
;
6
7
//---------------------------------------------------------------------
8
override
bool
TestFunction
(AIAgent owner)
9
{
10
// Read inputs
11
IEntity
turretEntity;
12
vector
targetPos;
13
GetVariableIn
(
PORT_TURRET_ENTITY
, turretEntity);
14
GetVariableIn
(
PORT_TARGET_POS
, targetPos);
15
16
if
(!turretEntity || !targetPos)
17
return
false
;
18
19
TurretComponent
turretComp =
TurretComponent
.Cast(turretEntity.
FindComponent
(
TurretComponent
));
20
if
(!turretComp)
21
return
false
;
22
23
vector
aimingExcessDeg = turretComp.GetAimingAngleExcess(targetPos);
24
bool
withinAimingLimits = aimingExcessDeg[0] == 0 && aimingExcessDeg[1] == 0;
25
26
return
withinAimingLimits;
27
}
28
29
//---------------------------------------------------------------------
30
protected
static
ref
TStringArray
s_aVarsIn
= {
PORT_TURRET_ENTITY
,
PORT_TARGET_POS
};
31
override
TStringArray
GetVariablesIn
() {
return
s_aVarsIn
; };
32
33
override
static
string
GetOnHoverDescription
() {
return
"Returns true if given position is within aiming limits of the TurretComponent attached to provided entity."
; }
34
}
DecoratorScripted
Definition
DecoratorScripted.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
Node::GetVariableIn
proto bool GetVariableIn(string name, out void val)
SCR_AIDecoTargetWithinTurretAimingLimits
Definition
SCR_AIDecoTargetWithinTurretAimingLimits.c:2
SCR_AIDecoTargetWithinTurretAimingLimits::GetVariablesIn
override TStringArray GetVariablesIn()
Definition
SCR_AIDecoTargetWithinTurretAimingLimits.c:31
SCR_AIDecoTargetWithinTurretAimingLimits::TestFunction
override bool TestFunction(AIAgent owner)
Definition
SCR_AIDecoTargetWithinTurretAimingLimits.c:8
SCR_AIDecoTargetWithinTurretAimingLimits::GetOnHoverDescription
static override string GetOnHoverDescription()
Definition
SCR_AIDecoTargetWithinTurretAimingLimits.c:33
SCR_AIDecoTargetWithinTurretAimingLimits::PORT_TARGET_POS
static const string PORT_TARGET_POS
Definition
SCR_AIDecoTargetWithinTurretAimingLimits.c:5
SCR_AIDecoTargetWithinTurretAimingLimits::PORT_TURRET_ENTITY
static const string PORT_TURRET_ENTITY
Definition
SCR_AIDecoTargetWithinTurretAimingLimits.c:4
SCR_AIDecoTargetWithinTurretAimingLimits::s_aVarsIn
static ref TStringArray s_aVarsIn
Definition
SCR_AIDecoTargetWithinTurretAimingLimits.c:30
TurretComponent
Definition
TurretComponent.c:13
vector
Definition
vector.c:13
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
ScriptedNodes
Weapons
SCR_AIDecoTargetWithinTurretAimingLimits.c
Generated by
1.17.0