Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AISettingsComponent.c
Go to the documentation of this file.
1[ComponentEditorProps(category: "GameScripted/AI", description: "Component for utility AI system calculations")]
5
6// Obsolete and should be removed eventually
7class SCR_AISettingsComponent : ScriptComponent
8{
9 // rewrite if condition below if adding new lines!!!
10 [Attribute(defvalue: "1", uiwidget: UIWidgets.CheckBox, desc: "Enable debug visualization")]
11 protected bool m_EnableVisualization;
12
13 [Attribute(defvalue: "1", uiwidget: UIWidgets.CheckBox, desc: "Allow movement")]
15
16 [Attribute(defvalue: "1", uiwidget: UIWidgets.CheckBox, desc: "Allow reacting on danger events")]
18
19 [Attribute(defvalue: "1", uiwidget: UIWidgets.CheckBox, desc: "Allow reacting on perceived targets")]
21
22 [Attribute(defvalue: "1", uiwidget: UIWidgets.CheckBox, desc: "Allow shooting and attacking in general")]
24
25 [Attribute(defvalue: "1", uiwidget: UIWidgets.CheckBox, desc: "Allow finding and taking cover")]
27
28 [Attribute(defvalue: "1", uiwidget: UIWidgets.CheckBox, desc: "Allow aiming and gestures in general")]
30
31 [Attribute(defvalue: "1", uiwidget: UIWidgets.CheckBox, desc: "Allow sending messages")]
33
34 [Attribute(defvalue: "1", uiwidget: UIWidgets.CheckBox, desc: "Allow artificial aiming error for AI")]
36
37 [Attribute(defvalue: "0", uiwidget: UIWidgets.CheckBox, desc: "Allow leader to stop when formation is deformed")]
39
40 [Attribute(defvalue: "", uiwidget: UIWidgets.EditBox, desc: "Title for world description")]
41 protected string m_sDescriptionTitle;
42
43 [Attribute(defvalue: "", uiwidget: UIWidgets.EditBox, desc: "World description")]
44 protected string m_sDescriptionText;
45
46 private Widget m_wHint;
47 private Widget m_wOverlay;
48
50 protected static SCR_AISettingsComponent m_sInstance;
51
52 //------------------------------------------------------------------------------------------------
54 static SCR_AISettingsComponent GetInstance()
55 {
56 return m_sInstance;
57 }
58
59 //------------------------------------------------------------------------------------------------
62 {
63 if (!m_EnableVisualization)
64 return;
65
66 GetGame().GetCallqueue().CallLater(UpdateDebug,10,true);
67
68 // Create debug layout
69 WorkspaceWidget workspace = GetGame().GetWorkspace();
70 m_wOverlay = workspace.CreateWidgets("{7C4EE3995E17845B}UI/layouts/Debug/AIInfoDebug.layout");
71 if (m_wOverlay.GetNumHandlers() > 0)
72 m_UIComponent = SCR_AIDebugInfoComponent.Cast(m_wOverlay.GetHandler(0));
73
74 if (m_sDescriptionText != string.Empty || m_sDescriptionTitle != string.Empty)
75 SCR_HintManagerComponent.ShowCustomHint(m_sDescriptionText, m_sDescriptionTitle, 12);
76 }
77
78 //------------------------------------------------------------------------------------------------
80 protected void UpdateDebug()
81 {
82 if (!m_EnableVisualization)
83 return;
84
85 m_UIComponent.UpdateUI();
86 }
87
88 //------------------------------------------------------------------------------------------------
89 override void OnPostInit(IEntity owner)
90 {
91 super.OnPostInit(owner);
92 m_sInstance = this;
93#ifdef AI_DEBUG
94 if (m_EnableVisualization)
96#endif
97 }
98
99 //------------------------------------------------------------------------------------------------
100 // destructor
102 {
103 if (m_wOverlay)
104 m_wOverlay.RemoveFromHierarchy();
105
106 if (m_wHint)
107 m_wHint.RemoveFromHierarchy();
108 }
109}
ArmaReforgerScripted GetGame()
Definition game.c:1398
bool m_EnableTakeCover
bool m_EnableLooking
bool m_EnableLeaderStop
bool m_EnableAttack
bool m_EnableDangerEvents
bool m_EnablePerception
bool m_EnableMovement
bool m_EnableCommunication
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
void ~SCR_AISettingsComponent()
SCR_AIDebugInfoComponent m_UIComponent
string m_sDescriptionTitle
void InitVisualization()
bool m_EnableAimError
string m_sDescriptionText
void UpdateDebug()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_FieldOfViewSettings Attribute