Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIIsTargetVisible.c
Go to the documentation of this file.
1// Script File//------------------------------------------------------------------------------------------------
3{
4 static const string BASE_TARGET_PORT = "BaseTargetIn";
5
6 SCR_AICombatComponent m_CombatComp;
7
8 //-----------------------------------------------------------------------------------------------------
9 protected override bool TestFunction(AIAgent owner)
10 {
11 if (!m_CombatComp)
12 {
13 IEntity controlledEntity = owner.GetControlledEntity();
14 if (controlledEntity)
15 m_CombatComp = SCR_AICombatComponent.Cast(owner.FindComponent(SCR_AICombatComponent));
16
17 if (!m_CombatComp)
18 return false;
19 }
20
21 BaseTarget target;
22 GetVariableIn(BASE_TARGET_PORT,target);
23
24 if (!target)
25 return false;
26
27 bool visible = m_CombatComp.IsTargetVisible(target);
28
29 return visible;
30 }
31
32 //-----------------------------------------------------------------------------------------------------
33 protected static override bool VisibleInPalette()
34 {
35 return true;
36 }
37
38 //-----------------------------------------------------------------------------------------------------
39 protected static override string GetOnHoverDescription()
40 {
41 return "IsTargetVisible: Checks if target is visible. The check is performed through Combat Component.";
42 }
43
44 //-----------------------------------------------------------------------------------------------------
45 protected static ref TStringArray s_aVarsIn = {
46 BASE_TARGET_PORT
47 };
48 protected override TStringArray GetVariablesIn()
49 {
50 return s_aVarsIn;
51 }
52};
proto bool GetVariableIn(string name, out void val)
static override bool VisibleInPalette()
override bool TestFunction(AIAgent owner)
static ref TStringArray s_aVarsIn
override TStringArray GetVariablesIn()
static override string GetOnHoverDescription()
array< string > TStringArray
Definition Types.c:385