Debugging Features - funovus/editor-wiki GitHub Wiki
The following keys are tied to debug settings by default:
-
P
: pauses/unpauses the simulation -
N
: advances the simulation by 1 frame (while paused) -
Page Up
: increases simulation speed -
Page Down
: decreases simulation speed -
+
: increase gold for local player by 1000 -
Shift
++
: increase gold for local player by 100000 -
Alt
+Left Click
: free move camera rotation
You can enable the in-game debug window by selecting the "Is Dev" setting under Play Settings in the Data Editor.
The most useful of these settings is the "Selected Unit Info" setting, which gives you a plethora of information about the currently highlighted unit.
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().
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.LogDumpSimple(some_table)
-- logs the contents of the table and any nested tables
core.LogDump(some_table)
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.
For effects, the easiest way to debug complicated effect trees is to use area searches with Debug Draw enabled.
For actors, you can use the Log action to print messages to the Player Logs Window, similar to trigger debugging.