DayZ 1.24
Loading...
Searching...
No Matches
PluginDayZCreatureAIDebug.c File Reference

Go to the source code of this file.

Classes

class  DayZCreatureAnimScriptDebug
 

Typedefs

typedef Param4< float, string, int, stringDayZCreatureAnimScriptDebugAnimEventData
 
typedef Param1< stringDayZCreatureAnimScriptDebugAnimPredictionData
 
typedef Param1< stringDayZCreatureAnimScriptDebugAnimTagData
 

Functions

void PluginDayZCreatureAIDebug ()
 
void ~PluginDayZCreatureAIDebug ()
 
override void OnInit ()
 
override void OnDestroy ()
 
void CheckShowMode ()
 
override void OnUpdate (float delta_time)
 
string GetStrValue (int index)
 
string GetStrValueType (int index)
 
void InitDebugObject (Object obj)
 
void ReleaseDebugObject ()
 
void SetValueInt (int index, int value)
 
void SetValueFloat (int index, float value)
 
void SetValueBool (int index, bool value)
 
void ActivateCommand (int commandIdx, int userInt, float userFloat)
 
void EnableAI (bool enable)
 
DayZCreatureAnimScriptDebugVarType GetVariableType (int index)
 
void OnGUI_Variables ()
 
void OnGUI_VariablesEdit ()
 
void OnGUI_CommandsEdit ()
 
void OnGUI_AIControlEdit ()
 
void OnGUI_BulkSet ()
 
void OnGUI_AnimEvents ()
 
void OnGUI (bool show)
 
void OnGUITimer ()
 
void SetDebugShowMode (int mode)
 
void Show ()
 
void Hide ()
 
void Event_OnClick ()
 
void GUIAction_InitDebugObject (Object obj)
 
void GUIAction_UpdateSimulationPrecision (int simLOD)
 
void GUIAction_ReleaseDebugObject ()
 
void GUIAction_SetValue (int index, string strVal)
 
void GUIAction_ActivateCommand (int commandIdx, int userInt, float userFloat)
 
void GUIAction_EnableAI (bool enable)
 
void SendSyncMessages ()
 
void OnRpc (PlayerBase player, int rpc_type, ParamsReadContext ctx)
 
void SyncReceiveMessage (ParamsReadContext ctx)
 
void SyncInitDebugObject (Object obj)
 
void SyncReceiveInitDebugObject (ParamsReadContext ctx)
 
void SyncReleaseDebugObject ()
 
void SyncReceiveReleaseDebugObject (ParamsReadContext ctx)
 
void SyncSetValueInt (int index, int value)
 
void SyncReceiveValueInt (ParamsReadContext ctx)
 
void SyncSetValueFloat (int index, float value)
 
void SyncReceiveValueFloat (ParamsReadContext ctx)
 
void SyncSetValueBool (int index, bool value)
 
void SyncReceiveValueBool (ParamsReadContext ctx)
 
void SyncActivateCommand (int commandIdx, int userInt, float userFloat)
 
void SyncReceiveActivateCommand (ParamsReadContext ctx)
 
void SyncEnableAI (bool enable)
 
void SyncReceiveEnableAI (ParamsReadContext ctx)
 
void SyncReceiveDisableAI (ParamsReadContext ctx)
 

Variables

class DayZCreatureAnimScriptDebug INIT_DEBUG_OBJECT
 
class DayZCreatureAnimScriptDebug RELEASE_DEBUG_OBJECT
 
class DayZCreatureAnimScriptDebug SET_VALUE_INT
 
class DayZCreatureAnimScriptDebug SET_VALUE_FLOAT
 
class DayZCreatureAnimScriptDebug SET_VALUE_BOOL
 
class DayZCreatureAnimScriptDebug ACTIVATE_COMMAND
 
class DayZCreatureAnimScriptDebug ENABLE_AI
 
class DayZCreatureAnimScriptDebug DISABLE_AI
 
class DayZCreatureAnimScriptDebug m_iDebugMenu = -1
 
DayZCreatureAI m_DebugEntity = NULL
 
string m_sDebugEntityName = ""
 
ref DayZCreatureAnimScriptDebug m_EntityAnimDbg = NULL
 
ref Timer m_TickTimer
 
bool m_IsActive = false
 
bool m_ShowDbgUI = false
 
bool m_bIsCaptureMode = false
 
bool m_bEditMode = false
 
bool m_bAIEnabled = true
 
bool m_bShowAnimEvents = false
 
bool m_bBulkSet = false
 
ref array< boolm_SetVariableCheckStates = new array<bool>
 
ref array< boolm_SetCommandCheckStates = new array<bool>
 
ref array< ref Paramm_SyncMessages = new array<ref Param>
 

Typedef Documentation

◆ DayZCreatureAnimScriptDebugAnimEventData

◆ DayZCreatureAnimScriptDebugAnimPredictionData

◆ DayZCreatureAnimScriptDebugAnimTagData

Function Documentation

◆ ActivateCommand()

void ActivateCommand ( int commandIdx,
int userInt,
float userFloat )

