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);
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);
20 proto native
int GetCommandCount();
21 proto native owned
string GetCommandName(
int index);
22 proto native
int GetCommandID(
int index);
24 proto native
void ActivateCommand(
int index,
int userInt,
float userFloat);
26 const int m_iMaxAnimEventsCount = 50;
33 void OnAnimationEventsStart()
35 m_AnimPredictions.Clear();
39 void OnAnimationEvent(
string evType,
int userInt,
string userString)
41 if (m_EventsFilter.Find(evType) != -1)
48 if (m_AnimEvents.Count() > m_iMaxAnimEventsCount)
50 m_AnimEvents.Remove(m_AnimEvents.Count() - 1);
54 void OnAnimationPrediction(
string predName)
59 void OnAnimationTag(
string tagName)
65 enum PluginDayZCreatureAIDebugSyncMessageType
129 if (!
GetGame().IsDedicatedServer())
142 strVal = valInt.ToString();
146 strVal = valFloat.ToString();
174 strValType =
"float";
202 for (
int idxVar = 0; idxVar < toAddCount; idxVar++)
211 for (
int idxCmd = 0; idxCmd < toAddCount; idxCmd++)
256 #ifdef DIAG_DEVELOPER
257 creatureAI.DebugRestoreAIControl();
262 #ifdef DIAG_DEVELOPER
263 creatureAI.DebugDisableAIControl();
277 for (
int i=0; i < varCount; i++)
279 DbgUI.BeginCleanupScope();
281 DbgUI.EndCleanupScope();
287 const int INPUT_BOX_SIZE = 35;
289 DbgUI.PushID_Str(
"VariablesEdit");
292 for (
int i=0; i < varCount; i++)
294 DbgUI.BeginCleanupScope();
299 DbgUI.Check(
"", result);
303 bool setButtonPressed =
DbgUI.Button(
"Set");
320 DbgUI.EndCleanupScope();
328 const int INPUT_BOX_SIZE = 35;
330 DbgUI.PushID_Str(
"CommandsEdit");
332 for (
int i=0; i < cmdCount; i++)
334 DbgUI.BeginCleanupScope();
339 DbgUI.Check(
"", result);
343 bool setButtonPressed =
DbgUI.Button(
"Set");
347 DbgUI.InputText(
"int", strUserInt, INPUT_BOX_SIZE);
351 DbgUI.InputText(
"float", strUserFloat, INPUT_BOX_SIZE);
363 DbgUI.EndCleanupScope();
371 bool buttonPressed =
false;
374 buttonPressed =
DbgUI.Button(
"Disable AI");
378 buttonPressed =
DbgUI.Button(
"Enable AI");
393 if (
DbgUI.Button(
"Bulk set"))
401 DbgUI.PushID_Str(
"AnimEvents");
403 const int panelMinSizeX = 350;
405 DbgUI.Panel(
"MinimumSize", panelMinSizeX, 1);
408 for (
int tagIdx = 0; tagIdx <
m_EntityAnimDbg.m_AnimTags.Count(); ++tagIdx)
416 string strPredictions;
417 for (
int predIdx = 0; predIdx <
m_EntityAnimDbg.m_AnimPredictions.Count(); ++predIdx)
420 strPredictions +=
", ";
425 DbgUI.PushID_Str(
"AnimTagsDisplay");
429 DbgUI.PushID_Str(
"AnimPredictionsDisplay");
430 DbgUI.Text(strPredictions);
434 DbgUI.InputText(
"Filter", strFilter, panelMinSizeX);
439 DbgUI.Button(
"TakeMyFocus");
441 const int evDisplayCount = 15;
444 for (
int evIdx = 0; evIdx < evToDisplayCount; ++evIdx)
446 DbgUI.PushID_Int(evIdx);
465 DbgUI.BeginCleanupScope();
473 DbgUI.Text(
"Capturing...");
477 if (
DbgUI.Button(
"Capture"))
484 DbgUI.Begin(
"CreatureAI EditMenu");
487 DbgUI.Begin(
"CreatureAI AnimEvents");
496 bool btnReleasePressed =
DbgUI.Button(
"Release");
501 #ifdef _DAYZ_CREATURE_DEBUG_SHADOW
502 if (!
GetGame().IsMultiplayer())
505 if (
DbgUI.Button(
"CreateShadow"))
507 GUIAction_CreateShadow();
512 if (!
GetGame().IsMultiplayer())
514 const int simLODInputSize = 20;
516 DbgUI.InputInt(
"SimLOD", simLOD, simLODInputSize);
518 if (
DbgUI.Button(
"UpdateSimulationPrecision"))
524 if (btnReleasePressed)
552 DbgUI.EndCleanupScope();
585 m_TickTimer.Run(0.1,
this,
"OnGUITimer", NULL,
true);
600 const float MAX_RAYCAST_RANGE = 1000;
608 vector to = pos + (dir * MAX_RAYCAST_RANGE);
611 int contact_component;
612 set<Object> objects =
new set<Object>;
616 for (
int i = 0; i < objects.Count(); i++ )
618 Object obj = objects.Get(i);
643 #ifdef _DAYZ_CREATURE_DEBUG_SHADOW
644 void GUIAction_CreateShadow()
670 int intValue = strVal.ToInt();
681 float floatValue = strVal.ToFloat();
694 if (strVal.Contains(
"true"))
698 else if (strVal.Contains(
"false"))
704 boolValue = (
bool)strVal.ToInt();
753 Param1<int> paramCount =
new Param1<int>(count);
764 if (rpc_type ==
ERPCs.DEV_RPC_PLUGIN_DZCREATURE_DEBUG)
772 Param1<int> count =
new Param1<int>(0);
776 Param1<int> type =
new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.COUNT);
777 for (
int i=0; i < count.param1; ++i)
783 case PluginDayZCreatureAIDebugSyncMessageType.INIT_DEBUG_OBJECT:
786 case PluginDayZCreatureAIDebugSyncMessageType.RELEASE_DEBUG_OBJECT:
789 case PluginDayZCreatureAIDebugSyncMessageType.SET_VALUE_INT:
792 case PluginDayZCreatureAIDebugSyncMessageType.SET_VALUE_FLOAT:
795 case PluginDayZCreatureAIDebugSyncMessageType.SET_VALUE_BOOL:
798 case PluginDayZCreatureAIDebugSyncMessageType.ACTIVATE_COMMAND:
801 case PluginDayZCreatureAIDebugSyncMessageType.ENABLE_AI:
804 case PluginDayZCreatureAIDebugSyncMessageType.DISABLE_AI:
809 type.param1 = PluginDayZCreatureAIDebugSyncMessageType.COUNT;
816 Param1<int> type =
new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.INIT_DEBUG_OBJECT);
817 Param1<Object>
object =
new Param1<Object>(obj);
825 Param1<Object>
object =
new Param1<Object>(NULL);
826 if (ctx.Read(
object))
834 Param1<int> type =
new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.RELEASE_DEBUG_OBJECT);
846 Param1<int> type =
new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.SET_VALUE_INT);
857 if (ctx.Read(paramValue))
865 Param1<int> type =
new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.SET_VALUE_FLOAT);
876 if (ctx.Read(paramValue))
884 Param1<int> type =
new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.SET_VALUE_BOOL);
895 if (ctx.Read(paramValue))
903 Param1<int> type =
new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.ACTIVATE_COMMAND);
914 if (ctx.Read(command))
922 Param1<int> type =
new Param1<int>(PluginDayZCreatureAIDebugSyncMessageType.COUNT);
925 type.param1 = PluginDayZCreatureAIDebugSyncMessageType.ENABLE_AI;
929 type.param1 = PluginDayZCreatureAIDebugSyncMessageType.DISABLE_AI;