Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIFireIllumFlareBehavior.c
Go to the documentation of this file.
1class 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
This enum contains all IDs for DiagMenu entries added in script.
Definition DebugMenuID.c:4
ref SCR_BTParam< float > m_fPriorityLevel
void OnActionCompleted()
enum EAIActionFailReason PRIORITY_LEVEL_NORMAL
ResourceName m_sBehaviorTree
override void OnActionSelected()
void OnActionFailed()
string GetActionDebugInfo()
int GetCause()
void SCR_AIActivityBase(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint)
enum SCR_EAIActivityCause m_Utility
void SCR_AIBehaviorBase(SCR_AIUtilityComponent utility, SCR_AIActivityBase groupActivity)
SCR_EAIBehaviorCause
bool m_bAllowLook
EAIDebugCategory
Definition SCR_AIWorld.c:12
Definition Color.c:13
Diagnostic and developer menu system.
Definition DiagMenu.c:18
static void VisualizeMessage(IEntity entity, string message, EAIDebugCategory category, float showTime, Color color=Color.White, float fontSize=16, bool ignoreCategory=false)
Instance of created debug visualizer.
Definition Shape.c:14
ShapeFlags
Definition ShapeFlags.c:13
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.