Definition at line 229 of file PluginDayZCreatureAIDebug.c.

230 {
231 int commandId = m_EntityAnimDbg.GetCommandID(commandIdx);
232 m_EntityAnimDbg.ActivateCommand(commandId, userInt, userFloat);
233 }
ref DayZCreatureAnimScriptDebug m_EntityAnimDbg

References m_EntityAnimDbg.

Referenced by GUIAction_ActivateCommand(), and SyncReceiveActivateCommand().

◆ CheckShowMode()

void CheckShowMode ( )

Definition at line 113 of file PluginDayZCreatureAIDebug.c.

114 {
115 int actMenuValue = DiagMenu.GetEngineValue(DayZCreatureAIConstants.DEBUG_SHOWDEBUGPLUGIN);
117 {
120 }
121 }
DayZCreatureAIConstants
void SetDebugShowMode(int mode)
class DayZCreatureAnimScriptDebug m_iDebugMenu
static proto int GetEngineValue(int id)
Get value at the given engine id.

References DiagMenu::GetEngineValue(), m_iDebugMenu, and SetDebugShowMode().

Referenced by OnUpdate().

◆ EnableAI()

void EnableAI ( bool enable)

Definition at line 235 of file PluginDayZCreatureAIDebug.c.

236 {
237 if (m_DebugEntity.IsInherited(DayZCreatureAI))
238 {
240 if (enable)
241 {
242#ifdef DIAG_DEVELOPER
243 creatureAI.DebugRestoreAIControl();
244#endif
245 }
246 else
247 {
248#ifdef DIAG_DEVELOPER
249 creatureAI.DebugDisableAIControl();
250#endif
251 }
252 }
253 }
DayZCreatureAI m_DebugEntity
do not process rotations !
Definition DayZAnimal.c:573

References m_DebugEntity.

Referenced by GUIAction_EnableAI(), SyncReceiveDisableAI(), and SyncReceiveEnableAI().

◆ Event_OnClick()

void Event_OnClick ( )

Definition at line 555 of file PluginDayZCreatureAIDebug.c.

556 {
557 if (m_IsActive == false)
558 return;
559
560 const float MAX_RAYCAST_RANGE = 1000;
562 {
563 vector dir = GetGame().GetPointerDirection();
564 vector pos = GetGame().GetCurrentCameraPosition();
565
566 // Raycast
567 vector from = pos;
568 vector to = pos + (dir * MAX_RAYCAST_RANGE);
573
575 {
576 for (int i = 0; i < objects.Count(); i++)
577 {
578 Object obj = objects.Get(i);
579 if (obj && obj.IsInherited(DayZCreature))
580 {
581 m_bIsCaptureMode = false;
583 return;
584 }
585 }
586 }
587 }
588 }
PlayerBase GetPlayer()
bool m_bIsCaptureMode
void GUIAction_InitDebugObject(Object obj)
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
proto native CGame GetGame()

References GetGame(), GetPlayer(), GUIAction_InitDebugObject(), m_bIsCaptureMode, m_IsActive, and DayZPhysics::RaycastRV().

◆ GetStrValue()

string GetStrValue ( int index)

Definition at line 129 of file PluginDayZCreatureAIDebug.c.

130 {
131 string strVal;
132 switch (m_EntityAnimDbg.GetVariableType(index))
133 {
135 int valInt = m_EntityAnimDbg.GetVariableInt(index);
136 strVal = valInt.ToString();
137 break;
139 float valFloat = m_EntityAnimDbg.GetVariableFloat(index);
140 strVal = valFloat.ToString();
141 break;
143 bool valBool = m_EntityAnimDbg.GetVariableBool(index);
144 if (valBool)
145 strVal = "true";
146 else
147 strVal = "false";
148 break;
149 default:
150 strVal = "unk";
151 }
152 return strVal;
153 }
DayZCreatureAnimScriptDebugVarType
Definition DayZCreature.c:2

References m_EntityAnimDbg.

Referenced by OnGUI_Variables().

◆ GetStrValueType()

string GetStrValueType ( int index)

Definition at line 155 of file PluginDayZCreatureAIDebug.c.

156 {
157 string strValType;
158 switch (m_EntityAnimDbg.GetVariableType(index))
159 {
161 strValType = "int";
162 break;
164 strValType = "float";
165 break;
167 strValType = "bool";
168 break;
169 default:
170 strValType = "unk";
171 }
172
173 return strValType;
174 }

References m_EntityAnimDbg.

Referenced by OnGUI_VariablesEdit().

◆ GetVariableType()

DayZCreatureAnimScriptDebugVarType GetVariableType ( int index)

Definition at line 255 of file PluginDayZCreatureAIDebug.c.

256 {
257 return m_EntityAnimDbg.GetVariableType(index);
258 }

References m_EntityAnimDbg.

Referenced by GUIAction_SetValue().

◆ GUIAction_ActivateCommand()

void GUIAction_ActivateCommand ( int commandIdx,
int userInt,
float userFloat )

Definition at line 657 of file PluginDayZCreatureAIDebug.c.

