Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIEvaluateSuppressionWeapon.c
Go to the documentation of this file.
1
5{
6 // Input ports
7 protected static const string PORT_DISTANCE = "Distance";
8
9 // Output ports
10 protected static const string PORT_WEAPON_COMPONENT = "WeaponComponent";
11 protected static const string PORT_MAGAZINE_COMPONENT = "MagazineComponent";
12 protected static const string PORT_MUZZLE_ID = "MuzzleId";
13
14 protected SCR_AICombatComponent m_CombatComponent;
15
16 //--------------------------------------------------------------------------------------------
17 override void OnInit(AIAgent owner)
18 {
19 IEntity controlledEnt = owner.GetControlledEntity();
20 m_CombatComponent = SCR_AICombatComponent.Cast(controlledEnt.FindComponent(SCR_AICombatComponent));
21
23 {
24 NodeError(this, owner, "SCR_AIEvaluateExpectedWeapon didn't find necessary components!");
25 }
26 }
27
28 //--------------------------------------------------------------------------------------------
29 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
30 {
32 return ENodeResult.FAIL;
33
34 float distanceToTgt = 100.0;
35 GetVariableIn(PORT_DISTANCE, distanceToTgt);
36
37 BaseWeaponComponent weaponComp;
38 BaseMagazineComponent magazineComp;
39 int muzzleId;
40
41 m_CombatComponent.EvaluateSuppressionWeapon(EAIUnitType.UnitType_Infantry, distanceToTgt, weaponComp, muzzleId, magazineComp);
42
43 if (!weaponComp)
44 return ENodeResult.FAIL;
45
49
50 return ENodeResult.SUCCESS;
51 }
52
53 //--------------------------------------------------------------------------------------------
54 static override bool VisibleInPalette() { return true; }
55
62
63 protected static ref TStringArray s_aVarsIn = {
65 };
66 override TStringArray GetVariablesIn() { return s_aVarsIn; }
67}
ENodeResult NodeError(Node node, AIAgent owner, string msg)
Error call to be used in scripted BT nodes.
Definition NodeError.c:3
proto external Managed FindComponent(typename typeName)
proto void SetVariableOut(string name, void val)
proto bool GetVariableIn(string name, out void val)
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
ENodeResult
Definition ENodeResult.c:13
EAIUnitType
Definition EAIUnitType.c:13
array< string > TStringArray
Definition Types.c:385