A few questions...

Aidence

The Archduke
Joined
Nov 23, 2013
Messages
224
I made a couple mods for Civ 5 but never got around to completely understanding lua. So I would like to learn how to use lua for my civ 6 mods. I would also like to learn the ins-and-outs of modding civ 6. So here are my questions.

1) In lua, would GetTechs also apply to civics? Also, how would I make it so that a civilization gets the Holy War casus belli with the divine right civic?

2) How do I structure a lua file?

3) Do I just add create the lua file then add it under the files part of the .modinfo file?

4) How do requirements work, where do I add them, and what is possible with them?

5) When adding a civilization, how would I go about removing a city state because the civ uses that city?

6) How would I make a building that replaces another building come with a different tech?
 
Last edited:
I can't help much with Lua, as I've not started on that yet for my mods, but I hope I can help with the others.

4) Requirements are used specifically with Modifiers. They are extremely powerful; probably like 90% of the base game's effects are implemented entirely in Modifiers (with plenty of Requirements), from Civ abilities to leader Agendas, to the techs and policy cards, everything. I'd look at a specific effect you want to recreate and find it in the game's data, see how they lay out the Modifiers and if it needs any Requirements, etc. One thing you need to be aware of is the Collection of the ModifierType (found in Modifiers.xml), which will determine what Requirements are needed/possible with the Collection. Also be aware you can put a Requirement on the Owner or the Subject; see here for a really good primer on modifiers and requirements.

5) If you're talking about a mod that will replace the city state only when the civ is in the game, that's almost certainly a complicated Lua thing, beyond my abilities. If you're talking about just removing the city state entirely in favor of your own civ, there might be an option somewhere where you can just set the city state to inactive, like there was in Civ 5 with major civs, but I don't know where it is. Short of that, your options are to replace or delete everything from the base game database related to the city state (Civilizations.xml and others), or to just leave the city state in the game for now and develop your civ as a completely stand-alone. That'll let you fix this problem later, when you have a better answer for it.

6) An entry in the BuildingReplaces table, and a different tech for your building's PrereqTech entry in the Buildings table. You can get a good idea of the tables in Buildings.xml.
 
Top Bottom