DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
PluginDayZCreatureAIDebug.c
Go to the documentation of this file.
1typedef Param4<float, string, int, string> DayZCreatureAnimScriptDebugAnimEventData;
4
6{
7 proto native void SetCreature(DayZCreature creature);
8
9 proto native int GetVariableCount();
10 proto native owned string GetVariableName(int index);
11 proto native int GetVariableType(int index);
12 proto native int GetVariableInt(int index);
13 proto native float GetVariableFloat(int index);
14 proto native bool GetVariableBool(int index);
15
16 proto native int SetVariableInt(int index, int value);
17 proto native float SetVariableFloat(int index, float value);
18 proto native bool SetVariableBool(int index, bool value);
19
20 proto native int GetCommandCount();
21 proto native owned string GetCommandName(int index);
22 proto native int GetCommandID(int index);
23
24 proto native void ActivateCommand(int index, int userInt, float userFloat);
25
26 const int m_iMaxAnimEventsCount = 50;
28
32
34 {
35 m_AnimPredictions.Clear();
36 m_AnimTags.Clear();
37 }
38
39 void OnAnimationEvent(string evType, int userInt, string userString)
40 {
41 if (m_EventsFilter.Find(evType) != -1)
42 {
43 return;
44 }
45
46 m_AnimEvents.InsertAt(new DayZCreatureAnimScriptDebugAnimEventData(GetWorldTime(), evType, userInt, userString), 0);
47
49 {
50 m_AnimEvents.Remove(m_AnimEvents.Count() - 1);
51 }
52 }
53
54 void OnAnimationPrediction(string predName)
55 {
57 }
58
59 void OnAnimationTag(string tagName)
60 {
62 }
63}
64
65enum PluginDayZCreatureAIDebugSyncMessageType
66{
75 COUNT
76}
77
79{
80 int m_iDebugMenu = -1;
81
83 string m_sDebugEntityName = "";
85
87 bool m_IsActive = false;
88 bool m_ShowDbgUI = false;
89
90 bool m_bIsCaptureMode = false;
91 bool m_bEditMode = false;
92 bool m_bAIEnabled = true;
93 bool m_bShowAnimEvents = false;
94
95 bool m_bBulkSet = false;
98
100
102 {
103 }
104
106 {
107 }
108
109 override void OnInit()
110 {
111 }
112
113 override void OnDestroy()
114 {
115 }
116
118 {
119 int actMenuValue = DiagMenu.GetEngineValue(DayZCreatureAIConstants.DEBUG_SHOWDEBUGPLUGIN);
120 if (actMenuValue != m_iDebugMenu)
121 {
122 SetDebugShowMode(actMenuValue);
123 m_iDebugMenu = actMenuValue;
124 }
125 }
126
127 override void OnUpdate(float delta_time)
128 {
129 if (!GetGame().IsDedicatedServer())
130 {
132 }
133 }
134
135 string GetStrValue(int index)
136 {
137 string strVal;
138 switch (m_EntityAnimDbg.GetVariableType(index))
139 {
141 int valInt = m_EntityAnimDbg.GetVariableInt(index);
142 strVal = valInt.ToString();
143 break;
145 float valFloat = m_EntityAnimDbg.GetVariableFloat(index);
146 strVal = valFloat.ToString();
147 break;
149 bool valBool = m_EntityAnimDbg.GetVariableBool(index);
150 if (valBool)
151 {
152 strVal = "true";
153 }
154 else
155 {
156 strVal = "false";
157 }
158 break;
159 default:
160 strVal = "unk";
161 }
162 return strVal;
163 }
164
165 string GetStrValueType(int index)
166 {
167 string strValType;
168 switch (m_EntityAnimDbg.GetVariableType(index))
169 {
171 strValType = "int";
172 break;
174 strValType = "float";
175 break;
177 strValType = "bool";
178 break;
179 default:
180 strValType = "unk";
181 }
182
183 return strValType;
184 }
185
187 {
190
191 m_DebugEntity = DayZCreatureAI.Cast( obj );
192 m_sDebugEntityName = obj.GetType();
193
194
195 int varCount = m_EntityAnimDbg.GetVariableCount();
196 int cmdCount = m_EntityAnimDbg.GetCommandCount();
197 int toAddCount = 0;
198
199 if (m_SetVariableCheckStates.Count() < varCount)
200 {
201 toAddCount = varCount - m_SetVariableCheckStates.Count();
202 for (int idxVar = 0; idxVar < toAddCount; idxVar++)
203 {
204 m_SetVariableCheckStates.Insert(false);
205 }
206 }
207
208 if (m_SetCommandCheckStates.Count() < cmdCount)
209 {
210 toAddCount = cmdCount - m_SetCommandCheckStates.Count();
211 for (int idxCmd = 0; idxCmd < toAddCount; idxCmd++)
212 {
213 m_SetCommandCheckStates.Insert(false);
214 }
215 }
216 }
217
219 {
220 m_DebugEntity = NULL;
221 m_EntityAnimDbg = NULL;
223
226 }
227
228 void SetValueInt(int index, int value)
229 {
230 m_EntityAnimDbg.SetVariableInt(index, value);
231 }
232
233 void SetValueFloat(int index, float value)
234 {
235 m_EntityAnimDbg.SetVariableFloat(index, value);
236 }
237
238 void SetValueBool(int index, bool value)
239 {
240 m_EntityAnimDbg.SetVariableBool(index, value);
241 }
242
243 void ActivateCommand(int commandIdx, int userInt, float userFloat)
244 {
245 int commandId = m_EntityAnimDbg.GetCommandID(commandIdx);
246 m_EntityAnimDbg.ActivateCommand(commandId, userInt, userFloat);
247 }
248
249 void EnableAI(bool enable)
250 {
251 if (m_DebugEntity.IsInherited(DayZCreatureAI))
252 {
253 DayZCreatureAI creatureAI = m_DebugEntity;
254 if (enable)
255 {
256 #ifdef DIAG_DEVELOPER
257 creatureAI.DebugRestoreAIControl();
258 #endif
259 }
260 else
261 {
262 #ifdef DIAG_DEVELOPER
263 creatureAI.DebugDisableAIControl();
264 #endif
265 }
266 }
267 }
268
270 {
271 return m_EntityAnimDbg.GetVariableType(index);
272 }
273
275 {
276 int varCount = m_EntityAnimDbg.GetVariableCount();
277 for (int i=0; i < varCount; i++)
278 {
282 }
283 }
284
286 {
287 const int INPUT_BOX_SIZE = 35;
288
289 DbgUI.PushID_Str("VariablesEdit");
290
291 int varCount = m_EntityAnimDbg.GetVariableCount();
292 for (int i=0; i < varCount; i++)
293 {
295
296 DbgUI.PushID_Int(i);
297
298 bool result;
299 DbgUI.Check("", result);
300 m_SetVariableCheckStates[i] = result;
301
302 DbgUI.SameLine();
303 bool setButtonPressed = DbgUI.Button("Set");
304
305 DbgUI.SameLine();
306
307 string strUserVal;
308 DbgUI.InputText(GetStrValueType(i), strUserVal, INPUT_BOX_SIZE);
309
310 DbgUI.SameLine();
312
313 if (setButtonPressed || (m_bBulkSet && m_SetVariableCheckStates[i]))
314 {
315 GUIAction_SetValue(i, strUserVal);
316 }
317
318 DbgUI.PopID();
319
321 }
322
323 DbgUI.PopID();
324 }
325
327 {
328 const int INPUT_BOX_SIZE = 35;
329
330 DbgUI.PushID_Str("CommandsEdit");
331 int cmdCount = m_EntityAnimDbg.GetCommandCount();
332 for (int i=0; i < cmdCount; i++)
333 {
335
336 DbgUI.PushID_Int(i);
337
338 bool result;
339 DbgUI.Check("", result);
340 m_SetCommandCheckStates[i] = result;
341
342 DbgUI.SameLine();
343 bool setButtonPressed = DbgUI.Button("Set");
344
345 DbgUI.SameLine();
346 string strUserInt;
347 DbgUI.InputText("int", strUserInt, INPUT_BOX_SIZE);
348
349 DbgUI.SameLine();
350 string strUserFloat;
351 DbgUI.InputText("float", strUserFloat, INPUT_BOX_SIZE);
352
353 DbgUI.SameLine();
355
356 if (setButtonPressed || (m_bBulkSet && m_SetCommandCheckStates[i]))
357 {
358 GUIAction_ActivateCommand(i, strUserInt.ToInt(), strUserFloat.ToFloat());
359 }
360
361 DbgUI.PopID();
362
364 }
365
366 DbgUI.PopID();
367 }
368
370 {
371 bool buttonPressed = false;
372 if (m_bAIEnabled)
373 {
374 buttonPressed = DbgUI.Button("Disable AI");
375 }
376 else
377 {
378 buttonPressed = DbgUI.Button("Enable AI");
379 }
380
381 if (buttonPressed)
382 {
384
386 }
387 }
388
390 {
391 m_bBulkSet = false;
392
393 if (DbgUI.Button("Bulk set"))
394 {
395 m_bBulkSet = true;
396 }
397 }
398
400 {
401 DbgUI.PushID_Str("AnimEvents");
402
403 const int panelMinSizeX = 350;
404
405 DbgUI.Panel("MinimumSize", panelMinSizeX, 1);
406
407 string strTags;
408 for (int tagIdx = 0; tagIdx < m_EntityAnimDbg.m_AnimTags.Count(); ++tagIdx)
409 {
410 if (tagIdx != 0)
411 strTags += ", ";
412
413 strTags += m_EntityAnimDbg.m_AnimTags[tagIdx].param1;
414 }
415
416 string strPredictions;
417 for (int predIdx = 0; predIdx < m_EntityAnimDbg.m_AnimPredictions.Count(); ++predIdx)
418 {
419 if (predIdx != 0)
420 strPredictions += ", ";
421
422 strPredictions += m_EntityAnimDbg.m_AnimPredictions[predIdx].param1;
423 }
424
425 DbgUI.PushID_Str("AnimTagsDisplay");
426 DbgUI.Text(strTags);
427 DbgUI.PopID();
428
429 DbgUI.PushID_Str("AnimPredictionsDisplay");
430 DbgUI.Text(strPredictions);
431 DbgUI.PopID();
432
433 string strFilter;
434 DbgUI.InputText("Filter", strFilter, panelMinSizeX);
435
437 strFilter.Split(" ", m_EntityAnimDbg.m_EventsFilter);
438
439 DbgUI.Button("TakeMyFocus");
440
441 const int evDisplayCount = 15;
442 int evToDisplayCount = (int)Math.Min(m_EntityAnimDbg.m_AnimEvents.Count(), evDisplayCount);
443
444 for (int evIdx = 0; evIdx < evToDisplayCount; ++evIdx)
445 {
446 DbgUI.PushID_Int(evIdx);
447 if (m_EntityAnimDbg.m_AnimEvents[evIdx].param2.Length() > 0)
448 {
449 DbgUI.Text((m_EntityAnimDbg.m_AnimEvents[evIdx].param1 / 1000.0).ToString() + " - " + m_EntityAnimDbg.m_AnimEvents[evIdx].param2);
450 }
451 DbgUI.PopID();
452 }
453
454 DbgUI.PopID();
455 }
456
457 void OnGUI(bool show)
458 {
459 const int windowPosX = 0;
460 const int windowPosY = 300;
461 const int mainPanelSizeX = 200;
462 const int mainPanelSizeY = 1;
463 const int margin = 10;
464
466 DbgUI.Begin("CretureAI debug", windowPosX, windowPosY);
467 if (show)
468 {
469 if (m_EntityAnimDbg == NULL)
470 {
471 if (m_bIsCaptureMode == true)
472 {
473 DbgUI.Text("Capturing...");
474 }
475 else
476 {
477 if (DbgUI.Button("Capture"))
478 {
479 m_bIsCaptureMode = true;
480 }
481 }
482
483 // Clear additional windows
484 DbgUI.Begin("CreatureAI EditMenu");
485 DbgUI.End();
486
487 DbgUI.Begin("CreatureAI AnimEvents");
488 DbgUI.End();
489 }
490 else
491 {
492 DbgUI.Panel("MinimumSize", mainPanelSizeX, mainPanelSizeY);
493
495 DbgUI.SameLine();
496 bool btnReleasePressed = DbgUI.Button("Release");
497
498 DbgUI.Check("Edit", m_bEditMode);
499 DbgUI.Check("ShowAnimEvents", m_bShowAnimEvents);
500
501 #ifdef _DAYZ_CREATURE_DEBUG_SHADOW
502 if (!GetGame().IsMultiplayer())
503 {
504 DbgUI.SameLine();
505 if (DbgUI.Button("CreateShadow"))
506 {
507 GUIAction_CreateShadow();
508 }
509 }
510 #endif
511
512 if (!GetGame().IsMultiplayer())
513 {
514 const int simLODInputSize = 20;
515 int simLOD;
516 DbgUI.InputInt("SimLOD", simLOD, simLODInputSize);
517 DbgUI.SameLine();
518 if (DbgUI.Button("UpdateSimulationPrecision"))
519 {
521 }
522 }
523
524 if (btnReleasePressed)
525 {
527 }
528 else
529 {
531 DbgUI.Begin("CreatureAI EditMenu", windowPosX + mainPanelSizeX + margin, windowPosY);
532 if (m_bEditMode)
533 {
537 DbgUI.Spacer(20);
539 }
540 DbgUI.End();
541
542 DbgUI.Begin("CreatureAI AnimEvents", windowPosX + mainPanelSizeX + margin, windowPosY);
544 {
546 }
547 DbgUI.End();
548 }
549 }
550 }
551 DbgUI.End();
553 }
554
556 {
558
559 if (GetGame().IsMultiplayer() && GetGame().IsClient())
560 {
562 }
563 }
564
565 void SetDebugShowMode(int mode)
566 {
567 switch (mode)
568 {
569 case 0:
570 {
571 Hide();
572 } break;
573 case 1:
574 {
575 Show();
576 } break;
577 }
578 }
579
580 void Show()
581 {
582 m_IsActive = true;
583
584 m_TickTimer = new Timer();
585 m_TickTimer.Run(0.1, this, "OnGUITimer", NULL, true);
586 }
587
588 void Hide()
589 {
590 m_IsActive = false;
591 m_TickTimer = NULL;
592 OnGUI(false);
593 }
594
596 {
597 if (m_IsActive == false)
598 return;
599
600 const float MAX_RAYCAST_RANGE = 1000;
602 {
605
606 // Raycast
607 vector from = pos;
608 vector to = pos + (dir * MAX_RAYCAST_RANGE);
609 vector contact_pos;
610 vector contact_dir;
611 int contact_component;
612 set<Object> objects = new set<Object>;
613
614 if (DayZPhysics.RaycastRV(from, to, contact_pos, contact_dir, contact_component, objects, NULL, GetGame().GetPlayer()))
615 {
616 for ( int i = 0; i < objects.Count(); i++ )
617 {
618 Object obj = objects.Get(i);
619 if (obj && obj.IsInherited(DayZCreature))
620 {
621 m_bIsCaptureMode = false;
623 return;
624 }
625 }
626 }
627 }
628 }
629
633
635 {
636 InitDebugObject(obj);
637 if (GetGame().IsMultiplayer())
638 {
640 }
641 }
642
643 #ifdef _DAYZ_CREATURE_DEBUG_SHADOW
644 void GUIAction_CreateShadow()
645 {
646 auto shadowEntity = GetGame().CreateObject(m_sDebugEntityName, m_DebugEntity.GetPosition(), false, true);
647 m_DebugEntity.DebugSetShadow(shadowEntity);
648 }
649 #endif
650
652 {
653 m_DebugEntity.UpdateSimulationPrecision(simLOD);
654 }
655
657 {
659 if (GetGame().IsMultiplayer())
660 {
662 }
663 }
664
665 void GUIAction_SetValue(int index, string strVal)
666 {
667 switch (GetVariableType(index))
668 {
670 int intValue = strVal.ToInt();
671 if (GetGame().IsMultiplayer())
672 {
673 SyncSetValueInt(index, intValue);
674 }
675 else
676 {
677 SetValueInt(index, intValue);
678 }
679 break;
681 float floatValue = strVal.ToFloat();
682 if (GetGame().IsMultiplayer())
683 {
684 SyncSetValueFloat(index, floatValue);
685 }
686 else
687 {
688 SetValueFloat(index, floatValue);
689 }
690 break;
692 bool boolValue;
693 strVal.ToLower();
694 if (strVal.Contains("true"))
695 {
696 boolValue = true;
697 }
698 else if (strVal.Contains("false"))
699 {
700 boolValue = false;
701 }
702 else
703 {
704 boolValue = (bool)strVal.ToInt();
705 }
706
707 if (GetGame().IsMultiplayer())
708 {
709 SyncSetValueBool(index, boolValue);
710 }
711 else
712 {
713 SetValueBool(index, boolValue);
714 }
715 break;
716 }
717 }
718
719 void GUIAction_ActivateCommand(int commandIdx, int userInt, float userFloat)
720 {
721 if (GetGame().IsMultiplayer())
722 {
723 SyncActivateCommand(commandIdx, userInt, userFloat);
724 }
725 else
726 {
727 ActivateCommand(commandIdx, userInt, userFloat);
728 }
729
730 }
731
732 void GUIAction_EnableAI(bool enable)
733 {
734 if (GetGame().IsMultiplayer())
735 {
736 SyncEnableAI(enable);
737 }
738 else
739 {
740 EnableAI(enable);
741 }
742 }
743
747
749 {
750 int count = m_SyncMessages.Count();
751 if (count > 0)
752 {
753 Param1<int> paramCount = new Param1<int>(count);
754 m_SyncMessages.InsertAt(paramCount, 0);
755
756 GetGame().GetPlayer().RPC(ERPCs.DEV_RPC_PLUGIN_DZCREATURE_DEBUG, m_SyncMessages, true);
757
758 m_SyncMessages.Clear();
759 }
760 }
761
762 void OnRpc(PlayerBase player, int rpc_type, ParamsReadContext ctx)
763 {
764 if (rpc_type == ERPCs.DEV_RPC_PLUGIN_DZCREATURE_DEBUG)
765 {
767 }
768 }
769
771 {
772 Param1<int> count = new Param1<int>(0);
773
774 if (ctx.Read(count))
775 {
776 Param1<int> type = new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.COUNT);
777 for (int i=0; i < count.param1; ++i)
778 {
779 if (ctx.Read(type))
780 {
781 switch (type.param1)
782 {
783 case PluginDayZCreatureAIDebugSyncMessageType.INIT_DEBUG_OBJECT:
785 break;
786 case PluginDayZCreatureAIDebugSyncMessageType.RELEASE_DEBUG_OBJECT:
788 break;
789 case PluginDayZCreatureAIDebugSyncMessageType.SET_VALUE_INT:
791 break;
792 case PluginDayZCreatureAIDebugSyncMessageType.SET_VALUE_FLOAT:
794 break;
795 case PluginDayZCreatureAIDebugSyncMessageType.SET_VALUE_BOOL:
797 break;
798 case PluginDayZCreatureAIDebugSyncMessageType.ACTIVATE_COMMAND:
800 break;
801 case PluginDayZCreatureAIDebugSyncMessageType.ENABLE_AI:
803 break;
804 case PluginDayZCreatureAIDebugSyncMessageType.DISABLE_AI:
806 break;
807 }
808 }
809 type.param1 = PluginDayZCreatureAIDebugSyncMessageType.COUNT;
810 }
811 }
812 }
813
815 {
816 Param1<int> type = new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.INIT_DEBUG_OBJECT);
817 Param1<Object> object = new Param1<Object>(obj);
818
819 m_SyncMessages.Insert(type);
820 m_SyncMessages.Insert(object);
821 }
822
824 {
825 Param1<Object> object = new Param1<Object>(NULL);
826 if (ctx.Read(object))
827 {
828 InitDebugObject(object.param1);
829 }
830 }
831
833 {
834 Param1<int> type = new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.RELEASE_DEBUG_OBJECT);
835
836 m_SyncMessages.Insert(type);
837 }
838
840 {
842 }
843
844 void SyncSetValueInt(int index, int value)
845 {
846 Param1<int> type = new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.SET_VALUE_INT);
847 Param2<int, int> paramValue = new Param2<int, int>(index, value);
848
849 m_SyncMessages.Insert(type);
850 m_SyncMessages.Insert(paramValue);
851 }
852
854 {
855 Param2<int, int> paramValue = new Param2<int, int>(-1, 0);
856
857 if (ctx.Read(paramValue))
858 {
859 SetValueInt(paramValue.param1, paramValue.param2);
860 }
861 }
862
863 void SyncSetValueFloat(int index, float value)
864 {
865 Param1<int> type = new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.SET_VALUE_FLOAT);
866 Param2<int, float> paramValue = new Param2<int, float>(index, value);
867
868 m_SyncMessages.Insert(type);
869 m_SyncMessages.Insert(paramValue);
870 }
871
873 {
874 Param2<int, float> paramValue = new Param2<int, float>(-1, 0.0);
875
876 if (ctx.Read(paramValue))
877 {
878 SetValueFloat(paramValue.param1, paramValue.param2);
879 }
880 }
881
882 void SyncSetValueBool(int index, bool value)
883 {
884 Param1<int> type = new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.SET_VALUE_BOOL);
885 Param2<int, bool> paramValue = new Param2<int, bool>(index, value);
886
887 m_SyncMessages.Insert(type);
888 m_SyncMessages.Insert(paramValue);
889 }
890
892 {
893 Param2<int, bool> paramValue = new Param2<int, bool>(-1, false);
894
895 if (ctx.Read(paramValue))
896 {
897 SetValueBool(paramValue.param1, paramValue.param2);
898 }
899 }
900
901 void SyncActivateCommand(int commandIdx, int userInt, float userFloat)
902 {
903 Param1<int> type = new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.ACTIVATE_COMMAND);
904 Param3<int, int, float> command = new Param3<int, int, float>(commandIdx, userInt, userFloat);
905
906 m_SyncMessages.Insert(type);
907 m_SyncMessages.Insert(command);
908 }
909
911 {
912 Param3<int, int, float> command = new Param3<int, int, float>(-1, 0, 0.0);
913
914 if (ctx.Read(command))
915 {
916 ActivateCommand(command.param1, command.param2, command.param3);
917 }
918 }
919
920 void SyncEnableAI(bool enable)
921 {
922 Param1<int> type = new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.COUNT);
923 if (enable)
924 {
925 type.param1 = PluginDayZCreatureAIDebugSyncMessageType.ENABLE_AI;
926 }
927 else
928 {
929 type.param1 = PluginDayZCreatureAIDebugSyncMessageType.DISABLE_AI;
930 }
931
932 m_SyncMessages.Insert(type);
933 }
934
936 {
937 EnableAI(true);
938 }
939
941 {
942 EnableAI(false);
943 }
944}
class RecipeCacheData int
DayZCreatureAnimScriptDebugVarType
Definition DayZCreature.c:2
DayZCreatureAIConstants
@ COUNT
ERPCs
Definition ERPCs.c:2
bool m_IsActive
PlayerBase GetPlayer()
ref array< bool > m_SetCommandCheckStates
Param4< float, string, int, string > DayZCreatureAnimScriptDebugAnimEventData
class DayZCreatureAnimScriptDebug SET_VALUE_INT
ref DayZCreatureAnimScriptDebug m_EntityAnimDbg
string GetStrValueType(int index)
Param1< string > DayZCreatureAnimScriptDebugAnimPredictionData
class DayZCreatureAnimScriptDebug ACTIVATE_COMMAND
void SyncReceiveDisableAI(ParamsReadContext ctx)
void PluginDayZCreatureAIDebug()
class DayZCreatureAnimScriptDebug INIT_DEBUG_OBJECT
void GUIAction_ActivateCommand(int commandIdx, int userInt, float userFloat)
Param1< string > DayZCreatureAnimScriptDebugAnimTagData
bool m_bIsCaptureMode
void SyncSetValueBool(int index, bool value)
ref Timer m_TickTimer
void SendSyncMessages()
class DayZCreatureAnimScriptDebug SET_VALUE_BOOL
void OnRpc(PlayerBase player, int rpc_type, ParamsReadContext ctx)
string GetStrValue(int index)
class DayZCreatureAnimScriptDebug RELEASE_DEBUG_OBJECT
void SetDebugShowMode(int mode)
void SetValueInt(int index, int value)
void ActivateCommand(int commandIdx, int userInt, float userFloat)
void OnGUI_AnimEvents()
void ~PluginDayZCreatureAIDebug()
void GUIAction_InitDebugObject(Object obj)
void SyncSetValueInt(int index, int value)
bool m_bShowAnimEvents
void GUIAction_SetValue(int index, string strVal)
void CheckShowMode()
void OnGUI_BulkSet()
void SetValueFloat(int index, float value)
DayZCreatureAI m_DebugEntity
void EnableAI(bool enable)
void SetValueBool(int index, bool value)
void SyncInitDebugObject(Object obj)
class DayZCreatureAnimScriptDebug SET_VALUE_FLOAT
void SyncReceiveInitDebugObject(ParamsReadContext ctx)
class DayZCreatureAnimScriptDebug ENABLE_AI
class DayZCreatureAnimScriptDebug m_iDebugMenu
DayZCreatureAnimScriptDebugVarType GetVariableType(int index)
void ReleaseDebugObject()
void SyncEnableAI(bool enable)
bool m_bAIEnabled
void SyncReceiveReleaseDebugObject(ParamsReadContext ctx)
void OnGUI_VariablesEdit()
void SyncReceiveEnableAI(ParamsReadContext ctx)
void InitDebugObject(Object obj)
void OnGUI(bool show)
void SyncActivateCommand(int commandIdx, int userInt, float userFloat)
void OnGUI_CommandsEdit()
string m_sDebugEntityName
void SyncReceiveValueInt(ParamsReadContext ctx)
void OnGUI_Variables()
void GUIAction_UpdateSimulationPrecision(int simLOD)
void GUIAction_ReleaseDebugObject()
void OnGUI_AIControlEdit()
void SyncReceiveValueFloat(ParamsReadContext ctx)
void SyncReceiveMessage(ParamsReadContext ctx)
void SyncReleaseDebugObject()
ref array< ref Param > m_SyncMessages
ref array< bool > m_SetVariableCheckStates
void SyncReceiveValueBool(ParamsReadContext ctx)
void SyncReceiveActivateCommand(ParamsReadContext ctx)
void GUIAction_EnableAI(bool enable)
void SyncSetValueFloat(int index, float value)
class DayZCreatureAnimScriptDebug DISABLE_AI
class PresenceNotifierNoiseEvents windowPosX
dbgUI settings
const int mainPanelSizeX
const int margin
const int mainPanelSizeY
const int windowPosY
proto native Object CreateObject(string type, vector pos, bool create_local=false, bool init_ai=false, bool create_physics=true)
Creates object of certain type.
proto native DayZPlayer GetPlayer()
proto native bool IsMultiplayer()
proto native vector GetPointerDirection()
Returns the direction where the mouse points, from the camera view.
proto native vector GetCurrentCameraPosition()
do not process rotations !
Definition DayZAnimal.c:437
ref array< ref DayZCreatureAnimScriptDebugAnimTagData > m_AnimTags
void OnAnimationEvent(string evType, int userInt, string userString)
proto native int GetVariableInt(int index)
proto native float SetVariableFloat(int index, float value)
proto native int GetCommandCount()
proto native bool GetVariableBool(int index)
proto native void SetCreature(DayZCreature creature)
proto native int GetVariableType(int index)
proto native owned string GetVariableName(int index)
proto native int GetVariableCount()
ref array< ref DayZCreatureAnimScriptDebugAnimEventData > m_AnimEvents
proto native bool SetVariableBool(int index, bool value)
proto native int SetVariableInt(int index, int value)
proto native int GetCommandID(int index)
ref array< ref DayZCreatureAnimScriptDebugAnimPredictionData > m_AnimPredictions
proto native float GetVariableFloat(int index)
proto native void ActivateCommand(int index, int userInt, float userFloat)
proto native owned string GetCommandName(int index)
void OnAnimationPrediction(string predName)
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.
Definition DbgUI.c:60
Definition EnMath.c:7
ref Timer m_TickTimer
status refresh timer
void OnInit()
void OnDestroy()
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
proto bool Read(void value_in)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString()
proto native CGame GetGame()
static proto native void PushID_Int(int int_id)
static proto void Check(string label, out bool checked)
static proto native bool Button(string txt, int minWidth=0)
static proto native void Spacer(int height)
static proto void InputInt(string txt, out int value, int pxWidth=150)
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto void BeginCleanupScope()
static proto native void Text(string label)
static proto native void PopID()
static proto native void EndCleanupScope()
static proto void InputText(string txt, out string value, int pxWidth=150)
static proto native void End()
static proto native void PushID_Str(string str_id)
static proto native void Panel(string label, int width, int height, int color=0xaa555555)
static proto native void SameLine()
static proto int GetEngineValue(int id)
Get value at the given engine id.
static proto float Min(float x, float y)
Returns smaller of two given values.
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.
Definition EnString.c:396
proto native int ToInt()
Converts string to integer.
proto native float ToFloat()
Converts string to float.
bool Contains(string sample)
Returns true if sample is substring of string.
Definition EnString.c:286
proto int ToLower()
Changes string to lowercase. Returns length.
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.
proto native void OnUpdate()
Definition tools.c:338
proto native float GetWorldTime()