Axe Cop Posted December 29, 2013 Report Share Posted December 29, 2013 (edited) I could not find any ArmA2 debug tool that worked with Epoch so I developed my own little script and dialog to do just some simple things like execute SQF code on the fly (client and server side via custom remote execution). Also I have added my own little extension (DLL) for remote logging to a separate window on the server, so essentially if you want to log some debug info it pops up in that window and not in the RPT file. That logging extension is optional of course but i use it for debgging myself, not on the live server. Is there any interest in tools like this? I can publish my stuff if any admin or script/mod developer may need something like this.. :) Here a simple screenshot what the debug dialog looks like atm: you can enter any valid SQF script code in the large text field and then execute it locally on the client or via remote execution on the server, the result of the code is displayed in the lower text field (also the result of remote exec), just to simplify it so you won't have to add a log call or "hint str (1+2+3)" instead of just call "1+2+3" or whatever (and yes you can use this as a calculator lol) some screenshots of the remote log: I've just added a simple log filter at the bottom, so you are able to filter the log entries to match a specified text in real time. the number in the bottom right cornor means 9 log entries filters out of 26 log entries overall. this ain't pretty but might help with script debugging a lot. the code to log something in this example is pretty simple: format["Refueling %1 with %2 fuel",_name,_fuel] call DT_fnc_log; this is called in my service point refuel script, just as an example how it can be used (keep in mind the refuel script is client side and the log window on the server). :) Download: http://dl.bintray.com/vos/dayz/ArmaDebugTool1.0.zip Installation Script Console copy the files RscDebugDialog.hpp and debug.sqf to your MPMission folder/PBO open your description.ext file and include the debug dialog at the end of the file like this: #include "RscDebugDialog.hpp" execute the debug.sqf from your init.sqf (at the very bottom it needs to be executed on the client and server) execVM "debug.sqf"; you can open the debug console by invoking the function DT_fnc_openDialog yourself or by default just press the minus key on the numpad to open it if you are in-game (key can be changed with DT_openKey variable in the debug.sqf file) call DT_fnc_openDialog; you can now use the debug console in game, be aware the custom remote execution on the server might be tricky if you leave BattlEye enabled because many script values are just blacklisted in the publicvariableval.txt filter file, also you need to add BattlEye exceptions for publicvariable.txt: !="DT_logMessage" !="DT_remoteExec" I suggest to just disable BattlEye if you want to make use of the remote execution, since this script is only intended for use on a test server anyway ond not for a live server! If you want to use this on a live server make sure only admins have access to the script console! :P Installation Remote Log Extension (optional) If you want to use the external log window in combination with my log command DT_fnc_log you need to install the extension first. By default the log window is displayed on the server only, it can be used on the client but on the server makes more sense I think. The following steps are only server side! copy the files jni.dll, jni.conf and ArmaDebugTool.jar in your ArmA:OA installation directory (next to Database.dll and the other Epoch files) since the extension is written in Java you need to install a 32-bit (x86) Java 7 Runtime Environment (JRE), if you don't already have that on your server open the jni.conf and change the JAVA_HOME path to your JRE installation if necessary that should be all, you can now use the DT_fnc_log function on the client or server and it should open a separate window with the first log call. e.g. "log text" call DT_fnc_log; (position player) call DT_fnc_log; // on the client (count vehicles) call DT_fnc_log; // server or client or whatever you want to log, string conversion is done automatically so you can log any value or object. If there are any problems with calling the ArmaDebugTool.jar or Java-VM there should be a jni.log file next to the jni.dll with error information in it. Also for performance reasons the log window is limited to 1000 log entries, it will remove the oldest one from the top if you log more messages. References The Java Extension for Arma 3 (jni.dll) was created by micovery: http://forums.bistudio.com/showthread.php?167749-Java-Extension-for-Arma-3-(jni-dll) Source code for my debug scripts: https://github.com/vos/dayz/tree/master/debug Source code for the log extension (ArmaDebugTool.jar): https://github.com/vos/ArmaDebugTool Edited December 31, 2013 by Axe Cop 31_D!4b10, axeman and Judge Bread 3 Link to comment Share on other sites More sharing options...
Judge Bread Posted December 30, 2013 Report Share Posted December 30, 2013 This does sound useful especially when testing scripts. Especially the server side logger as I find it tedious to constantly have to log into my FTP, download the file, find the error in the 1000s of lines of error that are already spat out on a Taviana server. I would really appreciate such a tool even if you don't publish it a PM with the tool attached would be great :) Link to comment Share on other sites More sharing options...
Axe Cop Posted December 30, 2013 Author Report Share Posted December 30, 2013 hey, I might publish it later today.. the "problem" is not that I don't want to publish it here but I have to write some instructions and clean up the code a little and stuff like that you know. :p if you know what you are doing you can try it yourself, the code for the script console and log functions are already available in my GitHub repository: https://github.com/vos/dayz/tree/master/debug The log extension itself will follow later, since I only have a very simple prototype for that. :D Link to comment Share on other sites More sharing options...
Judge Bread Posted December 30, 2013 Report Share Posted December 30, 2013 Thank you I shall have a look when I get a chance. Plus look forward to the "polished" version. Link to comment Share on other sites More sharing options...
Torndeco Posted December 30, 2013 Report Share Posted December 30, 2013 V.Nice axecop will help reduce time spent testing code.. Always annoying have to restart server + client to test code when u made a mistake. Link to comment Share on other sites More sharing options...
Axe Cop Posted December 30, 2013 Author Report Share Posted December 30, 2013 added some screenshots of the remote log extension and a simple example on how to use it. code and instructions will follow soon :) btw the log window could also be displayed on the client instead of the server, but this way you can log things from anywhere no matter if the script is running on the client or server. if you don't have access to the server that might be a solution, but this is intended for a test server anyway. Link to comment Share on other sites More sharing options...
Axe Cop Posted December 31, 2013 Author Report Share Posted December 31, 2013 Release version 1.0 with download and install instructions in the original post. :) Link to comment Share on other sites More sharing options...
Sandbird Posted January 1, 2014 Report Share Posted January 1, 2014 awesome :) Thanks Axe for that. Link to comment Share on other sites More sharing options...
ruubje11 Posted January 16, 2014 Report Share Posted January 16, 2014 You are a genious! Thank you very much for releasing this! Link to comment Share on other sites More sharing options...