Debugging

Step-by-step debugging is advanced technique of programming for finding and resolving proble

Setup
"C:\Steam\steamapps\common\Life is Feudal Forest Village\" "ForestVillage.exe" -debug -console debugger.runonstart = true debugger.redirect = 'c' path.moai = "debug.cmd"
 * Find root game directory at your system. Usualy it is something like this:
 * Create debug.cmd in this directory with following content:
 * Find script.pak in the same directory. Extract it by QuickBMS.
 * Download and install [ZeroBrane IDE]. Run it.
 * Select Project -> ProjectDirectory -> Choose and select root game directory.
 * Select Project -> LuaInterpretor -> Moai
 * Select Edit -> Preference -> Settings: System . Add this lines at the end of file and save it:
 * Restart ZeroBrane IDE.

Usage

 * If setup done correctly you can press "start debugging" button (green triangle) and game will start.
 * When the game window pops up start a new game.
 * Browse project window (Project View -> Project/FileTree) and open some scripts. Click next to any line number to toggle breakpoint at this line (red circle). When script execution reaches this line the game will stop.
 * Use stack window (Project View -> Stack) to examine stack and local variables at this point.

print ( "text") for key,val in pairs ( fv.core ) do     print( key,val ) end
 * Use Project -> Step Into, Step Over, Step Out buttons to step-by-step execution.
 * Use this command in scripts to print any information into View -> Output window:
 * To print information about the running game you can just put available global variables in print statements. If you put the following code in one of your Mod-Lua files it will print all elements of the fv.core Table to the Zerobrane console:
 * Find more info about ZeroBrane IDE on [official site].