658 {
659 if (GetGame().IsMultiplayer())
661 else
663
664 }
void ActivateCommand(int commandIdx, int userInt, float userFloat)
void SyncActivateCommand(int commandIdx, int userInt, float userFloat)

References ActivateCommand(), GetGame(), and SyncActivateCommand().

Referenced by OnGUI_CommandsEdit().

◆ GUIAction_EnableAI()

void GUIAction_EnableAI ( bool enable)

Definition at line 666 of file PluginDayZCreatureAIDebug.c.

667 {
668 if (GetGame().IsMultiplayer())
670 else
672 }
void EnableAI(bool enable)
void SyncEnableAI(bool enable)

References EnableAI(), GetGame(), and SyncEnableAI().

Referenced by OnGUI_AIControlEdit().

◆ GUIAction_InitDebugObject()

void GUIAction_InitDebugObject ( Object obj)

GUI actions

Definition at line 594 of file PluginDayZCreatureAIDebug.c.

595 {
596 InitDebugObject(obj);
597 if (GetGame().IsMultiplayer())
599 }
void SyncInitDebugObject(Object obj)
void InitDebugObject(Object obj)

References GetGame(), InitDebugObject(), and SyncInitDebugObject().

Referenced by Event_OnClick().

◆ GUIAction_ReleaseDebugObject()

void GUIAction_ReleaseDebugObject ( )

Definition at line 614 of file PluginDayZCreatureAIDebug.c.

615 {
617 if (GetGame().IsMultiplayer())
619 }
void ReleaseDebugObject()
void SyncReleaseDebugObject()

References GetGame(), ReleaseDebugObject(), and SyncReleaseDebugObject().

Referenced by OnGUI().

◆ GUIAction_SetValue()

void GUIAction_SetValue ( int index,
string strVal )

Definition at line 621 of file PluginDayZCreatureAIDebug.c.

622 {
623 switch (GetVariableType(index))
624 {
626 int intValue = strVal.ToInt();
627 if (GetGame().IsMultiplayer())
629 else
631 break;
633 float floatValue = strVal.ToFloat();
634 if (GetGame().IsMultiplayer())
636 else
638 break;
640 bool boolValue;
641 strVal.ToLower();
642 if (strVal.Contains("true"))
643 boolValue = true;
644 else if (strVal.Contains("false"))
645 boolValue = false;
646 else
647 boolValue = (bool)strVal.ToInt();
648
649 if (GetGame().IsMultiplayer())
651 else
653 break;
654 }
655 }
void SyncSetValueBool(int index, bool value)
void SetValueInt(int index, int value)
void SyncSetValueInt(int index, int value)
void SetValueFloat(int index, float value)
void SetValueBool(int index, bool value)
DayZCreatureAnimScriptDebugVarType GetVariableType(int index)
void SyncSetValueFloat(int index, float value)

References GetGame(), GetVariableType(), SetValueBool(), SetValueFloat(), SetValueInt(), SyncSetValueBool(), SyncSetValueFloat(), and SyncSetValueInt().

Referenced by OnGUI_VariablesEdit().

◆ GUIAction_UpdateSimulationPrecision()

void GUIAction_UpdateSimulationPrecision ( int simLOD)

Definition at line 609 of file PluginDayZCreatureAIDebug.c.

610 {
611 m_DebugEntity.UpdateSimulationPrecision(simLOD);
612 }

References m_DebugEntity.

Referenced by OnGUI().

◆ Hide()

void Hide ( )

Definition at line 548 of file PluginDayZCreatureAIDebug.c.

549 {
550 m_IsActive = false;
552 OnGUI(false);
553 }
ref Timer m_TickTimer
void OnGUI(bool show)

References m_IsActive, m_TickTimer, and OnGUI().

◆ InitDebugObject()

void InitDebugObject ( Object obj)

Definition at line 176 of file PluginDayZCreatureAIDebug.c.

177 {
179 m_EntityAnimDbg.SetCreature(DayZCreature.Cast(obj));
180
181 m_DebugEntity = DayZCreatureAI.Cast(obj);
182 m_sDebugEntityName = obj.GetType();
183
184
185 int varCount = m_EntityAnimDbg.GetVariableCount();
186 int cmdCount = m_EntityAnimDbg.GetCommandCount();
187 int toAddCount = 0;
188
190 {
192 for (int idxVar = 0; idxVar < toAddCount; idxVar++)
193 m_SetVariableCheckStates.Insert(false);
194 }
195
196 if (m_SetCommandCheckStates.Count() < cmdCount)
197 {
199 for (int idxCmd = 0; idxCmd < toAddCount; idxCmd++)
200 m_SetCommandCheckStates.Insert(false);
201 }
202 }
ref array< bool > m_SetCommandCheckStates
string m_sDebugEntityName
ref array< bool > m_SetVariableCheckStates

References m_DebugEntity, m_EntityAnimDbg, m_sDebugEntityName, m_SetCommandCheckStates, and m_SetVariableCheckStates.

Referenced by GUIAction_InitDebugObject(), and SyncReceiveInitDebugObject().

◆ OnDestroy()

