Table of Contents

Play Window Debugging

Debug Shortcuts

The following keys are tied to debug settings by default:

Is Dev Setting

You can enable the in-game debug window by selecting the "Is Dev" setting in the Play Settings Window (Ctrl+Shift+L).

play settings

The most useful of these settings is the "Selected Unit Info" setting, which gives you a plethora of information about the currently highlighted unit.

ingame debug

Text Commands

Using the "Is Dev" setting also allows you to send text commands by pressing "Enter" in the Play Window. These commands can trigger events via DCEI.TriggerAdddTextCommandEvent().

Trigger Debugging

Trigger Logging

The quickest way to debug your lua triggers is often through the use of log messages. Lots and lots of descriptive log messages (depending on the complexity of your script). Example:

if thing_thats_supposed_to_happen then
    DCEI.LogMessage("> thing happened successfully")
else
    DCEI.LogMessage("> thing failed to happen")
end

You can also use the Core LogDump functions to print the contents of a table. Example:

local Core = require("Core")

local some_table = {
    position = { x = 11, y = 12 },
    name = "Goblin",
    level = 11
}

-- logs the contents of the table
Core.Util.LogDumpSimple(some_table)

-- logs the contents of the table and any nested tables
Core.Util.LogDump(some_table)

Trigger Profile

Press F6 in the Play Window to dump a log file (search for "Trigger profiling" in player logs). It contains info about how many times each trigger API has been called and the total time spent in these trigger API calls.

Data Debugging

Debug Draw

For effects, the easiest way to debug complicated effect trees is to use area searches with Debug Draw enabled.

Actor Logging

For actors, you can use the Log action to print messages to the Player Logs Window, similar to trigger debugging.