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_AIAllowLookAction.c
Go to the documentation of this file.
1
class
SCR_AIAllowLookAction
:
AITaskScripted
2
{
3
private
SCR_AIBehaviorBase
m_CurrentBehavior;
4
private
bool
m_bLookAllowed;
5
6
7
//------------------------------------------------------------------------------------------------
8
override
void
OnEnter(AIAgent owner)
9
{
10
SCR_AIUtilityComponent utility = SCR_AIUtilityComponent.Cast(owner.FindComponent(SCR_AIUtilityComponent));
11
m_CurrentBehavior = utility.GetCurrentBehavior();
12
}
13
14
//------------------------------------------------------------------------------------------------
15
override
ENodeResult
EOnTaskSimulate(AIAgent owner,
float
dt)
16
{
17
if
(!m_CurrentBehavior)
18
return
ENodeResult
.FAIL;
19
20
if
(!m_CurrentBehavior.m_bAllowLook)
21
{
22
m_CurrentBehavior.m_bAllowLook =
true
;
23
m_bLookAllowed =
true
;
24
}
25
26
if
(m_bLookAllowed)
27
return
ENodeResult
.RUNNING;
28
else
29
return
ENodeResult
.SUCCESS;
30
}
31
32
//------------------------------------------------------------------------------------------------
33
override
void
OnAbort(AIAgent owner,
Node
nodeCausingAbort)
34
{
35
if
(m_bLookAllowed)
36
{
37
m_bLookAllowed =
false
;
38
if
(m_CurrentBehavior)
39
m_CurrentBehavior.m_bAllowLook =
false
;
40
}
41
}
42
43
//------------------------------------------------------------------------------------------------
44
protected
static
override
bool
VisibleInPalette
() {
return
true
;}
45
46
//------------------------------------------------------------------------------------------------
47
static
override
bool
CanReturnRunning
() {
return
true
;}
48
49
//------------------------------------------------------------------------------------------------
50
protected
static
override
string
GetOnHoverDescription
() {
return
"Node that allows free look of AI unit and disallows it on abort."
;}
51
};
SCR_AIBehaviorBase
void SCR_AIBehaviorBase(SCR_AIUtilityComponent utility, SCR_AIActivityBase groupActivity)
Definition
SCR_AIBehavior.c:23
AITaskScripted
Definition
AITaskScripted.c:13
Node
Definition
Node.c:13
SCR_AIAllowLookAction
Definition
SCR_AIAllowLookAction.c:2
SCR_AIAllowLookAction::CanReturnRunning
static override bool CanReturnRunning()
Definition
SCR_AIAllowLookAction.c:47
SCR_AIAllowLookAction::GetOnHoverDescription
static override string GetOnHoverDescription()
Definition
SCR_AIAllowLookAction.c:50
SCR_AIAllowLookAction::VisibleInPalette
static override bool VisibleInPalette()
Definition
SCR_AIAllowLookAction.c:44
ENodeResult
ENodeResult
Definition
ENodeResult.c:13
scripts
Game
AI
ScriptedNodes
Behavior
SCR_AIAllowLookAction.c
Generated by
1.17.0