My Games/Sid Medier's Civilization V/cache/Civ5DebugDatabase.db
.My Games/Sid Medier's Civilization V/cache/Civ5DebugDatabase.db
Lua.log
file). This includes all the debugging output but also any error that may arise, with their calls stack traces. print(...)
can be used to print anything to the Firetuner output. This allows you to check the flow of a program, or the values of variables. Print calls tostring on every argument and displays them all on a single line with tabulations as separators between them. Nil values are not displayed, so it is advised you provide expressions such as: (expr or 'nil')
error(string message, int level = 1)
throws an error with the specified message. The execution is then halted and the hand returned to the game engine (or the current protected call if you did use pcall or xpcall). The level parameter controls the error position that will be reported. 1 for the line where error is located, 2 for the function call that contained an error, etc. 0 for no position.assert(variant condition, string message = 'assertion failed')
can be used to assert the provided condition is neither nil nor false (everything else is evaluated to true in Lua). Otherwise, an error with the specified message is thrown. You can use them punctually, as a debugging technique. But they may also be used as a defensive programming technique similar to design-by-contract: the idea is that whenever your program's correctness relies on an assumption, you should explicitly check it. For example, if a function takes an array as an argument and assumes that it is not empty, you should add two conditions at the beginning: assert(type(t) 'table')
and assert(#t > 0)
. This makes the code more self-explanatory (implicit assumptions are now explicitly stated) and it allows you to catch bugs as soon as possible, which typically makes them easier to understand and fix.My Documents/My Games/Sid Meiers' Civilization V
and open them in a text editor like the notepad (not in a word processor).EnableTuner
to 1. Civ5 will duplicate the Lua output to FireTuner this one is when present.LoggingEnabled
to 1. Civ5 will write log files under the Logs
folder.EnableLuaDebugLibrary
to 1. Civ5 will display stack traces on Lua errors and you will be able to use the debug object.DebugPanel
to 1. By pressing the ² key (may be ù or something else depending on your computer's language) during a game, Civ5 will display a debug panel.DebugMode
to 1. Needed to enable other features previously mentioned.My Games/Sid Medier's Civilization V/cache/Civ5DebugDatabase.db
.My Games/Sid Medier's Civilization V/cache/Civ5DebugDatabase.db
Lua.log
file). This includes all the debugging output but also any error that may arise, with their calls stack traces. print(...)
can be used to print anything to the Firetuner output. This allows you to check the flow of a program, or the values of variables. Print calls tostring on every argument and displays them all on a single line with tabulations as separators between them. Nil values are not displayed, so it is advised you provide expressions such as: (expr or 'nil')
error(string message, int level = 1)
throws an error with the specified message. The execution is then halted and the hand returned to the game engine (or the current protected call if you did use pcall or xpcall). The level parameter controls the error position that will be reported. 1 for the line where error is located, 2 for the function call that contained an error, etc. 0 for no position.assert(variant condition, string message = 'assertion failed')
can be used to assert the provided condition is neither nil nor false (everything else is evaluated to true in Lua). Otherwise, an error with the specified message is thrown. You can use them punctually, as a debugging technique. But they may also be used as a defensive programming technique similar to design-by-contract: the idea is that whenever your program's correctness relies on an assumption, you should explicitly check it. For example, if a function takes an array as an argument and assumes that it is not empty, you should add two conditions at the beginning: assert(type(t) 'table')
and assert(#t > 0)
. This makes the code more self-explanatory (implicit assumptions are now explicitly stated) and it allows you to catch bugs as soon as possible, which typically makes them easier to understand and fix.My Documents/My Games/Sid Meiers' Civilization V
and open them in a text editor like the notepad (not in a word processor).EnableTuner
to 1. Civ5 will duplicate the Lua output to FireTuner this one is when present.LoggingEnabled
to 1. Civ5 will write log files under the Logs
folder.EnableLuaDebugLibrary
to 1. Civ5 will display stack traces on Lua errors and you will be able to use the debug object.DebugPanel
to 1. By pressing the ² key (may be ù or something else depending on your computer's language) during a game, Civ5 will display a debug panel.DebugMode
to 1. Needed to enable other features previously mentioned.