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_AIEvaluateExpectedWeapon.c
Go to the documentation of this file.
1
4
class
SCR_AIEvaluateExpectedWeapon
:
AITaskScripted
5
{
6
// Output ports
7
protected
static
const
string
PORT_WEAPON_COMPONENT
=
"WeaponComponent"
;
8
protected
static
const
string
PORT_MAGAZINE_COMPONENT
=
"MagazineComponent"
;
9
protected
static
const
string
PORT_MUZZLE_ID
=
"MuzzleId"
;
10
11
protected
SCR_AICombatComponent
m_CombatComponent
;
12
13
//--------------------------------------------------------------------------------------------
14
override
void
OnInit
(AIAgent owner)
15
{
16
IEntity
controlledEnt = owner.GetControlledEntity();
17
m_CombatComponent
= SCR_AICombatComponent.Cast(controlledEnt.
FindComponent
(SCR_AICombatComponent));
18
19
if
(!
m_CombatComponent
)
20
{
21
NodeError
(
this
, owner,
"SCR_AIEvaluateExpectedWeapon didn't find necessary components!"
);
22
}
23
}
24
25
//--------------------------------------------------------------------------------------------
26
override
ENodeResult
EOnTaskSimulate
(AIAgent owner,
float
dt)
27
{
28
if
(!
m_CombatComponent
)
29
return
ENodeResult
.FAIL;
30
31
BaseWeaponComponent
weaponComp;
32
BaseMagazineComponent
magazineComp;
33
int
muzzleId;
34
35
m_CombatComponent
.EvaluateExpectedWeapon(weaponComp, muzzleId, magazineComp);
36
37
if
(!weaponComp)
38
return
ENodeResult
.FAIL;
39
40
SetVariableOut
(
PORT_WEAPON_COMPONENT
, weaponComp);
41
SetVariableOut
(
PORT_MAGAZINE_COMPONENT
, magazineComp);
42
SetVariableOut
(
PORT_MUZZLE_ID
, muzzleId);
43
44
return
ENodeResult
.SUCCESS;
45
}
46
47
//--------------------------------------------------------------------------------------------
48
static
override
bool
VisibleInPalette
() {
return
true
; }
49
50
protected
static
ref
TStringArray
s_aVarsOut
= {
51
PORT_WEAPON_COMPONENT
,
52
PORT_MUZZLE_ID
,
53
PORT_MAGAZINE_COMPONENT
54
};
55
override
TStringArray
GetVariablesOut
() {
return
s_aVarsOut
; }
56
}
NodeError
ENodeResult NodeError(Node node, AIAgent owner, string msg)
Error call to be used in scripted BT nodes.
Definition
NodeError.c:3
AITaskScripted
Definition
AITaskScripted.c:13
BaseMagazineComponent
Definition
BaseMagazineComponent.c:13
BaseWeaponComponent
Definition
BaseWeaponComponent.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
Node::SetVariableOut
proto void SetVariableOut(string name, void val)
SCR_AIEvaluateExpectedWeapon
Definition
SCR_AIEvaluateExpectedWeapon.c:5
SCR_AIEvaluateExpectedWeapon::OnInit
override void OnInit(AIAgent owner)
Definition
SCR_AIEvaluateExpectedWeapon.c:14
SCR_AIEvaluateExpectedWeapon::s_aVarsOut
static ref TStringArray s_aVarsOut
Definition
SCR_AIEvaluateExpectedWeapon.c:50
SCR_AIEvaluateExpectedWeapon::m_CombatComponent
SCR_AICombatComponent m_CombatComponent
Definition
SCR_AIEvaluateExpectedWeapon.c:11
SCR_AIEvaluateExpectedWeapon::EOnTaskSimulate
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
Definition
SCR_AIEvaluateExpectedWeapon.c:26
SCR_AIEvaluateExpectedWeapon::PORT_MAGAZINE_COMPONENT
static const string PORT_MAGAZINE_COMPONENT
Definition
SCR_AIEvaluateExpectedWeapon.c:8
SCR_AIEvaluateExpectedWeapon::VisibleInPalette
static override bool VisibleInPalette()
Definition
SCR_AIEvaluateExpectedWeapon.c:48
SCR_AIEvaluateExpectedWeapon::PORT_MUZZLE_ID
static const string PORT_MUZZLE_ID
Definition
SCR_AIEvaluateExpectedWeapon.c:9
SCR_AIEvaluateExpectedWeapon::PORT_WEAPON_COMPONENT
static const string PORT_WEAPON_COMPONENT
Definition
SCR_AIEvaluateExpectedWeapon.c:7
SCR_AIEvaluateExpectedWeapon::GetVariablesOut
override TStringArray GetVariablesOut()
Definition
SCR_AIEvaluateExpectedWeapon.c:55
ENodeResult
ENodeResult
Definition
ENodeResult.c:13
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
ScriptedNodes
Weapons
SCR_AIEvaluateExpectedWeapon.c
Generated by
1.17.0