override void OnDestroy ( )

Definition at line 109 of file PluginDayZCreatureAIDebug.c.

110 {
111 }

◆ OnGUI()

void OnGUI ( bool show)

Definition at line 431 of file PluginDayZCreatureAIDebug.c.

432 {
433 const int windowPosX = 0;
434 const int windowPosY = 300;
435 const int mainPanelSizeX = 200;
436 const int mainPanelSizeY = 1;
437 const int margin = 10;
438
440 DbgUI.Begin("CretureAI debug", windowPosX, windowPosY);
441 if (show)
442 {
443 if (m_EntityAnimDbg == NULL)
444 {
445 if (m_bIsCaptureMode == true)
446 DbgUI.Text("Capturing...");
447 else
448 {
449 if (DbgUI.Button("Capture"))
450 m_bIsCaptureMode = true;
451 }
452
453 // Clear additional windows
454 DbgUI.Begin("CreatureAI EditMenu");
455 DbgUI.End();
456
457 DbgUI.Begin("CreatureAI AnimEvents");
458 DbgUI.End();
459 }
460 else
461 {
462 DbgUI.Panel("MinimumSize", mainPanelSizeX, mainPanelSizeY);
463
465 DbgUI.SameLine();
466 bool btnReleasePressed = DbgUI.Button("Release");
467
468 DbgUI.Check("Edit", m_bEditMode);
469 DbgUI.Check("ShowAnimEvents", m_bShowAnimEvents);
470
471#ifdef _DAYZ_CREATURE_DEBUG_SHADOW
472 if (!GetGame().IsMultiplayer())
473 {
474 DbgUI.SameLine();
475 if (DbgUI.Button("CreateShadow"))
477 }
478#endif
479
480 if (!GetGame().IsMultiplayer())
481 {
482 const int simLODInputSize = 20;
483 int simLOD;
485 DbgUI.SameLine();
486 if (DbgUI.Button("UpdateSimulationPrecision"))
488 }
489
492 else
493 {
495 DbgUI.Begin("CreatureAI EditMenu", windowPosX + mainPanelSizeX + margin, windowPosY);
496 if (m_bEditMode)
497 {
501 DbgUI.Spacer(20);
503 }
504 DbgUI.End();
505
506 DbgUI.Begin("CreatureAI AnimEvents", windowPosX + mainPanelSizeX + margin, windowPosY);
509 DbgUI.End();
510 }
511 }
512 }
513 DbgUI.End();
515 }
void OnGUI_AnimEvents()
bool m_bShowAnimEvents
void OnGUI_BulkSet()
void OnGUI_VariablesEdit()
void OnGUI_CommandsEdit()
void OnGUI_Variables()
void GUIAction_UpdateSimulationPrecision(int simLOD)
void GUIAction_ReleaseDebugObject()
void OnGUI_AIControlEdit()
class PresenceNotifierNoiseEvents windowPosX
dbgUI settings
const int mainPanelSizeX
const int margin
const int mainPanelSizeY
const int windowPosY
Definition DbgUI.c:60
static proto native void Panel(string label, int width, int height, int color=0xaa555555)
static proto native void End()
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto native bool Button(string txt, int minWidth=0)
static proto native void Text(string label)
static proto native void SameLine()
static proto void InputInt(string txt, out int value, int pxWidth=150)
static proto void BeginCleanupScope()
static proto native void Spacer(int height)
static proto void Check(string label, out bool checked)
static proto native void EndCleanupScope()

References DbgUI::Begin(), DbgUI::BeginCleanupScope(), DbgUI::Button(), DbgUI::Check(), DbgUI::End(), DbgUI::EndCleanupScope(), GetGame(), GUIAction_ReleaseDebugObject(), GUIAction_UpdateSimulationPrecision(), DbgUI::InputInt(), m_bEditMode, m_bIsCaptureMode, m_bShowAnimEvents, m_EntityAnimDbg, m_sDebugEntityName, mainPanelSizeX, mainPanelSizeY, margin, OnGUI_AIControlEdit(), OnGUI_AnimEvents(), OnGUI_BulkSet(), OnGUI_CommandsEdit(), OnGUI_Variables(), OnGUI_VariablesEdit(), DbgUI::Panel(), DbgUI::SameLine(), DbgUI::Spacer(), DbgUI::Text(), windowPosX, and windowPosY.

Referenced by Hide(), and OnGUITimer().

◆ OnGUI_AIControlEdit()

void OnGUI_AIControlEdit ( )

Definition at line 351 of file PluginDayZCreatureAIDebug.c.

352 {
353 bool buttonPressed = false;
354 if (m_bAIEnabled)
355 buttonPressed = DbgUI.Button("Disable AI");
356 else
357 buttonPressed = DbgUI.Button("Enable AI");
358
359 if (buttonPressed)
360 {
362
364 }
365 }
bool m_bAIEnabled
void GUIAction_EnableAI(bool enable)

References DbgUI::Button(), GUIAction_EnableAI(), and m_bAIEnabled.

Referenced by OnGUI().

◆ OnGUI_AnimEvents()

