Debug
A set of debugging and error-handling functions for mod development with Ikarus.
Initialization
The best way to initialize all Ikarus functions is to call MEM_InitAll()
in the Init_Global()
initialization function.
Warning
If you want to use Ikarus in Gothic 1, it is best to define your own Init_Global()
function and call it from every world initialization function.
Implementation
Functions
MEM_CheckVersion
Checks if the version of Ikarus is the specified version or newer.
var int base
Base version numbervar int major
Major revision numbervar int minor
Minor revision number
Return value
The function returns TRUE
if the version of Ikarus is the specified version or newer, FALSE
is returned otherwise.
MEM_SetShowDebug
Sets the variable that is also toggled by the toggle debug
command. As a result, messages outputted by PrintDebug
are directed to the zSpy
var int on
Specifies whether to turn on (TRUE
) or off (FALSE
) debug information.
MEM_SendToSpy
Sends a message to the debugging console.
var int errorType
Type of error (e.g.,zERR_TYPE_FAULT
,zERR_TYPE_WARN
,zERR_TYPE_INFO
)var string text
The message to be sent.
MEM_ErrorBox
Displays an error message in a message box.
var string text
The error message to be displayed.
MEM_PrintStackTrace
Prints the stack trace.
MEM_Error
Handles a fatal error, displaying the error message and printing the stack trace.
var string error
The error message.
MEM_Warn
Handles a warning, displaying the warning message and printing the stack trace.
var string warn
The warning message.
MEM_Info
Handles an information message, printing it if enabled in the settings.
var string info
The information message.
MEM_AssertFail
Handles an assertion failure, reporting the error message as a fatal error.
var string assertFailText
The assertion failure message.
MEM_Debug
Freely configurable debug channel. See how to setup it in the Constants article.
var string message
The debug message.
MEMINT_SwitchG1G2
Switches between values based on the game version. Used mainly to change addresses in multi-platform hooks or function calls.
var int g1Val
The value to return if the game version is Gothic 1.var int g2Val
The value to return if the game version is Gothic 2.
Return value
The function returns an appropriate value based on the game version.