New Modding Basics

vans163

Chieftain
Joined
Oct 22, 2016
Messages
57
Some basics I have learned the last 24 hours.

- Hotloading is now supported. Often 2 saves of the file are required for Civ6 to correctly load the changes.

- If you add new files to your .modinfo, you unfortunately need to reboot the entire game for them to get loaded.
(Maybe if you change the mods uuid you dont?)

- Still no idea how to load a custom .lua file via .modinfo. But loading files that are located in Base/Assets works fine,
and the new files override the old (currently only DLC case was tested). Adding a custom.lua file that is not included makes the game not want to load it.
 
If you look within the ColdWarScenario (within the Assets/Scenarios directory), it adds a startup lua file to the modinfo.
 
- Still no idea how to load a custom .lua file via .modinfo. But loading files that are located in Base/Assets works fine,
and the new files override the old (currently only DLC case was tested). Adding a custom.lua file that is not included makes the game not want to load it.

under <Components>
HTML:
        <ImportFiles>
            <Items>
                <File>YourImportedFile</File>
            </Items>
        </ImportFiles>

edit : that's for new files, not sure how to replace existing files via a mod. Everything UI related we should be able to mod it using the context functions, that's a lot more works but better for compatibility between UI mods.
 
Last edited:
update: <ImportFiles> works to replace a lua file via a mod (tested with AssignStartingPlots.lua)
 
Hello guys, may I ask you a question? how to install a mod into my civ 6 game? thanks!
 
By the way, How to play the cold war scenarios?

They are MP scenarios so you will need to set the singleplayer flag to "1" in the modinfo file for the scenario.
 
Can anyone please point me to the basic information about modding in civ6?
Everyone posting here seems to know the most important information which is:
1.) Where is my starting point? Is there are root file which must always be included in every mod?
2.) When I modify an existing xml file what do I do with the modified version of the file
3.) It seems to be possible to modfify parameters using sql. This seems great. But
a.) how do I make sure my sql file gets executed?
b.) where do I see the original values (do you actually view a database or do we look at create scripts?)
4.) A simple example. Assume I simply want to change only 1 value in 1 xml file and finallize the result as my mini-mod. What would I have to do?
 
The process will become much easier when Firaxis releases its modding tools (which should be "soon").

That being said:
1. The starting point is the Aztec DLC in game folder "DLC" and the scenarios/tutorial in game folder "Base\Assets\Scenarios" (as well as the mods others have created). Like Civ5, a .modinfo file is the "root file," as you say, though the syntax has changed.
2. If you're going to modify the base files rather than make a mod, just back up the original and put it in an alternate location.
3. Very similar to Civ5, with UpdateDatabase (though again, the syntax has changed).
a. Modding.log in the user "logs" folder
b. Similar to Civ5, view the databases in the user "cache" folder in a SQLite Browser program.
4. See #1.
 
Is it impossible to make changes to the main menu ui via Mods?

I want to override the Options.xml and Options.lua from Assets/UI/, and even tho the mod loads the changes aren't shown

If I however copy my own Options files into the game directory and override the changes work fine.
 
I experienced the same issue. It seems the main menu can't be change through mod or even a DLC. That's sad. I had to change the files directly in the assets folder. Sukritact said it too in Sukritact's Civ Selection Screen.
Edit: Actually, if i remember well; i launched a game and then went back to the main menu and the changes i've made were taken into account. But they were not directly after the app is started. Maybe some file are loaded at the beginning of a game, not what the application starts. I'm not sure to be clear...
 
Last edited:
Civ games use a variety of different languages, but the ones you'll need the most for modding will definitely be XML/SQL (database) and Lua (complex/dynamic effect scripting). As for what IDE to use, hopefully Firaxis will release something similar to the Civ 5 SDK we can use in the near future, but short of that, I'd go for a text editor that can reliably and effectively edit XML/SQL and Lua files. Sublime Text and Notepad++ are the names I see tossed around most often, but there are certainly other options.
 
Civ games use a variety of different languages, but the ones you'll need the most for modding will definitely be XML/SQL (database) and Lua (complex/dynamic effect scripting). As for what IDE to use, hopefully Firaxis will release something similar to the Civ 5 SDK we can use in the near future, but short of that, I'd go for a text editor that can reliably and effectively edit XML/SQL and Lua files. Sublime Text and Notepad++ are the names I see tossed around most often, but there are certainly other options.

where can i find some tutorials on how to start modding? i only know how to edit existing xml and sql. i want to make a modpack that consist either using xml or sql
 
Most of the tutorials you can find on modding Civ 6 are right in this forum. The game hasn't even been out for a week; we're all still figuring out the basics. Hopefully soon Firaxis will release their official modding tools which will make all of our lives easier, so if you're comfortable with waiting, I'd hold my horses until then.

Failing that, the best way of figuring out how to do something at the moment is to look at how the game does it and follow that same basic structure. Want to add a unit? Look at the game's basic code in Units.xml and the like. Need to modify localization? Look at all the text entries in the game's database. If that isn't enough, give a crack at the Civ 5 Creation & Customization forum; though it's for a different game, the architecture is quite similar and the standards for coding are much the same, if nothing else. Because it's been around for a while, there are all kinds of tutorials there to consult. Don't take anything you find there as gospel though, just use it as a guide, because it's very likely things will be done differently in Civ 6.

If you're having trouble, there's no problem with asking a question in the main forum, though I'd definitely warn against using this forum as your first line of inquiry. Investigating by yourself will almost always teach you things far better, if for no other reason than it encourages you to learn the structure of the game. This is a learning period for all of us, though, so if you can't figure something out, a lot of us will be more than happy to help you out because chances are we'll be helping ourselves out in the process.
 
Most of the tutorials you can find on modding Civ 6 are right in this forum. The game hasn't even been out for a week; we're all still figuring out the basics. Hopefully soon Firaxis will release their official modding tools which will make all of our lives easier, so if you're comfortable with waiting, I'd hold my horses until then.

Failing that, the best way of figuring out how to do something at the moment is to look at how the game does it and follow that same basic structure. Want to add a unit? Look at the game's basic code in Units.xml and the like. Need to modify localization? Look at all the text entries in the game's database. If that isn't enough, give a crack at the Civ 5 Creation & Customization forum; though it's for a different game, the architecture is quite similar and the standards for coding are much the same, if nothing else. Because it's been around for a while, there are all kinds of tutorials there to consult. Don't take anything you find there as gospel though, just use it as a guide, because it's very likely things will be done differently in Civ 6.

If you're having trouble, there's no problem with asking a question in the main forum, though I'd definitely warn against using this forum as your first line of inquiry. Investigating by yourself will almost always teach you things far better, if for no other reason than it encourages you to learn the structure of the game. This is a learning period for all of us, though, so if you can't figure something out, a lot of us will be more than happy to help you out because chances are we'll be helping ourselves out in the process.

thanks :D
 
Back
Top Bottom