This new debug console extension v2.0 does pretty much what the version 1.0 does. The main difference is you do not need to spawn call it, you can call it directly from anywhere in your script. It will immediately return upon call so that your current script thread resumes as soon as possible. This is because the multi-threading is handled inside .dll.

As a result it takes about 0.23 seconds to call debug console 100000 times. This is very much the time it takes to call some simple function with call command inside SQF script. In addition, because there is no spawn command and artificial delay involved, the time it takes for actual console to output 100000 lines is about 20 seconds, a massive improvement on previous version which took several minutes (not that you ever need it).

Other changes

  • Console screen buffer in v2.0 is 10000 lines
  • New command added. Sending “C” will clear the screen
  • v2.0 does not return anything unlike v1.0 returning buffer size

You can still use preprocessor, but mostly for convenience now. Can be pretty handy if you want to output different colour lines but can’t be bothered adding hash ending each time.

//define macros #define conred(MSG) "debug_console" callExtension (MSG + "#1000") #define congreen(MSG) "debug_console" callExtension (MSG + "#0100") #define conblue(MSG) "debug_console" callExtension (MSG + "#0010") //use macros conred("This line is Red"); congreen("This line is Green"); conblue("This line is Blue");

dc2

The following example will stream all objects found in 30000 Km radius of player position (166000+ on Stratis) and double beep when finished.

{ "debug_console" callExtension format [ "Object #%1: %2 %3", _forEachIndex, _x, typeOf _x ]; } forEach nearestObjects [player, [], 30000000]; "debug_console" callExtension "A"; "debug_console" callExtension "A"; "debug_console" callExtension "FINISHED! #1000";

dc22

Download

EDIT: V2.1 is available now. Optimised for large inputs. Before it took several seconds for the large output to get displayed in the console (silly me and my RegEx obsession). Now you can chuck big chunks of data at the console, it will eat it all happily :)

EDIT: V2.11 is available now. Fixed colour, so that it would reset to default when no colour is set.

EDIT: I have recompiled the dll with VS 2013 and tested on my old WinXP machine. While I couldn’t make it to work with previous versions, this one runs fine, provided you also install Visual C++ Redistributable for Visual Studio 2013. It can be found on Microsoft website. I used x86 version for my WinXP machine. Hence the version change to V2.13.

KK’s Debug Console v2.13

Enjoy,
KK

And now V3.0 is available