How do you edit LUA? Use Notepad++ then switch to ModBuddy?

gqqnbig

Chieftain
Joined
Apr 15, 2020
Messages
26
There (https://forums.civfanatics.com/thre...better-lua-editor-faster-intellisense.391034/) is a LUA editor improvement for CIV 5 (Visual Studio Shell 2010 or thereabouts), which made modders their day.

Someone asked if there is a way to improve the LUA editor for CIV 6 https://forums.civfanatics.com/threads/is-there-a-lua-plugin-for-modbuddy.614010/ , but people replied to use another editor.

So what is the workflow here? Use Modbuddy to edit XML and something, then switch to Notepad++ for LUA, then switch back to Modbuddy, Modbuddy tells me a LUA file is edited outside, do you want to reload? I say yes, then I build the solution in Modbuddy?

Is it too cumbersome switching back and forth?
 
Personally I only start modbuddy when I need to cook some assets into .blp, else I do everything in Notepad++ (.XML, .Lua, .modinfo, .artdef, .dep, ...)
 
Personally I only start modbuddy when I need to cook some assets into .blp, else I do everything in Notepad++ (.XML, .Lua, .modinfo, .artdef, .dep, ...)
So do you work directly on Documents\My Games\Sid Meier's Civilization VI\Mods\your mod?

Then do you have another solution folder, usually at Documents\Firaxis ModBuddy\Civilization VI, generated by Mod buddy?

If you edit the generated mod files, if you rebuild from Documents\Firaxis ModBuddy\Civilization VI, the changes will be overridden, right?
 
I cook the assets in a "fake" mod, then move the blp into my real mod's folder.
 
I create all the needed files in modbuddy, as well as all the activation methods for all those files. Then I save and close modbuddy.

I now have a project which might have three "code" files: an XML file, an SQL file, and an lua file.
  1. I open these files directly from the modbuddy project folder using Notepad and create my code therein. I find Notepad++ too cumbersome and interface-busy: I prefer the simplicity of Notepad. And there is no way in this realm of reality I ever willingly edit my code files using the internal modbuddy editor -- it is too annoyingly cluttered and slow.
  2. Once I have the code I need in each file, I simply save the files and then I can go back and open the project in Modbuddy. At this point I am only interested in having Modbuddy generate the usable "built" mod.
  3. I build the mod and now have an executable mod I can run in-game.
  4. If I have goofed and have syntax or other errors, I will see them when I run the game with the mod enabled and I consult Database.log and Modding.log for errors.
    • You must always look for syntax errors and the like by the results reported in Database.log. Modbuddy does not report code syntax errors when you "Build" the mod. It merely reports errors relating to not being able to find or open a file.
    • Your code in an XML, SQL, or lua file can be utter complete rubbish and nonsense and Modbuddy will not show this as errors of any kind in its internal editor so long as the presentation of the syntax "looks correct". Hence Modbuddy is 100% useless for telling you whether the code within your mod is correct.
  5. If I have to edit my files I do so in the mod that the game is using from within the Mods folder, and then when everything is fixed I simply copy the entire file from the executable mod into the version in the modbuddy project folder. This updates the contents of the modbuddy project without needing to redo the Build or anything else -- no need to even open the modbuddy tool or the project for the mod.
And in case it seems I am dissing on Notepad++, I use it extensively when debugging a mod. Its inherent ability to recognize an XML, SQL, or lua for what it is and properly show syntax relationships as well as file line numbers is really hard to beat during the debuggery. I just find it too cluttered when actually writing the code and it also can't really keep up with the speed at which I type code.
 
Last edited:
I create all the needed files in modbuddy, as well as all the activation methods for all those files. Then I save and close modbuddy...

Oh, Great Writer LeeS! I read your Great Work LeeS' Civilization 6 Modding Guide, it's very helpful.

You are so experienced, you can write a few tens or hundreds of lines then test in the game. But I have to test every single XML attribute. If I adopt your approach, my 40% of time is copying files and loading solutions, 40% of time is reloading savegame, and only 20% of time is writing the code.
 
Top Bottom