void OnGUI_AnimEvents ( )

Definition at line 375 of file PluginDayZCreatureAIDebug.c.

376 {
377 DbgUI.PushID_Str("AnimEvents");
378
379 const int panelMinSizeX = 350;
380
381 DbgUI.Panel("MinimumSize", panelMinSizeX, 1);
382
383 string strTags;
384 for (int tagIdx = 0; tagIdx < m_EntityAnimDbg.m_AnimTags.Count(); ++tagIdx)
385 {
386 if (tagIdx != 0)
387 strTags += ", ";
388
389 strTags += m_EntityAnimDbg.m_AnimTags[tagIdx].param1;
390 }
391
392 string strPredictions;
393 for (int predIdx = 0; predIdx < m_EntityAnimDbg.m_AnimPredictions.Count(); ++predIdx)
394 {
395 if (predIdx != 0)
396 strPredictions += ", ";
397
398 strPredictions += m_EntityAnimDbg.m_AnimPredictions[predIdx].param1;
399 }
400
401 DbgUI.PushID_Str("AnimTagsDisplay");
403 DbgUI.PopID();
404
405 DbgUI.PushID_Str("AnimPredictionsDisplay");
407 DbgUI.PopID();
408
409 string strFilter;
411
412 m_EntityAnimDbg.m_EventsFilter.Clear();
413 strFilter.Split(" ", m_EntityAnimDbg.m_EventsFilter);
414
415 DbgUI.Button("TakeMyFocus");
416
417 const int evDisplayCount = 15;
418 int evToDisplayCount = (int)Math.Min(m_EntityAnimDbg.m_AnimEvents.Count(), evDisplayCount);
419
420 for (int evIdx = 0; evIdx < evToDisplayCount; ++evIdx)
421 {
423 if (m_EntityAnimDbg.m_AnimEvents[evIdx].param2.Length() > 0)
424 DbgUI.Text((m_EntityAnimDbg.m_AnimEvents[evIdx].param1 / 1000.0).ToString() + " - " + m_EntityAnimDbg.m_AnimEvents[evIdx].param2);
425 DbgUI.PopID();
426 }
427
428 DbgUI.PopID();
429 }
Param3 int
Definition EnMath.c:7
static proto native void PopID()
static proto void InputText(string txt, out string value, int pxWidth=150)
static proto native void PushID_Int(int int_id)
static proto native void PushID_Str(string str_id)
static proto float Min(float x, float y)
Returns smaller of two given values.

References DbgUI::Button(), DbgUI::InputText(), m_EntityAnimDbg, Math::Min(), DbgUI::Panel(), DbgUI::PopID(), DbgUI::PushID_Int(), DbgUI::PushID_Str(), and DbgUI::Text().

Referenced by OnGUI().

◆ OnGUI_BulkSet()

void OnGUI_BulkSet ( )

Definition at line 367 of file PluginDayZCreatureAIDebug.c.

368 {
369 m_bBulkSet = false;
370
371 if (DbgUI.Button("Bulk set"))
372 m_bBulkSet = true;
373 }

References DbgUI::Button(), and m_bBulkSet.

Referenced by OnGUI().

◆ OnGUI_CommandsEdit()

void OnGUI_CommandsEdit ( )

Definition at line 310 of file PluginDayZCreatureAIDebug.c.

311 {
312 const int INPUT_BOX_SIZE = 35;
313
314 DbgUI.PushID_Str("CommandsEdit");
315 int cmdCount = m_EntityAnimDbg.GetCommandCount();
316 for (int i = 0; i < cmdCount; i++)
317 {
319
321
322 bool result;
323 DbgUI.Check("", result);
325
326 DbgUI.SameLine();
327 bool setButtonPressed = DbgUI.Button("Set");
328
329 DbgUI.SameLine();
330 string strUserInt;
332
333 DbgUI.SameLine();
334 string strUserFloat;
336
337 DbgUI.SameLine();
338 DbgUI.Text(m_EntityAnimDbg.GetCommandName(i) + "[" + m_EntityAnimDbg.GetCommandID(i) + "]");
339
342
343 DbgUI.PopID();
344
346 }
347
348 DbgUI.PopID();
349 }
void GUIAction_ActivateCommand(int commandIdx, int userInt, float userFloat)

References DbgUI::BeginCleanupScope(), DbgUI::Button(), DbgUI::Check(), DbgUI::EndCleanupScope(), GUIAction_ActivateCommand(), DbgUI::InputText(), m_bBulkSet, m_EntityAnimDbg, m_SetCommandCheckStates, DbgUI::PopID(), DbgUI::PushID_Int(), DbgUI::PushID_Str(), DbgUI::SameLine(), and DbgUI::Text().

Referenced by OnGUI().

◆ OnGUI_Variables()

void OnGUI_Variables ( )

Definition at line 260 of file PluginDayZCreatureAIDebug.c.

261 {
262 int varCount = m_EntityAnimDbg.GetVariableCount();
263 for (int i = 0; i < varCount; i++)
264 {
266 DbgUI.Text(m_EntityAnimDbg.GetVariableName(i) + ": " + GetStrValue(i));
268 }
269 }
string GetStrValue(int index)

