Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIGetMuzzleMagazineWell.c
Go to the documentation of this file.
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();
44 return ENodeResult.SUCCESS;
45 }
46
47 //------------------------------------------------------------------------------------------------
50
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};
proto void SetVariableOut(string name, void val)
proto bool GetVariableIn(string name, out void val)
static override string GetOnHoverDescription()
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
ENodeResult
Definition ENodeResult.c:13
array< string > TStringArray
Definition Types.c:385