New to modding CIV 6. How can LUA be used to do modding?

Adam Hall

Chieftain
Joined
Aug 9, 2017
Messages
20
I have been looking at ModBuddy, the Tuner and all of the files in "Assets" of the base game. I get the concepts of using XML and SQL to modify or add to things in the game that are specified in the XML and SQL.

But how about using LUA? I see many lua files in the Base game but all in the area of the UI. Does this mean LUA is only supposed to be used for modify screens?

Of course LUA is present when looking at panels in the Tuner as well. But how does that help me as a modder? I can see many global LUA objects and function definitions thru the tuner but what good does that do me? We don't have access to the rest of the LUA source that was used to compile these objects and functions.
 
Lua can be used for writing code for UI screens and for gameplay scripts. The process is a little difficult to describe. My Combined Tweaks mod does use a handful of Lua code, mainly for creating some pop-up windows and for making things happen in-game that can't be achieved with the database alone. I'm not very good at Lua scripts. Main thing I'd tell you is its hard to debug and prone to crashing from accidentally passing Null references to code.
 
To be honest, I want to focus on the most glaring problem with CIV 6, the AI. I imagine LUA would be needed to accomplish any real change in this area, if even that is possible. I know their is an "Artificially Intelligent" mod out there and it does help a bit. I don't know how it does what it does considering, there seems to be next to nothing we have access to in the LUA objects related to the AI.
 
To be honest, I want to focus on the most glaring problem with CIV 6, the AI. I imagine LUA would be needed to accomplish any real change in this area, if even that is possible. I know their is an "Artificially Intelligent" mod out there and it does help a bit. I don't know how it does what it does considering, there seems to be next to nothing we have access to in the LUA objects related to the AI.


Unfortunately what you really need is access to the C++ files that are used to compile the DLL. No telling when (if ever) Firaxis will release those. They did eventually release them for Civs 4 and 5, but I believe in the case of 5 it was years after the game was released.
 
Globally, there are more things related to the AI exposed to the Database (modifiable using XML/SQL) than in civ5.

But without any kind of documentation it's a bit useless until we get DLL access to document those ourself, and once we have that access, most modders will simply hardcode the change they need...

On the Lua side we have currently less method available to control the AI, especially for diplomacy and unit control (on the later there have been an addition in the last patch, see the Nil scenario)

Note that some of those method for civ5 were added with later patches, so there is still hope.
 
Back
Top Bottom