References DbgUI::BeginCleanupScope(), DbgUI::EndCleanupScope(), GetStrValue(), m_EntityAnimDbg, and DbgUI::Text().

Referenced by OnGUI().

◆ OnGUI_VariablesEdit()

void OnGUI_VariablesEdit ( )

Definition at line 271 of file PluginDayZCreatureAIDebug.c.

272 {
273 const int INPUT_BOX_SIZE = 35;
274
275 DbgUI.PushID_Str("VariablesEdit");
276
277 int varCount = m_EntityAnimDbg.GetVariableCount();
278 for (int i = 0; i < varCount; i++)
279 {
281
283
284 bool result;
285 DbgUI.Check("", result);
287
288 DbgUI.SameLine();
289 bool setButtonPressed = DbgUI.Button("Set");
290
291 DbgUI.SameLine();
292
293 string strUserVal;
295
296 DbgUI.SameLine();
297 DbgUI.Text(m_EntityAnimDbg.GetVariableName(i));
298
301
302 DbgUI.PopID();
303
305 }
306
307 DbgUI.PopID();
308 }
string GetStrValueType(int index)
void GUIAction_SetValue(int index, string strVal)

References DbgUI::BeginCleanupScope(), DbgUI::Button(), DbgUI::Check(), DbgUI::EndCleanupScope(), GetStrValueType(), GUIAction_SetValue(), DbgUI::InputText(), m_bBulkSet, m_EntityAnimDbg, m_SetVariableCheckStates, DbgUI::PopID(), DbgUI::PushID_Int(), DbgUI::PushID_Str(), DbgUI::SameLine(), and DbgUI::Text().

Referenced by OnGUI().

◆ OnGUITimer()

void OnGUITimer ( )

Definition at line 517 of file PluginDayZCreatureAIDebug.c.

518 {
520
521 if (GetGame().IsMultiplayer() && GetGame().IsClient())
523 }
void SendSyncMessages()

References GetGame(), m_IsActive, OnGUI(), and SendSyncMessages().

◆ OnInit()

override void OnInit ( )

Definition at line 105 of file PluginDayZCreatureAIDebug.c.

106 {
107 }

◆ OnRpc()

void OnRpc ( PlayerBase player,
int rpc_type,
ParamsReadContext ctx )

Definition at line 692 of file PluginDayZCreatureAIDebug.c.

693 {
694 if (rpc_type == ERPCs.DEV_RPC_PLUGIN_DZCREATURE_DEBUG)
696 }
ERPCs
Definition ERPCs.c:2
void SyncReceiveMessage(ParamsReadContext ctx)

References SyncReceiveMessage().

◆ OnUpdate()

override void OnUpdate ( float delta_time)

Definition at line 123 of file PluginDayZCreatureAIDebug.c.

124 {
125 if (!GetGame().IsDedicatedServer())
127 }
void CheckShowMode()

References CheckShowMode(), and GetGame().

◆ PluginDayZCreatureAIDebug()

void PluginDayZCreatureAIDebug ( )

Definition at line 97 of file PluginDayZCreatureAIDebug.c.

98 {
99 }

Referenced by PluginBase::OnRPCPluginDayzCreatureDebug().

◆ ReleaseDebugObject()

◆ SendSyncMessages()

void SendSyncMessages ( )

sync

Definition at line 678 of file PluginDayZCreatureAIDebug.c.

679 {
680 int count = m_SyncMessages.Count();
681 if (count > 0)
682 {
684 m_SyncMessages.InsertAt(paramCount, 0);
685
686 GetGame().GetPlayer().RPC(ERPCs.DEV_RPC_PLUGIN_DZCREATURE_DEBUG, m_SyncMessages, true);
687
688 m_SyncMessages.Clear();
689 }
690 }
ref array< ref Param > m_SyncMessages

References GetGame(), and m_SyncMessages.

Referenced by OnGUITimer().

◆ SetDebugShowMode()

void SetDebugShowMode ( int mode)

Definition at line 525 of file PluginDayZCreatureAIDebug.c.

526 {
527 switch (mode)
528 {
529 case 0:
530 {
531 Hide();
532 } break;
533 case 1:
534 {
535 Show();
536 } break;
537 }
538 }

References PluginBase::Hide(), and PluginBase::Show().

Referenced by CheckShowMode().

◆ SetValueBool()

void SetValueBool ( int index,
bool value )

Definition at line 224 of file PluginDayZCreatureAIDebug.c.

225 {
226 m_EntityAnimDbg.SetVariableBool(index, value);
227 }

References m_EntityAnimDbg.

Referenced by GUIAction_SetValue(), and SyncReceiveValueBool().

◆ SetValueFloat()

void SetValueFloat ( int index,
float value )

Definition at line 219 of file PluginDayZCreatureAIDebug.c.

220 {
221 m_EntityAnimDbg.SetVariableFloat(index, value);
222 }

References m_EntityAnimDbg.

