armatech 8 Posted October 7, 2008 This is a simple system adding a simple way to debug scripts Adding armatec debug to your scripts (See example script folder) 1. Place the ArMaTeC DEBUG game logic on your map in the editor 2. Create a file named init.sqf and add in the following <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> //Enable debugArMaT_DEBUG_ENABLED = 1;3. Edit your scripts so that its outputting what debug info following are some example's or how to add the codeExample 1<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>[b]Code Sample[/b] </td></tr><tr><td id="CODE"> if (YOURDEBUGNAME)then {  res = ["Script Name","DEBUG INFOMATION"] call ArMaT_DEBUG; };Example 2<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>[b]Code Sample[/b] </td></tr><tr><td id="CODE"> while{true}do {  if (YOURDEBUGNAME)then  {  res = ["Script Name.sqf",format["DEBUG INFOMATION %1",getpos player]] call ArMaT_DEBUG;  }; sleep 1; };Exsample 3Debug with Admin only settingsThis is the init.sqf whre you difine the players who should see the ">>debug" action<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>[b]Code Sample[/b] </td></tr><tr><td id="CODE">//Check for debug addon_Settingspath = configFile >> "CfgPatches" >> "ArMaT_DEBUG";_ok = isClass (_Settingspath);if(_ok)then{//Secrity (Admin)ArMaT_DEBUG_AUTH = ["ArMaTeC(Predator)"];{if(format ["%1",_x] == format ["%1",(name player)])then{//Run Debugplayer sidechat "Debug mode";//Enable debugArMaT_DEBUG_ENABLED = 1;//Show system debugArMaT_DEBUGDEBUG_ENABLED = false;//used in debug exsampleYOURDEBUGNAME = true;}else{//Do what ever};}foreach ArMaT_DEBUG_AUTH;//End of Secrity};Exsample 4<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>[b]Code Sample[/b] </td></tr><tr><td id="CODE">[code]//Check for debug addon_Settingspath = configFile >> "CfgPatches" >> "ArMaT_DEBUG";_ok = isClass (_Settingspath);if(_ok)then{///////////////////////debug settings///////////////////////};4. if you have used a custom debug var e.g. YOURDEBUGNAME you need to add <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>[b]Code Sample[/b] </td></tr><tr><td id="CODE"> YOURDEBUGNAME = true; 5. Run the mission and click the ">>Debug" button.To load some default debug info created just to test out the debugger<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>[b]Code Sample[/b] </td></tr><tr><td id="CODE">_x = 4;//Ammount of debug 3[_x]call ARMATECDEFAULTDATA;Inside the download you will find a example mission and the debug addonEnjoyUpdated to 1.1Corrected ">>Debug" option so that it shows in all vehicles[Download] Share this post Link to post Share on other sites
i0n0s 0 Posted October 7, 2008 Hi, may you add to a link to a non scaled version of that image so that we're able to see the details? Does this works for non local scripts? For example when debugging a multiplayer mission where a script runs only on the server. Why there is a delay between pressing a button and the action of that button? This was a little disturbing while testing that addon. Nice work thanks! Share this post Link to post Share on other sites
big 0 Posted October 7, 2008 Armaholic mirror and news: - DEBUG System Share this post Link to post Share on other sites
armatech 8 Posted October 7, 2008 Hi,may you add to a link to a non scaled version of that image so that we're able to see the details? Does this works for non local scripts? For example when debugging a multiplayer mission where a script runs only on the server. Why there is a delay between pressing a button and the action of that button? This was a little disturbing while testing that addon. Nice work thanks! Â have ot added that yet as i didnt need it you could just have a <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">publicVariable "ArMaT_DEBUG_ARRAY"; in your scripts Share this post Link to post Share on other sites
Stavanger 0 Posted October 7, 2008 Mirror by ePrison.de DEBUG System 1.0 by ArMaTeC good work and Regards, Stavanger Share this post Link to post Share on other sites
armatech 8 Posted October 8, 2008 Thanks for the mirrors Share this post Link to post Share on other sites
vipermaul 246 Posted October 8, 2008 This is a GREAT start!! I think we will start using it. I am looking forward to this debug system that allows server-side debug messages to be displayed in the dialog and also remain there when a dev guy JIP's in to look at the debug of a currently running MP session. Also a way to add mission-friendly action menu ">>Debug" only available to those players in an arrary, (e.g. dev_authorized_arrary). mission-friendly means one that stays available when you enter a vehicle or parachute without overwriting other mission designer action menus. I have yet to see any debug system do that. Â Spooner's comes close. Share this post Link to post Share on other sites
armatech 8 Posted October 9, 2008 For mp scerity try this init.sqf <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> //Check for debug addon _Settingspath = configFile >> "CfgPatches" >> "ArMaT_DEBUG"; _ok = isClass (_Settingspath); if(_ok)then{ //Secrity (Admin) ArMaT_DEBUG_AUTH = ["ArMaTeC(Predator)"]; { if(format ["%1",_x] == format ["%1",(name player)])then { //Run Debug player sidechat "Debug mode"; //Enable debug ArMaT_DEBUG_ENABLED = 1; //Show system debug ArMaT_DEBUGDEBUG_ENABLED = false; //used in debug exsample YOURDEBUGNAME = true; }else{ //Do what ever }; }foreach ArMaT_DEBUG_AUTH; //End of Secrity }; Share this post Link to post Share on other sites
armatech 8 Posted October 9, 2008 updated to 1.1 Fixed the action it will now show at all times if enabled Share this post Link to post Share on other sites
big 0 Posted October 9, 2008 Armaholic mirror updated: - DEBUG System v1.1 Share this post Link to post Share on other sites