


<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://bitfighter.org/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://bitfighter.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Debugging_Tips</id>
		<title>Debugging Tips - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://bitfighter.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Debugging_Tips"/>
		<link rel="alternate" type="text/html" href="http://bitfighter.org/wiki/index.php?title=Debugging_Tips&amp;action=history"/>
		<updated>2026-12-03T20:43:03Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.15</generator>

	<entry>
		<id>http://bitfighter.org/wiki/index.php?title=Debugging_Tips&amp;diff=5203&amp;oldid=prev</id>
		<title>Kaen at 00:19, 3 August 2013</title>
		<link rel="alternate" type="text/html" href="http://bitfighter.org/wiki/index.php?title=Debugging_Tips&amp;diff=5203&amp;oldid=prev"/>
				<updated>2013-08-03T00:19:49Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 00:19, 3 August 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;assert(target, &amp;quot;Target should never be nil here!&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;assert(target, &amp;quot;Target should never be nil here!&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Scripting]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kaen</name></author>	</entry>

	<entry>
		<id>http://bitfighter.org/wiki/index.php?title=Debugging_Tips&amp;diff=5202&amp;oldid=prev</id>
		<title>Kaen: Created page with &quot;Any of your scripts can print a stack trace with the &lt;code&gt;_stackTracer()&lt;/code&gt; command (see sample usage below). This will show how you got to a particular execution point, ...&quot;</title>
		<link rel="alternate" type="text/html" href="http://bitfighter.org/wiki/index.php?title=Debugging_Tips&amp;diff=5202&amp;oldid=prev"/>
				<updated>2013-08-03T00:19:13Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;Any of your scripts can print a stack trace with the &amp;lt;code&amp;gt;_stackTracer()&amp;lt;/code&amp;gt; command (see sample usage below). This will show how you got to a particular execution point, ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Any of your scripts can print a stack trace with the &amp;lt;code&amp;gt;_stackTracer()&amp;lt;/code&amp;gt; command (see sample usage below). This will show how you got to a particular execution point, and will print the values of various variables and other potentially useful information. This can be very helpful if there are several conditions under which a function can be called, or why something went wrong.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;print(msg)&amp;lt;/code&amp;gt; command will print a message the in-game console (which you can turn on with ctrl+/), and &amp;lt;code&amp;gt;logprint(msg)&amp;lt;/code&amp;gt; will print a message to the console, the terminal, and the Bitfighter logfile.&lt;br /&gt;
&lt;br /&gt;
Lua's error command will stop the script, print a message, and cause a stack trace to be printed. Use assert to confirm that a condition is true.&lt;br /&gt;
&lt;br /&gt;
Finally, if you detect an unexpected error condition, you can log a message, trigger a stack trace, and terminate the script with Lua's error function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
logprint(&amp;quot;Here's a stack trace:&amp;quot;)&lt;br /&gt;
logprint(_stackTracer())&lt;br /&gt;
if target == nil then error(&amp;quot;Have a nil target!&amp;quot;) end&lt;br /&gt;
assert(target, &amp;quot;Target should never be nil here!&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kaen</name></author>	</entry>

	</feed>