Referenced by GUIAction_SetValue(), and SyncReceiveValueFloat().

◆ SetValueInt()

void SetValueInt ( int index,
int value )

Definition at line 214 of file PluginDayZCreatureAIDebug.c.

215 {
216 m_EntityAnimDbg.SetVariableInt(index, value);
217 }

References m_EntityAnimDbg.

Referenced by GUIAction_SetValue(), and SyncReceiveValueInt().

◆ Show()

void Show ( )

Definition at line 540 of file PluginDayZCreatureAIDebug.c.

541 {
542 m_IsActive = true;
543
544 m_TickTimer = new Timer();
545 m_TickTimer.Run(0.1, this, "OnGUITimer", NULL, true);
546 }

References m_IsActive, and m_TickTimer.

◆ SyncActivateCommand()

void SyncActivateCommand ( int commandIdx,
int userInt,
float userFloat )

Definition at line 821 of file PluginDayZCreatureAIDebug.c.

References m_SyncMessages.

Referenced by GUIAction_ActivateCommand().

◆ SyncEnableAI()

void SyncEnableAI ( bool enable)

Definition at line 838 of file PluginDayZCreatureAIDebug.c.

839 {
841 if (enable)
842 type.param1 = PluginDayZCreatureAIDebugSyncMessageType.ENABLE_AI;
843 else
844 type.param1 = PluginDayZCreatureAIDebugSyncMessageType.DISABLE_AI;
845
846 m_SyncMessages.Insert(type);
847 }

References m_SyncMessages.

Referenced by GUIAction_EnableAI().

◆ SyncInitDebugObject()

void SyncInitDebugObject ( Object obj)

Definition at line 742 of file PluginDayZCreatureAIDebug.c.

743 {
745 Param1<Object> object = new Param1<Object>(obj);
746
747 m_SyncMessages.Insert(type);
748 m_SyncMessages.Insert(object);
749 }

References m_SyncMessages.

Referenced by GUIAction_InitDebugObject().

◆ SyncReceiveActivateCommand()

void SyncReceiveActivateCommand ( ParamsReadContext ctx)

Definition at line 830 of file PluginDayZCreatureAIDebug.c.

831 {
833
834 if (ctx.Read(command))
835 ActivateCommand(command.param1, command.param2, command.param3);
836 }

References ActivateCommand().

Referenced by SyncReceiveMessage().

◆ SyncReceiveDisableAI()

void SyncReceiveDisableAI ( ParamsReadContext ctx)

Definition at line 854 of file PluginDayZCreatureAIDebug.c.

855 {
856 EnableAI(false);
857 }

References EnableAI().

Referenced by SyncReceiveMessage().

◆ SyncReceiveEnableAI()

void SyncReceiveEnableAI ( ParamsReadContext ctx)

Definition at line 849 of file PluginDayZCreatureAIDebug.c.

850 {
851 EnableAI(true);
852 }

References EnableAI().

Referenced by SyncReceiveMessage().

◆ SyncReceiveInitDebugObject()

void SyncReceiveInitDebugObject ( ParamsReadContext ctx)

Definition at line 751 of file PluginDayZCreatureAIDebug.c.

752 {
753 Param1<Object> object = new Param1<Object>(NULL);
754 if (ctx.Read(object))
755 InitDebugObject(object.param1);
756 }

References InitDebugObject().

Referenced by SyncReceiveMessage().

◆ SyncReceiveMessage()

void SyncReceiveMessage ( ParamsReadContext ctx)

Definition at line 698 of file PluginDayZCreatureAIDebug.c.

699 {
701
702 if (ctx.Read(count))
703 {
705 for (int i = 0; i < count.param1; ++i)
706 {
707 if (ctx.Read(type))
708 {
709 switch (type.param1)
710 {
711 case PluginDayZCreatureAIDebugSyncMessageType.INIT_DEBUG_OBJECT:
713 break;
714 case PluginDayZCreatureAIDebugSyncMessageType.RELEASE_DEBUG_OBJECT:
716 break;
719 break;
720 case PluginDayZCreatureAIDebugSyncMessageType.SET_VALUE_FLOAT:
722 break;
725 break;
726 case PluginDayZCreatureAIDebugSyncMessageType.ACTIVATE_COMMAND:
728 break;
731 break;
734 break;
735 }
736 }
738 }
739 }
740 }
void SyncReceiveDisableAI(ParamsReadContext ctx)
void SyncReceiveInitDebugObject(ParamsReadContext ctx)
void SyncReceiveReleaseDebugObject(ParamsReadContext ctx)
void SyncReceiveEnableAI(ParamsReadContext ctx)
void SyncReceiveValueInt(ParamsReadContext ctx)
void SyncReceiveValueFloat(ParamsReadContext ctx)
void SyncReceiveValueBool(ParamsReadContext ctx)
void SyncReceiveActivateCommand(ParamsReadContext ctx)

References SyncReceiveActivateCommand(), SyncReceiveDisableAI(), SyncReceiveEnableAI(), SyncReceiveInitDebugObject(), SyncReceiveReleaseDebugObject(), SyncReceiveValueBool(), SyncReceiveValueFloat(), and SyncReceiveValueInt().

