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_AIGetMuzzleMagazineWell.c
Go to the documentation of this file.
1
class
SCR_AIGetMuzzleMagazineWell
:
AITaskScripted
2
{
3
protected
const
static
string
WEAPON_COMPONENT_PORT
=
"WeaponComponent"
;
4
protected
const
static
string
MUZZLE_ID_PORT
=
"MuzzleId"
;
5
6
static
const
string
MAGAZINE_WELL_PORT
=
"MagazineWell"
;
7
static
const
string
MAGAZINE_WELL_TYPE_PORT
=
"MagazineWellType"
;
8
9
//------------------------------------------------------------------------------------------------
10
static
override
bool
VisibleInPalette
() {
return
true
;}
11
12
//------------------------------------------------------------------------------------------------
13
override
ENodeResult
EOnTaskSimulate
(AIAgent owner,
float
dt)
14
{
15
BaseWeaponComponent
weaponComp;
16
int
muzzleId;
17
18
if
(!
GetVariableIn
(
WEAPON_COMPONENT_PORT
, weaponComp))
19
return
ENodeResult
.FAIL;
20
if
(!
GetVariableIn
(
MUZZLE_ID_PORT
, muzzleId))
21
return
ENodeResult
.FAIL;
22
23
if
(!weaponComp)
24
return
ENodeResult
.FAIL;
25
26
array<BaseMuzzleComponent> muzzles = {};
27
weaponComp.GetMuzzlesList(muzzles);
28
29
if
(muzzleId < 0 || muzzleId >= muzzles.Count())
30
return
ENodeResult
.FAIL;
31
32
BaseMuzzleComponent
muzzleComp = muzzles[muzzleId];
33
34
if
(!muzzleComp)
35
return
ENodeResult
.FAIL;
36
37
BaseMagazineWell
magWell = muzzleComp.GetMagazineWell();
38
if
(!magWell)
39
return
ENodeResult
.FAIL;
40
41
typename
magWellType = magWell.Type();
42
SetVariableOut
(
MAGAZINE_WELL_PORT
, magWell);
43
SetVariableOut
(
MAGAZINE_WELL_TYPE_PORT
, magWellType);
44
return
ENodeResult
.SUCCESS;
45
}
46
47
//------------------------------------------------------------------------------------------------
48
protected
static
ref
TStringArray
s_aVarsOut
= {
MAGAZINE_WELL_PORT
,
MAGAZINE_WELL_TYPE_PORT
};
49
override
TStringArray
GetVariablesOut
() {
return
s_aVarsOut
; }
50
51
protected
static
ref
TStringArray
s_aVarsIn
= {
WEAPON_COMPONENT_PORT
,
MUZZLE_ID_PORT
};
52
override
TStringArray
GetVariablesIn
() {
return
s_aVarsIn
; }
53
54
55
//------------------------------------------------------------------------------------------------
56
static
override
string
GetOnHoverDescription
()
57
{
58
return
"Returns magazine well and its type of a specific weapon muzzle"
;
59
};
60
};
AITaskScripted
Definition
AITaskScripted.c:13
BaseMagazineWell
Definition
BaseMagazineWell.c:13
BaseMuzzleComponent
Definition
BaseMuzzleComponent.c:13
BaseWeaponComponent
Definition
BaseWeaponComponent.c:13
Node::SetVariableOut
proto void SetVariableOut(string name, void val)
Node::GetVariableIn
proto bool GetVariableIn(string name, out void val)
SCR_AIGetMuzzleMagazineWell
Definition
SCR_AIGetMuzzleMagazineWell.c:2
SCR_AIGetMuzzleMagazineWell::WEAPON_COMPONENT_PORT
static const string WEAPON_COMPONENT_PORT
Definition
SCR_AIGetMuzzleMagazineWell.c:3
SCR_AIGetMuzzleMagazineWell::MAGAZINE_WELL_PORT
static const string MAGAZINE_WELL_PORT
Definition
SCR_AIGetMuzzleMagazineWell.c:6
SCR_AIGetMuzzleMagazineWell::s_aVarsOut
static ref TStringArray s_aVarsOut
Definition
SCR_AIGetMuzzleMagazineWell.c:48
SCR_AIGetMuzzleMagazineWell::MUZZLE_ID_PORT
static const string MUZZLE_ID_PORT
Definition
SCR_AIGetMuzzleMagazineWell.c:4
SCR_AIGetMuzzleMagazineWell::s_aVarsIn
static ref TStringArray s_aVarsIn
Definition
SCR_AIGetMuzzleMagazineWell.c:51
SCR_AIGetMuzzleMagazineWell::GetVariablesIn
override TStringArray GetVariablesIn()
Definition
SCR_AIGetMuzzleMagazineWell.c:52
SCR_AIGetMuzzleMagazineWell::GetVariablesOut
override TStringArray GetVariablesOut()
Definition
SCR_AIGetMuzzleMagazineWell.c:49
SCR_AIGetMuzzleMagazineWell::MAGAZINE_WELL_TYPE_PORT
static const string MAGAZINE_WELL_TYPE_PORT
Definition
SCR_AIGetMuzzleMagazineWell.c:7
SCR_AIGetMuzzleMagazineWell::GetOnHoverDescription
static override string GetOnHoverDescription()
Definition
SCR_AIGetMuzzleMagazineWell.c:56
SCR_AIGetMuzzleMagazineWell::EOnTaskSimulate
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
Definition
SCR_AIGetMuzzleMagazineWell.c:13
SCR_AIGetMuzzleMagazineWell::VisibleInPalette
static override bool VisibleInPalette()
Definition
SCR_AIGetMuzzleMagazineWell.c:10
ENodeResult
ENodeResult
Definition
ENodeResult.c:13
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
ScriptedNodes
Weapons
SCR_AIGetMuzzleMagazineWell.c
Generated by
1.17.0