Debug Console – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "[[server.cfg#" to "[[Arma 3: Server Config File#")
 
(34 intermediate revisions by 5 users not shown)
Line 1: Line 1:
For [[Take On Helicopters]] see [[Mission Editor: Debug Console (Take On Helicopters)]]
{{TOC|side}}
{{GVI|arma3|0.54}}
The '''Debug Console''' is an editing tool that provides scenario designers with the ability to observe variables and to execute code on the fly.


{{GVI|Arma 3|0.54}}
[[File:A3 console mission.jpg|thumb|Debug Console in pause menu]]
[[File:A3 console editor.jpg|thumb|Debug Console in editor]]
[[File:debug_console_history.jpg|thumb|Debug Console History (10 slots, accessible via {{Controls|Page Up}} and {{Controls|Page Down}})]]


Debug Console is an editing tool giving designer ability to check various states and execute custom code on the fly.


[[File:A3 console mission.jpg|thumb|Debug Console in pause menu]]
== Access ==
[[File:A3 console editor.jpg|thumb|Debug Console in editor]]
=== Access ===


While playing a mission from the editor, the console is immediately available in pause menu. In old [[2D Editor]] map screen, you can open in by clicking on "Debug Console" button or using <tt>Ctrl+D</tt> shortcut. In Eden editor it is available under <tt>Tools -> Debug Console</tt>.  
While playing a mission from the editor, the console is immediately available in pause menu. In the old [[2D Editor]] map screen, you can open it by clicking the "Debug Console" button or with {{Controls|Ctrl|D}}. In Eden editor it is available under {{hl|Tools > Debug Console}}.
<br><br>
<br><br>
In multiplayer the debug console is available by default only when MP preview is started from [[Eden Editor]], and is only available to the host who started it. In all other cases debug console needs to be explicitly enabled with either editor attribute or ''enableDebugConsole'' param (see below). It is worth noting that when debug console is configured for admin access, it is only available for [[server.cfg#Logged_In_Admin|logged in]] admin, [[server.cfg#Voted_In_Admin|voted in]] admin is treated just like any other user in this respect.
In multiplayer the debug console is available by default only when MP preview is started from [[:Category:Eden Editor|Eden Editor]], and is only available to the host who started it. In all other cases debug console needs to be explicitly enabled with either editor attribute or ''enableDebugConsole'' param (see below). It is worth noting that when debug console is configured for admin access, it is only available for [[Arma 3: Server Config File#Logged_In_Admin|logged in]] admin, [[Arma 3: Server Config File#Voted_In_Admin|voted in]] admin is treated just like any other user in this respect.


=== Configuration ===
The console is automatically available in missions running from editor. If mission designer wishes to enable it elsewhere, he can achieve it in one of the 3 ways:


* Using mission config param. You can add ''"\a3\functions_f\Params\paramDebugConsole.hpp"'' [[Arma 3 Mission Parameters|mission parameter]], where server host / admin can choose whether or not he'll allow debug console.
== Configuration ==
* Using following [[Description.ext]] param, for example:
<syntaxhighlight lang=cpp>enableDebugConsole = 1;</syntaxhighlight>
<blockquote><u>Possible values</u>:<br>0 - Default behavior, available only in editor<br>1 - Available in SP and for hosts / logged in admins in MP<br>2 - Available for everyone</blockquote>
* Using Eden attribute <tt>Debug Console</tt>, available in <tt>Attributes -> General -> States -> Debug Console</tt>
* Using global/mod config param, for example:
<syntaxhighlight lang=cpp>enableDebugConsole = 2;</syntaxhighlight>


==== Whitelisting Multiple Users ====
The console is automatically available in missions running from editor. If mission designer wishes to enable it elsewhere, he can achieve it in one of the three ways:
Since {{GVI|arma3|1.71}} it is possible to let more than 1 person access debug console in Multiplayer. This is done by defining <tt>enableDebugConsole</tt> param as [[Array]] and adding UIDs of whitelisted users to this array, for example:
 
<syntaxhighlight lang=cpp>enableDebugConsole[] = {"81273982178973213", "3749832749732749", "7492374983274234"};</syntaxhighlight>
* Using mission config param. You can add ''"\a3\functions_f\Params\paramDebugConsole.hpp"'' [[Mission Parameters|mission parameter]], where server host / admin can choose whether or not he'll allow debug console.
* Using following [[Description.ext]] param, for example: <syntaxhighlight lang="cpp">enableDebugConsole = 1;</syntaxhighlight>Possible values:
** 0 - Default behavior, available only in editor
** 1 - Available in SP and for hosts / logged in admins in MP
** 2 - Available for everyone</blockquote>
* Using Eden attribute {{hl|Debug Console}}, available in {{hl|Attributes > General > States > Debug Console}}
* Using global/mod config param, for example: <syntaxhighlight lang="cpp">enableDebugConsole = 2;</syntaxhighlight>
 
=== Whitelisting Multiple Users ===
 
Since {{GVI|arma3|1.72}} it is possible to let more than one person access debug console in Multiplayer. This is done by defining {{hl|enableDebugConsole}} param as [[Array]] and adding UIDs of whitelisted users to this array, for example:
<syntaxhighlight lang="cpp">enableDebugConsole[] = {"81273982178973213", "3749832749732749", "7492374983274234"};</syntaxhighlight>
All users with UIDs matching the added UIDs will be able to access debug console in Multiplayer. Additionally, server host will also be able to use debug console, as well as any logged in admin on dedicated server.
All users with UIDs matching the added UIDs will be able to access debug console in Multiplayer. Additionally, server host will also be able to use debug console, as well as any logged in admin on dedicated server.


==== Mod support ====
=== Mod support ===
Since {{GVI|arma3|1.71}} it is possible to configure debug console availability with a mod param <tt>enableDebugConsole</tt>. This param is checked if no debug console option is set in the mission. If a server admin would like to make debug console available for a group of trusted people, he can create a custom mod, for example with:  
 
<syntaxhighlight lang=cpp>enableDebugConsole = 2;</syntaxhighlight>
Since {{GVI|arma3|1.72}} it is possible to configure debug console availability with a mod param {{hl|enableDebugConsole}}. This param is checked if no debug console option is set in the mission. If a server admin would like to make debug console available for a group of trusted people, he can create a custom mod, for example with:
<syntaxhighlight lang="cpp">enableDebugConsole = 2;</syntaxhighlight>
Then sign it and distribute between trusted people. This way anyone who has this custom mod signed with correct signature, will be able to connect to the server and use debug console. Array of UIDs is also supported here.
Then sign it and distribute between trusted people. This way anyone who has this custom mod signed with correct signature, will be able to connect to the server and use debug console. Array of UIDs is also supported here.


To whitelist (multiple) users with a mod, if ''enableDebugConsole'' has already been defined, use the delete keyword:
To whitelist (multiple) users with a mod, if ''enableDebugConsole'' has already been defined, use the delete keyword:
<syntaxhighlight lang=cpp>delete enableDebugConsole;
<syntaxhighlight lang="cpp">
enableDebugConsole[] = {"81273982178973213"};</syntaxhighlight>
delete enableDebugConsole;
enableDebugConsole[] = { "81273982178973213" };
</syntaxhighlight>
 
=== Order of Precedence ===
 
# [[Mission Parameters | Mission param]] is checked. If it is not defined then...
# [[Description.ext|description.ext]] param {{hl|enableDebugConsole}} is checked. If is not defined then...
# [[:Category:Eden Editor|Eden]] attribute option is checked. If not defined then...
# Global/mod param {{hl|enableDebugConsole}} is checked.
 
=== BattlEye Filters ===


==== Order of Precedence ====
Debug Console uses [[Remote Execution]]. If you wish to exclude Debug Console execution from BE Filters, add this to your {{hl|remoteexec.txt}}
# [[Arma 3 Mission Parameters | Mission param]] is checked. If is not defined then...
!="BIS_fnc_debugConsoleExec \[[0-2],\{.*\}\]"
# [[description.ext]] param <tt>enableDebugConsole</tt> is checked. If is not defined then...
# [[Eden]] attribute option is checked. If not defined then...
# Global/mod param <tt>enableDebugConsole</tt> is checked.


==== BattlEye Filters ====
Debug Console uses [[Remote Execution]]. If you wish to exclude Debug Console execution from BE Filters, add this to your <tt>remoteexec.txt</tt>
<code>!="BIS_fnc_debugConsoleExec \[[0-2],\{.*\}\]"</code>


=== Features ===
== Features ==


{{Informative | Did you know that if you accidentally pasted a large amount of text in either watch field or exec field, to clear the field at once select the field and press <tt>Ctrl+A</tt> to select all and then <tt>DEL</tt> to clear }}.
{{Feature|informative|You can clear large amounts of text from the expression field or a watch field by selecting the field and pressing {{Controls|Ctrl|A}} and then {{Controls|Del}}.}}
* '''Expression field'''
** Value is saved when console is closed and restored again upon return
** Since {{GVI|arma3|1.73}} comments marked by '''//''' are ignored
** The expression can be executed by one of the following buttons:
*** Local - execute on player's computer using [[remoteExec]] to [[call]] given code.
*** Global - execute on all computers using [[remoteExec]] to [[call]] given code. Enabled only in MP
*** Server - execute on server only using [[remoteExec]] to [[call]] given code. Enabled only in MP
*** Performance Test - See: [[diag_codePerformance]]


* '''4x Watch field'''
=== Expression field ===
** Value is saved when console is closed and restored again upon return
** When code is taking too long to evaluate (>0.003s), the background turns orange and the value is not saved
** Watch fields execution paused when user edits the watch expression, and resumes on change of focus or enter key


* {{GVI|arma3|1.73}}[[File:Arma3 Debug ExecutionResult.jpg|thumb|right|Execution result field]] '''Execution result field'''
* The expression is saved when the debug console is closed and restored again upon return.
** The execution result field shows result of local execution of the expression code
* {{GVI|arma3|1.74}} Comments with {{hl|//}} are supported (use {{Controls|Shift|Enter}} to start a new line).
** In MP the execution result field shows remote result for server execution
* The expression can be executed in the [[Scheduler#Unscheduled Environment|unscheduled environment]] using the following buttons:
** Local - execute on player's computer using [[remoteExec]] to [[call]] the given code.
** Global - execute on all computers using [[remoteExec]] to [[call]] the given code. Only enabled in MP.
** Server - execute only on the server using [[remoteExec]] to [[call]] the given code. Only enabled in MP.
** Performance Test - See: [[diag_codePerformance]]


* '''Buttons''' (All of the following buttons close the pause menu and open some another window)
=== 4x Watch field ===
** '''[[Spectator Mode|Spectator Camera]]'''
 
** '''[[Splendid Camera]]'''
* The expression is saved when the debug console is closed and restored again upon return.
** '''[[Arma 3 Function Viewer|Functions Viewer]]'''
* When the code is taking too long to evaluate (>0.003s), the background turns orange and the value is not saved.
** '''[[Mission_Editor#Config_Viewer|Config Viewer]]'''
* Watch field execution is paused when the user edits the watch expression and resumed on change of focus or when pressing {{Controls|Enter}}.
** '''[[BIS_fnc_animViewer|Animation Viewer]]'''
 
** '''[[User Interface Editor]]'''
=== {{GVI|arma3|1.74}} Execution result field ===
 
[[File:Arma3 Debug ExecutionResult.jpg|thumb|right|Execution result field]]
* The execution result field shows result of local execution of the expression code.
* In MP the execution result field shows remote result for server execution.
 
=== Expression History ===
 
The debug console will keep track of the last ten expressions which were executed. One can use {{Controls|Page Up}} and {{Controls|Page Down}} to cycle through them.
 
=== Buttons ===
 
All of the following buttons close the pause menu and open another window.
* [[Spectator Mode|Spectator Camera]]
* [[Arma 3: Splendid Camera]]
* [[Arma 3: Functions Viewer|Functions Viewer]]
* [[Arma 3: Splendid Config Viewer|Config Viewer]]
* [[Arma 3: Splendid Animation Viewer|Animation Viewer]]
* [[User Interface Editor]]


=== Profile Saving ===
=== Profile Saving ===
The debug console automatically saves each field as you go, Even after game restart. These can also be access using [[profileNamespace]] [[getVariable]] with the following code:
 
*'''Expression Field'''<br>
The debug console automatically saves each field as you go, even after game restart. These can also be access using [[profileNamespace]] [[getVariable]] with the following code:
<code>profileNamespace getVariable "rscdebugconsole_expression";</code>
* '''Expression Field''' <sqf>profileNamespace getVariable "rscdebugconsole_expression";</sqf>
*'''4x Watch Field'''
* '''4x Watch Field''' <sqf>
<code>profileNamespace getVariable "rscdebugconsole_watch1";
profileNamespace getVariable "rscdebugconsole_watch1";
profileNamespace getVariable "rscdebugconsole_watch2";
profileNamespace getVariable "rscdebugconsole_watch2";
profileNamespace getVariable "rscdebugconsole_watch3";
profileNamespace getVariable "rscdebugconsole_watch3";
profileNamespace getVariable "rscdebugconsole_watch4";</code>
profileNamespace getVariable "rscdebugconsole_watch4";
</sqf>
Using the same variables you can also clear or change the fields.
Using the same variables you can also clear or change the fields.


=== Utilities ===
In order to access [[Arma_3_Utilities]] from debug console, type <tt>utils</tt> in the debug console and press local exec. Or to go directly to utility of your choice type <tt>utils N</tt>, where N is the number of the utility in the list. For example <tt>utils 2</tt> will take you to config browser.


=== See Also ===
== Utilities ==
 
In order to access [[Arma 3: Utilities]] from debug console, type {{hl|utils}} in the debug console and press local exec. To go directly to the utility of your choice use {{hl|utils n}}, where {{hl|n}} is the number of the utility in the list. For example {{hl|utils 2}} will take you to config browser.
 
 
== See Also ==
 
* [[Debugging Techniques]]
* [[Debugging Techniques]]
[[Category:Mission_Editor|Debug Console]]
 
[[Category:Arma 3: Editing]]
 
[[Category: 2D Editor]]
{{GameCategory|arma3|Editing}}
[[Category:Introduced with Arma 3 version 0.54]]

Latest revision as of 13:40, 17 May 2024

Arma 3 logo black.png0.54 The Debug Console is an editing tool that provides scenario designers with the ability to observe variables and to execute code on the fly.

Debug Console in pause menu
Debug Console in editor
Debug Console History (10 slots, accessible via Page Up and Page Down)


Access

While playing a mission from the editor, the console is immediately available in pause menu. In the old 2D Editor map screen, you can open it by clicking the "Debug Console" button or with Ctrl + D. In Eden editor it is available under Tools > Debug Console.

In multiplayer the debug console is available by default only when MP preview is started from Eden Editor, and is only available to the host who started it. In all other cases debug console needs to be explicitly enabled with either editor attribute or enableDebugConsole param (see below). It is worth noting that when debug console is configured for admin access, it is only available for logged in admin, voted in admin is treated just like any other user in this respect.


Configuration

The console is automatically available in missions running from editor. If mission designer wishes to enable it elsewhere, he can achieve it in one of the three ways:

  • Using mission config param. You can add "\a3\functions_f\Params\paramDebugConsole.hpp" mission parameter, where server host / admin can choose whether or not he'll allow debug console.
  • Using following Description.ext param, for example:
    enableDebugConsole = 1;
    
    Possible values:
    • 0 - Default behavior, available only in editor
    • 1 - Available in SP and for hosts / logged in admins in MP
    • 2 - Available for everyone
  • Using Eden attribute Debug Console, available in Attributes > General > States > Debug Console
  • Using global/mod config param, for example:
    enableDebugConsole = 2;
    

Whitelisting Multiple Users

Since Arma 3 logo black.png1.72 it is possible to let more than one person access debug console in Multiplayer. This is done by defining enableDebugConsole param as Array and adding UIDs of whitelisted users to this array, for example:

enableDebugConsole[] = {"81273982178973213", "3749832749732749", "7492374983274234"};

All users with UIDs matching the added UIDs will be able to access debug console in Multiplayer. Additionally, server host will also be able to use debug console, as well as any logged in admin on dedicated server.

Mod support

Since Arma 3 logo black.png1.72 it is possible to configure debug console availability with a mod param enableDebugConsole. This param is checked if no debug console option is set in the mission. If a server admin would like to make debug console available for a group of trusted people, he can create a custom mod, for example with:

enableDebugConsole = 2;

Then sign it and distribute between trusted people. This way anyone who has this custom mod signed with correct signature, will be able to connect to the server and use debug console. Array of UIDs is also supported here.

To whitelist (multiple) users with a mod, if enableDebugConsole has already been defined, use the delete keyword:

delete enableDebugConsole;
enableDebugConsole[] = { "81273982178973213" };

Order of Precedence

  1. Mission param is checked. If it is not defined then...
  2. description.ext param enableDebugConsole is checked. If is not defined then...
  3. Eden attribute option is checked. If not defined then...
  4. Global/mod param enableDebugConsole is checked.

BattlEye Filters

Debug Console uses Remote Execution. If you wish to exclude Debug Console execution from BE Filters, add this to your remoteexec.txt

!="BIS_fnc_debugConsoleExec \[[0-2],\{.*\}\]"


Features

You can clear large amounts of text from the expression field or a watch field by selecting the field and pressing Ctrl + A and then Del.

Expression field

  • The expression is saved when the debug console is closed and restored again upon return.
  • Arma 3 logo black.png1.74 Comments with // are supported (use ⇧ Shift + Enter ↵ to start a new line).
  • The expression can be executed in the unscheduled environment using the following buttons:
    • Local - execute on player's computer using remoteExec to call the given code.
    • Global - execute on all computers using remoteExec to call the given code. Only enabled in MP.
    • Server - execute only on the server using remoteExec to call the given code. Only enabled in MP.
    • Performance Test - See: diag_codePerformance

4x Watch field

  • The expression is saved when the debug console is closed and restored again upon return.
  • When the code is taking too long to evaluate (>0.003s), the background turns orange and the value is not saved.
  • Watch field execution is paused when the user edits the watch expression and resumed on change of focus or when pressing Enter ↵.

Arma 3 logo black.png1.74 Execution result field

Execution result field
  • The execution result field shows result of local execution of the expression code.
  • In MP the execution result field shows remote result for server execution.

Expression History

The debug console will keep track of the last ten expressions which were executed. One can use Page Up and Page Down to cycle through them.

Buttons

All of the following buttons close the pause menu and open another window.

Profile Saving

The debug console automatically saves each field as you go, even after game restart. These can also be access using profileNamespace getVariable with the following code:

Using the same variables you can also clear or change the fields.


Utilities

In order to access Arma 3: Utilities from debug console, type utils in the debug console and press local exec. To go directly to the utility of your choice use utils n, where n is the number of the utility in the list. For example utils 2 will take you to config browser.


See Also