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_AIFireIllumFlareBehavior.c
Go to the documentation of this file.
1
class
SCR_AIFireIllumFlareBehavior :
SCR_AIBehaviorBase
2
{
3
ref SCR_BTParam<vector> m_vTargetPosition =
new
SCR_BTParam<vector>(
SCR_AIActionTask
.TARGETPOSITION_PORT);
4
ref SCR_BTParam<BaseWeaponComponent> m_WeaponComponent =
new
SCR_BTParam<BaseWeaponComponent>(
SCR_AIActionTask
.WEAPON_COMP_PORT);
5
ref SCR_BTParam<BaseMagazineComponent> m_MagazineComponent =
new
SCR_BTParam<BaseMagazineComponent>(
SCR_AIActionTask
.MAGAZINE_COMP_PORT);
6
ref SCR_BTParam<int> m_iMuzzleId =
new
SCR_BTParam<int>(
SCR_AIActionTask
.MUZZLE_ID);
7
8
#ifdef WORKBENCH
9
//Diagnostic visualization
10
ref array<ref Shape> m_aDbgShapes = {};
11
#endif
12
13
void
SCR_AIFireIllumFlareBehavior(SCR_AIUtilityComponent utility,
SCR_AIActivityBase
groupActivity,
vector
targetPosition,
BaseWeaponComponent
weaponComponent,
BaseMagazineComponent
magazineComponent,
int
muzzleId,
float
priority = PRIORITY_BEHAVIOR_FIRE_ILLUM_FLARE,
float
priorityLevel =
PRIORITY_LEVEL_NORMAL
)
14
{
15
m_vTargetPosition.Init(
this
, targetPosition);
16
m_WeaponComponent.Init(
this
, weaponComponent);
17
m_MagazineComponent.Init(
this
, magazineComponent);
18
m_iMuzzleId.Init(
this
, muzzleId);
19
20
m_sBehaviorTree
=
"{6543CC29914F2933}AI/BehaviorTrees/Chimera/Soldier/FireIllumFlareAt.bt"
;
21
SetPriority(priority);
22
m_fPriorityLevel
.m_Value = priorityLevel;
23
m_bAllowLook
=
false
;
24
25
#ifdef WORKBENCH
26
if
(
DiagMenu
.GetBool(
SCR_DebugMenuID
.DEBUGUI_AI_SHOW_ILLUM_FLARES_POSITIONS))
27
DrawPositionDebug();
28
#endif
29
}
30
31
//---------------------------------------------------------------------------------------------------------------------------------
32
override
int
GetCause
()
33
{
34
return
SCR_EAIBehaviorCause
.COMBAT;
35
}
36
37
//----------------------------------------------------------------------------------
38
override
void
OnActionSelected
()
39
{
40
m_Utility
.m_AIInfo.SetAIState(EUnitAIState.BUSY);
41
42
#ifdef WORKBENCH
43
m_aDbgShapes.Clear();
44
if
(
DiagMenu
.GetBool(
SCR_DebugMenuID
.DEBUGUI_AI_SHOW_ILLUM_FLARES_POSITIONS))
45
DrawPositionDebug();
46
#endif
47
}
48
49
//----------------------------------------------------------------------------------
50
override
void
OnActionCompleted
()
51
{
52
super.OnActionCompleted();
53
m_Utility
.m_AIInfo.SetAIState(EUnitAIState.AVAILABLE);
54
#ifdef WORKBENCH
55
SCR_AIDebugVisualization
.
VisualizeMessage
(
m_Utility
.m_OwnerEntity,
"Illum flare fired"
,
EAIDebugCategory
.INFO, 5);
56
m_aDbgShapes.Clear();
57
#endif
58
}
59
60
//----------------------------------------------------------------------------------
61
override
void
OnActionFailed
()
62
{
63
super.OnActionFailed();
64
m_Utility
.m_AIInfo.SetAIState(EUnitAIState.AVAILABLE);
65
#ifdef WORKBENCH
66
SCR_AIDebugVisualization
.
VisualizeMessage
(
m_Utility
.m_OwnerEntity,
"Firing illum flare failed"
,
EAIDebugCategory
.INFO, 5);
67
m_aDbgShapes.Clear();
68
#endif
69
}
70
71
//----------------------------------------------------------------------------------
72
override
string
GetActionDebugInfo
()
73
{
74
return
this.
ToString
() +
" firing illum flare at "
+ m_vTargetPosition.m_Value.ToString();
75
}
76
77
//------------------------------------------------------------------------------------------------------------------------------------
78
void
DrawPositionDebug()
79
{
80
#ifdef WORKBENCH
81
m_aDbgShapes.Insert(
Shape
.CreateSphere(
Color
.WHITE,
ShapeFlags
.DEFAULT, m_vTargetPosition.m_Value, 0.7));
82
#endif
83
}
84
};
SCR_DebugMenuID
SCR_DebugMenuID
This enum contains all IDs for DiagMenu entries added in script.
Definition
DebugMenuID.c:4
m_fPriorityLevel
ref SCR_BTParam< float > m_fPriorityLevel
Definition
SCR_AIAction.c:87
OnActionCompleted
void OnActionCompleted()
Definition
SCR_AIAction.c:202
PRIORITY_LEVEL_NORMAL
enum EAIActionFailReason PRIORITY_LEVEL_NORMAL
m_sBehaviorTree
ResourceName m_sBehaviorTree
Definition
SCR_AIAction.c:89
OnActionSelected
override void OnActionSelected()
Definition
SCR_AIAction.c:193
OnActionFailed
void OnActionFailed()
Definition
SCR_AIAction.c:205
GetActionDebugInfo
string GetActionDebugInfo()
Definition
SCR_AIAction.c:185
GetCause
int GetCause()
Definition
SCR_AIAction.c:129
SCR_AIActivityBase
void SCR_AIActivityBase(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint)
Definition
SCR_AIActivity.c:44
m_Utility
enum SCR_EAIActivityCause m_Utility
SCR_AIBehaviorBase
void SCR_AIBehaviorBase(SCR_AIUtilityComponent utility, SCR_AIActivityBase groupActivity)
Definition
SCR_AIBehavior.c:23
SCR_EAIBehaviorCause
SCR_EAIBehaviorCause
Definition
SCR_AIBehavior.c:2
m_bAllowLook
bool m_bAllowLook
Definition
SCR_AIBehavior.c:18
EAIDebugCategory
EAIDebugCategory
Definition
SCR_AIWorld.c:12
BaseMagazineComponent
Definition
BaseMagazineComponent.c:13
BaseWeaponComponent
Definition
BaseWeaponComponent.c:13
Color
Definition
Color.c:13
DiagMenu
Diagnostic and developer menu system.
Definition
DiagMenu.c:18
SCR_AIActionTask
Definition
SCR_AIBehaviorTask.c:2
SCR_AIDebugVisualization
Definition
SCR_AIDebugVisualization.c:10
SCR_AIDebugVisualization::VisualizeMessage
static void VisualizeMessage(IEntity entity, string message, EAIDebugCategory category, float showTime, Color color=Color.White, float fontSize=16, bool ignoreCategory=false)
Definition
SCR_AIDebugVisualization.c:34
Shape
Instance of created debug visualizer.
Definition
Shape.c:14
vector
Definition
vector.c:13
ShapeFlags
ShapeFlags
Definition
ShapeFlags.c:13
ToString
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.
scripts
Game
AI
Behavior
SCR_AIFireIllumFlareBehavior.c
Generated by
1.17.0