Enfusion Script API
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
Debug Interface Reference

Static Public Member Functions

static proto void DumpStack (out string output=string.Empty)
 Prints current call stack (stack trace).
 
static proto void DumpInstances (bool csvFormatting)
 Dump all allocated script objects with callstack of its allocation into output/log.
 
static proto void Error2 (string title, string err)
 Dialog box with error message.
 
static proto void Error (string err)
 Dialog box with error message.
 
static proto void BeginTimeMeasure ()
 Starts measuring time until EndTimeMeasure() is called.
 
static proto void EndTimeMeasure (string title)
 Ends time measurement which began with last BeginTimeMeasure() call.
 
static proto void DPrint (string var)
 Prints content of variable to console/log. Should be used for critical messages so it will appear in debug log.
 
static proto void Break (bool condition=true, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
 
static proto void CompileBreak ()
 
static proto int KeyState (KeyCode key)
 Gets key state.
 
static proto int GetMouseState (MouseState index)
 Returns state of mouse button.
 
static proto void ClearKey (KeyCode key)
 Clears the key state.
 

Static Public Attributes

const int MB_PRESSED_MASK = 0x80000000
 

Member Function Documentation

◆ BeginTimeMeasure()

static proto void Debug.BeginTimeMeasure ( )
static

Starts measuring time until EndTimeMeasure() is called.

◆ Break()

static proto void Debug.Break ( bool  condition = true,
void  param1 = NULL,
void  param2 = NULL,
void  param3 = NULL,
void  param4 = NULL,
void  param5 = NULL,
void  param6 = NULL,
void  param7 = NULL,
void  param8 = NULL,
void  param9 = NULL 
)
static
Warning
Internal function for native (C++) code developers.

◆ ClearKey()

static proto void Debug.ClearKey ( KeyCode  key)
static

Clears the key state.

Call this function if you want to overcome autorepeating in reporting key state. If called, the KeyState returns pressed only after the key is released and pressed again.

◆ CompileBreak()

static proto void Debug.CompileBreak ( )
static
Warning
Internal function for native (C++) code developers.

◆ DPrint()

static proto void Debug.DPrint ( string  var)
static

Prints content of variable to console/log. Should be used for critical messages so it will appear in debug log.

◆ DumpInstances()

static proto void Debug.DumpInstances ( bool  csvFormatting)
static

Dump all allocated script objects with callstack of its allocation into output/log.

This can only be used together with -checkInstance CLI param.

◆ DumpStack()

static proto void Debug.DumpStack ( out string  output = string.Empty)
static

Prints current call stack (stack trace).

Call stack is printed to log or to 'output' variable if argument is used.

Parameters
outputoptional argument to get call stack to string variable instead of output
Debug.DumpStack(); // print stack to log
string text;
Debug.DumpStack(text); // print stack to 'text' variable
Definition: Debug.c:13
static proto void DumpStack(out string output=string.Empty)
Prints current call stack (stack trace).

Output:

    -- Stack trace --
     SaveFile() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler.c : 51
     SaveConfigToFile() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler\ModuleLocalProfile.c : 114
     SaveParameterArray() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler\ModuleLocalProfile.c : 133
     SetParameterArray() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler\ModuleLocalProfile.c : 231
     PresetAdd() Scripts\Entities\Modules\ModuleBase\ModuleFileHandler\ModuleLocalProfile\ModuleLocalProfileUI.h : 46
     OnKeyPress() Scripts/mission/missionGameplay.c : 215
     OnKeyPress() Scripts/DayZGame.c : 334
     -----------------

◆ EndTimeMeasure()

static proto void Debug.EndTimeMeasure ( string  title)
static

Ends time measurement which began with last BeginTimeMeasure() call.

◆ Error()

static proto void Debug.Error ( string  err)
static

Dialog box with error message.

◆ Error2()

static proto void Debug.Error2 ( string  title,
string  err 
)
static

Dialog box with error message.

◆ GetMouseState()

static proto int Debug.GetMouseState ( MouseState  index)
static

Returns state of mouse button.

It's combination of number of release/pressed edges and mask Debug.MB_PRESSED_MASK that is set when button is pressed. If you want just to check if button is pressed, use:

Print("left button pressed");
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
MouseState
Definition: MouseState.c:13
const int MB_PRESSED_MASK
Definition: Debug.c:17
static proto int GetMouseState(MouseState index)
Returns state of mouse button.

◆ KeyState()

static proto int Debug.KeyState ( KeyCode  key)
static

Gets key state.

Parameters
keyKey code.
Returns
0 when not pressed, Bit 15 is set when pressed, bits 0-14 contain count of presses.

Member Data Documentation

◆ MB_PRESSED_MASK

const int Debug.MB_PRESSED_MASK = 0x80000000
static

The documentation for this interface was generated from the following file: