Jump to content
Sign in to follow this  
armatech

ArMaTeC DEBUG System 1.0

Recommended Posts

This is a simple system adding a simple way to debug scripts

image.png

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 debug

ArMaT_DEBUG_ENABLED = 1;

3. Edit your scripts so that its outputting what debug info following are some example's or how to add the code

Example 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 3

Debug with Admin only settings

This 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 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

};

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 addon

Enjoy

Updated to 1.1

Corrected ">>Debug" option so that it shows in all vehicles

[Download]

Share this post


Link to post
Share on other sites

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! smile_o.gif

Share this post


Link to post
Share on other sites
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!  smile_o.gif

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

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

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×