Debugging Console

This object is intended to help Multimedia Fusion users debug their programs.

Note that there is a version for MMF1.2 and MMF1.5. Make sure you get the correct version.

Details

Note there is a version for MMF1.2 and a version for MMF1.5. Make sure you download the correct version. If you download the wrong version, the Inspect Sprite action may crash. Download includes the extension, an example, and the source code. This extension is free software and open source.

This extension was not created under the request of anyone, but was a by-product of some programming I had done in Jamagic.

This extension was new in that it was the first object to aid with the debugging of Multimedia Fusion programs. It was, I think, quite unexpected. Whilst programming this project I had little in mind though of what it would be used for, and I added the debugging features afterwards.

I used MMF1.2 at the time, hence the support for MMF1.2. This is one of my only objects (the other being Spellcheck) which uses features which cause incompatibilities between MMF1.2 and MMF1.5.

Comments

The following are quotes about "Debugging Console":

"This handy object creates a console outside of the MMF window used to debug your application. You can output any numbers or strings you want to this console, and you can even have the console 'analyze' an active object, outputting anything from positions and directions to flags and alterable values. This object is a must have for anyone developing complex applications."

- Spatang Spot-light, 02.15.04

"This is a really useful object not for publishing your games and applications, but testing them. It creates a separate console window that you can output text to, or output the current values, movement settings, and direction of an active object to. It's a great help in figuring out what's going on with applications that seem to keep crashing randomly."

- Spatang List Information

"Ever noticed how some people aren't good at debugging their own code? Usually you'll see them asking a million questions on forums. MMF doesn't have a good debugger right now, but this handy object by Jack attempts to rectify this situation - get up-to-date object information with just a few extra actions in your code."

- Clickteam Extension List 24th March 2004 Featured Extension

"This object is super useful for debugging you application. It creates a dos window and it can display values, strings ,movement etc. It even can get input text from the user!"

- Extension Updater Program

Modifications

Herb improved the Debugging Console Object to include new features. It is recommended his improved version is used over my original version. Both versions of MMF are supported. His improvements are not open source, however. His version is named "Debugging Console Object v1.5".

Banjaxx created a stripped down version of Debugging Console named "DOS Console Object". This only supports MMF1.5.

Extension Developers

Extension Developers may also use the Debugging Console Objects to help debug their extensions whilst they are writing them. It is easy to force the object you are developing to write to the Debugging Console, if one exists in the frame. This allows debug messages to be printed out. Make sure you insert a debugging console object into your frame before you test, since it will not create one for you).

I've written the following two macros to do this:

#define DEBUGOUT(str) {unsigned long disregard; HANDLE la; la = GetStdHandle(STD_OUTPUT_HANDLE); WriteConsole( la , str , strlen(str) , &disregard , 0 );}

Which can be used as DEBUGOUT( "Hello!" ); and so forth.

If you prefer using the Standard C++ String Class, then the following macro will work:

#define DEBUGOUTSTD(str) {unsigned long disregard; HANDLE la; la = GetStdHandle(STD_OUTPUT_HANDLE); WriteConsole( la , ((std::string)(str)).c_str() , ((std::string)(str)).length() , &disregard , 0 );}

Which you can use as DEBUGOUTSTD( "Hello " + myName + ". How're you?" ); and so forth. If you use this method, remember #include <string>