whoward69
DLL Minion
ModBuddy's support for Lua is not great. Most people write Lua and then start up the game to test it - which is a poor way to find syntax errors.
There are several alternatives, mine is
1) Download and install "Lua for Windows"
2) From the Lua option now in the main menu, select SciTE
3) From the File, Open ... dialog in SciTE, browse into the "~Documents\Firaxis ModBuddy" sub-directory, then into the sub-directory that's your mod
4) In that sub-directory you should have three further sub-directories "Build", "Packages" and one named as your mod, browse into that one
5) Browse into any sub-directories you use to organise files (LUA in my case) and Open the file you want to check - eg "C:\Users\{username}\Documents\Firaxis ModBuddy\Resolutions - Political Voting MP\Resolutions - Political Voting MP\LUA\ResolutionsPoliticalVoting.lua"
6) On the toolbar, click the blue right pointing arrow head (the mouse over hover reads "Run Program")
7) Correct any syntax errors, save the changes and click the blue arrow again - repeat until you have no syntax errors
8) At some point you will get an error about GameInfo, GameInfoTypes, GameEvents or include() - this is the Lua environment looking for CivV globals and failing to find them.
9) As you have been making changes directly to the Lua file(s) as ModBuddy reads them, rebuild the mod from within ModBuddy to deploy the changed files into the mod used by the game
At this point your Lua syntax is correct and you can proceed with testing in-game - knowing that you are now only looking for logic errors (or typos related to game objects/methods)
W
There are several alternatives, mine is
1) Download and install "Lua for Windows"
2) From the Lua option now in the main menu, select SciTE
3) From the File, Open ... dialog in SciTE, browse into the "~Documents\Firaxis ModBuddy" sub-directory, then into the sub-directory that's your mod
4) In that sub-directory you should have three further sub-directories "Build", "Packages" and one named as your mod, browse into that one
5) Browse into any sub-directories you use to organise files (LUA in my case) and Open the file you want to check - eg "C:\Users\{username}\Documents\Firaxis ModBuddy\Resolutions - Political Voting MP\Resolutions - Political Voting MP\LUA\ResolutionsPoliticalVoting.lua"
6) On the toolbar, click the blue right pointing arrow head (the mouse over hover reads "Run Program")
7) Correct any syntax errors, save the changes and click the blue arrow again - repeat until you have no syntax errors
8) At some point you will get an error about GameInfo, GameInfoTypes, GameEvents or include() - this is the Lua environment looking for CivV globals and failing to find them.
9) As you have been making changes directly to the Lua file(s) as ModBuddy reads them, rebuild the mod from within ModBuddy to deploy the changed files into the mod used by the game
At this point your Lua syntax is correct and you can proceed with testing in-game - knowing that you are now only looking for logic errors (or typos related to game objects/methods)
W