Referenced by OnRpc().

◆ SyncReceiveReleaseDebugObject()

void SyncReceiveReleaseDebugObject ( ParamsReadContext ctx)

Definition at line 765 of file PluginDayZCreatureAIDebug.c.

766 {
768 }

References ReleaseDebugObject().

Referenced by SyncReceiveMessage().

◆ SyncReceiveValueBool()

void SyncReceiveValueBool ( ParamsReadContext ctx)

Definition at line 813 of file PluginDayZCreatureAIDebug.c.

814 {
816
817 if (ctx.Read(paramValue))
818 SetValueBool(paramValue.param1, paramValue.param2);
819 }

References SetValueBool().

Referenced by SyncReceiveMessage().

◆ SyncReceiveValueFloat()

void SyncReceiveValueFloat ( ParamsReadContext ctx)

Definition at line 796 of file PluginDayZCreatureAIDebug.c.

797 {
799
800 if (ctx.Read(paramValue))
801 SetValueFloat(paramValue.param1, paramValue.param2);
802 }

References SetValueFloat().

Referenced by SyncReceiveMessage().

◆ SyncReceiveValueInt()

void SyncReceiveValueInt ( ParamsReadContext ctx)

Definition at line 779 of file PluginDayZCreatureAIDebug.c.

780 {
782
783 if (ctx.Read(paramValue))
784 SetValueInt(paramValue.param1, paramValue.param2);
785 }

References SetValueInt().

Referenced by SyncReceiveMessage().

◆ SyncReleaseDebugObject()

void SyncReleaseDebugObject ( )

Definition at line 758 of file PluginDayZCreatureAIDebug.c.

759 {
761
762 m_SyncMessages.Insert(type);
763 }

References m_SyncMessages.

Referenced by GUIAction_ReleaseDebugObject().

◆ SyncSetValueBool()

void SyncSetValueBool ( int index,
bool value )

Definition at line 804 of file PluginDayZCreatureAIDebug.c.

805 {
808
809 m_SyncMessages.Insert(type);
811 }

References m_SyncMessages.

Referenced by GUIAction_SetValue().

◆ SyncSetValueFloat()

void SyncSetValueFloat ( int index,
float value )

Definition at line 787 of file PluginDayZCreatureAIDebug.c.

788 {
791
792 m_SyncMessages.Insert(type);
794 }

References m_SyncMessages.

Referenced by GUIAction_SetValue().

◆ SyncSetValueInt()

void SyncSetValueInt ( int index,
int value )

Definition at line 770 of file PluginDayZCreatureAIDebug.c.

771 {
774
775 m_SyncMessages.Insert(type);
777 }

References m_SyncMessages.

Referenced by GUIAction_SetValue().

◆ ~PluginDayZCreatureAIDebug()

Definition at line 101 of file PluginDayZCreatureAIDebug.c.

102 {
103 }

Variable Documentation

◆ ACTIVATE_COMMAND

◆ DISABLE_AI

◆ ENABLE_AI

◆ INIT_DEBUG_OBJECT

◆ m_bAIEnabled

bool m_bAIEnabled = true

Definition at line 88 of file PluginDayZCreatureAIDebug.c.

Referenced by OnGUI_AIControlEdit().

◆ m_bBulkSet

bool m_bBulkSet = false

◆ m_bEditMode

bool m_bEditMode = false

Definition at line 87 of file PluginDayZCreatureAIDebug.c.

Referenced by OnGUI().

◆ m_bIsCaptureMode

bool m_bIsCaptureMode = false

Definition at line 86 of file PluginDayZCreatureAIDebug.c.

Referenced by Event_OnClick(), and OnGUI().

◆ m_bShowAnimEvents

bool m_bShowAnimEvents = false

Definition at line 89 of file PluginDayZCreatureAIDebug.c.

Referenced by OnGUI().

◆ m_DebugEntity

◆ m_EntityAnimDbg

◆ m_iDebugMenu

Referenced by CheckShowMode().

◆ m_IsActive

bool m_IsActive = false

Definition at line 83 of file PluginDayZCreatureAIDebug.c.

◆ m_sDebugEntityName

string m_sDebugEntityName = ""

Definition at line 79 of file PluginDayZCreatureAIDebug.c.

Referenced by InitDebugObject(), OnGUI(), and ReleaseDebugObject().

◆ m_SetCommandCheckStates

ref array<bool> m_SetCommandCheckStates = new array<bool>

◆ m_SetVariableCheckStates

ref array<bool> m_SetVariableCheckStates = new array<bool>

◆ m_ShowDbgUI

bool m_ShowDbgUI = false

Definition at line 84 of file PluginDayZCreatureAIDebug.c.

◆ m_SyncMessages

◆ m_TickTimer

◆ RELEASE_DEBUG_OBJECT

class DayZCreatureAnimScriptDebug RELEASE_DEBUG_OBJECT

◆ SET_VALUE_BOOL

◆ SET_VALUE_FLOAT

◆ SET_VALUE_INT