Tutorial / Settings
Debug
Debug options for every toolbox tool: an overlay, aim drawing, call times and errors, a debug console, net counts and a debug report.
What it does
Debug helps you find out why a toolbox tool does not do what you expect. While you hold a debugged tool, an overlay shows your access, what you aim at, the tool's settings and its last calls with their times. The server sends its errors back to you with the stack.
The debug console collects every call, counts the toolbox's net messages, shows each tool's settings against their defaults and builds a report you can paste into a bug report.
These are your own settings. Nobody else sees your overlay. Debugging never changes what a tool does: an error is reported and then raised as before.
Where to find it
Q menu > KGX's Admin Toolbox > Settings > Debug.
- Anyone can use the client options. The server only sends its call events to toolbox admins, or to every player when
kgxat_debug_playersis 1. - Only superadmins can change the two server options at the bottom.
- Every toolbox tool panel also has a --- Debug --- section at the bottom.
- Console:
kgxat_debug_consoleopens the debug console.kgxat_debug_reportprints the report.
The panel
Your options
| Option | What it does | Default |
|---|---|---|
| Debug on | Turns debugging on for you. | Off |
| Overlay while holding a debugged tool (access, aim, settings, last calls) | Shows the overlay at the right of the screen. | On |
| Draw the aim line, the hit normal and the target's box | Draws a yellow aim line, a blue hit normal and a green box around the target. | On |
| Print every call to the console | Prints each call with its result and time. | On |
| Count the toolbox's net messages (debug console > Net) | Counts every toolbox net message you send and receive. | Off |
Which tools
A list of every toolbox tool with Debug, Tool and Category columns. "yes" in Debug means that tool is debugged.
| Button | What it does |
|---|---|
| Debug the selected tools | Adds the selected tools and turns debugging on. |
| Stop debugging the selected tools | Removes the selected tools. |
| Debug every toolbox tool | Clears the list, so every toolbox tool is debugged. |
Double-click a tool to switch it on or off.
Tools
| Button | What it does |
|---|---|
| Debug console (calls, errors, net, tool settings, report) | Opens the debug console window. |
| Print the debug report to the console | Prints the report. |
| Print every changed toolbox tool setting | Prints every tool setting that differs from its default, and the count. |
| Reset every toolbox tool setting... | Asks to confirm, then resets your own toolbox tool settings to their defaults. |
Server (superadmins)
| Option | What it does | Default |
|---|---|---|
| Players who are not admins may debug the tools they may use | The server sends its events to non-admin players too. | Off |
| The server console prints every debugged tool call | Prints each call in the server console. | Off |
The debug console
The window has four tabs.
| Tab | What it shows |
|---|---|
| Calls | Every call of a debugged tool: Time, Side, Tool, Call, Result, ms, Target, Error. Rows with an error are red. Double-click copies a row with the error stack. Clear empties the list. |
| Net | Toolbox messages: In /s, Out /s, In total, Out total. Only filled while Count the toolbox's net messages is ticked. |
| Tool settings | Pick a tool: each setting with Now and Default. Changed rows are highlighted. Reset this tool's settings to the defaults resets that tool. |
| Report | The debug report: version, game branch, map, gamemode, the current tool, your access, its settings and the last 25 calls. Copy the report (for a bug report) copies it. |
The console keeps the last 200 calls. Calls are left click, right click, reload, deploy and holster.
How to use it
Find out why a tool does nothing
- Open Settings > Debug and tick Debug on.
- Select the tool in the list and press Debug the selected tools.
- Hold the tool. The overlay shows Access (admin, superadmin, may use it, Player Access, key, opened by a setting).
- Click with the tool. The overlay shows "Last call:" with the client and server result and time.
- If it shows "no server answer", the server refused the click: CanTool or prop protection, a cooldown, or no permission.
Catch a server error
- Debug the tool as above.
- Use it until it fails. A red "Server error:" line appears in the overlay for 30 seconds.
- Open the debug console, go to Calls and double-click the red row to copy it with the stack.
Send a bug report
- Hold the tool that has the problem.
- Open the debug console and go to Report.
- Press Copy the report (for a bug report) and paste it in your report.
Check a tool's settings
- Open the debug console and go to Tool settings.
- Pick the tool. Changed settings are highlighted with their default.
- Press Reset this tool's settings to the defaults to go back.
Settings and commands
| Setting | Side | Default | What it does |
|---|---|---|---|
kgxat_debug |
Client | 0 | Debug on. |
kgxat_debug_tools |
Client | empty | Tools to debug, comma separated. Empty = every toolbox tool. |
kgxat_debug_hud |
Client | 1 | Overlay. |
kgxat_debug_3d |
Client | 1 | Aim line, normal and box. |
kgxat_debug_print |
Client | 1 | Print calls to the console. |
kgxat_debug_net |
Client | 0 | Count toolbox net messages. |
kgxat_debug_players |
Server | 0 | Non-admins get server debug events. Range 0-1. |
kgxat_debug_log |
Server | 0 | Server console prints every debugged call. Range 0-1. |
| Command | What it does |
|---|---|
kgxat_debug_console |
Opens the debug console. |
kgxat_debug_report |
Prints the debug report. |
kgxat_perf_client [seconds] (old name kgxat_hookprofile) |
Times every toolbox hook on your game for 2-60 seconds (default 10), then prints the costliest 25. kgxat_perf does the same on the server (superadmins). |
Tips and limits
- The --- Debug --- section of a tool panel has Debug this tool (overlay, aim, calls, errors, times), Debug console and Print this tool's settings to the console.
- Ticking Debug this tool in a tool panel also turns Debug on.
- Tools that are not debugged run exactly as before.
- The overlay sits below the Inspector's live window when that is open.
- AI tools have their own drawing of NPC paths in AI > AI Brain.