When creating more advanced mods there likely be issues that arise. Here are a few ways to approach and resolve them.
Turning on Developer mode in the settings file allows for many in-game tools to be used. Open the settings file and set “developer_mode” to true.
DebugDrawSystem
.game.debugRender.add(player.entity.render.getRect(), Color(255, 0, 255))
Using the Log
is crucial to debugging issues. Logs can be used to simply track the code execution or contain useful information on the state of things.
from siege.log import Log
Log.info("Logging Example")
Since the entire game engine has exposed to python it has been compiled to a binary module and is possible to import as a normal python module. This means that it is possible to use the siege engine in python scripts and the python interpreter. This can be very useful when testing code or writing a helper script such as generating dungeons.
To use the siege module just drop it into whatever folder you want to import it from. Typically you would want it next to the crea game binary.
While developing UI it is extremely useful to inspect and change elements. This can be done using the Coherent UI Debugger <coherent-debugger> which works exactly like the Chrome Developmer Tools.