<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<script type="text/javascript" language="JavaScript">
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
origWidth = innerWidth;
origHeight = innerHeight;
onresize = reDo;
}
onerror = null;
</script>
<style type="text/css">
< !-- div.WebHelpPopupMenu {
position: absolute;
left: 0px;
top: 0px;
z-index: 4;
visibility: hidden;
}
p.WebHelpNavBar {
text-align: right;
}
-->
</style>
<script type="text/javascript">
gRootRelPath = "../../..";
gCommonRootRelPath = "../../..";
gTopicId = "9.2.20.0_2";
<script type="text/javascript" src="../../../template/scripts/rh.min.js"></script>
<script type="text/javascript" src="../../../template/scripts/common.min.js"></script>
<script type="text/javascript" src="../../../template/scripts/topic.min.js"></script>
<script type="text/javascript" src="../../../template/scripts/topicwidgets.min.js"></script>
<script type="text/javascript" src="../../../whxdata/projectsettings.js"></script>
<link rel="stylesheet" type="text/css" href="../../../template/styles/topic.min.css"/>
<link rel="stylesheet" type="text/css" href="../../../template/Charcoal_Grey/topicheader.css"/>
<meta name="topic-status" content="Draft"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>debug_event</title>
<meta name="generator" content="Adobe RoboHelp 2019"/>
<link rel="stylesheet" href="../../../assets/css/default.css" type="text/css"/>
<meta name="rh-authors" content="Mark Alexander"/>
<meta name="topic-comment" content="Reference page for debug_event"/>
<meta name="rh-index-keywords" content="debug_event"/>
<meta name="search-keywords" content="debug_event"/>
</head>
<body>
<div class="topic-header rh-hide" id="rh-topic-header" onclick="rh._.goToFullLayout()">
<div class="logo">
</div>
<div class="nav">
<div class="title" title="debug_event">
<span>debug_event</span>
</div>
<div class="gotohome" title="Click here to see this page in full context">
<span>Click here to see this page in full context</span>
</div>
</div>
</div>
<div class="topic-header-shadow rh-hide" id="rh-topic-header-shadow"></div>
<h1>debug_event</h1>
<p>This function generates a custom debug event that will be shown in the Graph View of the debugger when a game is being run in <a href="../../../Introduction/Debugging.htm">Debug Mode</a>. If you require messages to be displayed when <i>not</i> in debug
mode, then you should be using <a href="show_debug_message.htm"><tt>show_debug_message()</tt></a>. It is worth noting that the function will also take two reserved strings to help perform debugging using external applications like Visual Studio. These
strings are:</p>
<ul class="colour">
<li>"<tt>OutputDebugOn</tt>" - This enables a call to <tt>OutputDebugString</tt> for the <b>Windows</b> target, which means that all debug output - everything you see in the Output window - can be viewed by Visual Studio or by 3rd party apps.</li>
<li>"<tt>BreakOnError</tt>" - This option is for <b>Windows YYC</b> builds only, and means that projects will <i>not</i> display the usual code error screen if the runtime detects an error, but instead just carry on and crash. This allows you
to see the stacktrace within Visual Studio if debugging.</li>
</ul>
<p> </p>
<h4>Syntax:</h4>
<p class="code">debug_event(string)</p>
<table>
<tbody>
<tr>
<th>Argument</th>
<th>Description</th>
</tr>
<tr>
<td>string</td>
<td>The custom debug event string to use.</td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code">N/A</p>
<p> </p>
<h4><b>Example:</b></h4>
<p class="code">if !surface_exists(global.EffectsSurface)<br/> {
<br/> debug_event("Recreating Effects Surface");<br/> global.EffectsSurface = surface_create(room_width, room_height);<br/> }</p>
<p>The above code checks to see if an surface exists and if it does not, a debug event is triggered in the graph view of the debugger (the game must have been run in Debug Mode for this to be visible) and the surface is recreated.</p>
<p> </p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="Debugging.htm">Debugging</a></div>
<div style="float:right">Next: <a href="debug_get_callstack.htm">debug_get_callstack</a></div>
</div>
</div>
<h5>© Copyright YoYo Games Ltd. 2020 All Rights Reserved</h5>
</div>
</body></html>