Functions for debugging scripts.
local Debug = ELONA.require("core.Debug")
| log (message) | Logs a message to log.txt. |
| report_error (message) | Reports an error to the game console and log file. |
| enable_wizard () | Enable Wizard mode. |
| disable_wizard () | Disable Wizard mode. |
| is_wizard () | Returns whether you are Wizard or not. |
| is_muggle () | Returns whether you are Muggle or not. |
| has_wizard_flag (flag_name) | Return if you are Wizard and flag_name is on. |
Logs a message to log.txt.
Parameters:
Reports an error to the game console and log file.
Parameters:
Enable Wizard mode.
It is equivalent to turn core.wizard.is_enabled on.
Disable Wizard mode.
It is equivalent to turn core.wizard.is_enabled off.
Returns whether you are Wizard or not.
It is opposite to Debug.is_muggle.
Note: You might want to make a limitation of "unless you are Wizard". For
example, if you make an achievement system, Wizard players can obtain all of
them much easier than you expect. However, before calling Debug.is_wizard,
remember that Elona is a single-player game.
true if Wizard mode; otherwise false.
Returns whether you are Muggle or not.
It is opposite to Debug.is_wizard.
true if Muggle mode; otherwise false.
Return if you are Wizard and flag_name is on.
Parameters:
true if Muggle mode; otherwise false.
true if you are Wizard and flag_name is on; if not,
false. Even if flag_name is not a boolean option, its value is
interpreted as boolean (e.g., check truthy or falsy).