Quick Modding Questions Thread

Is anyone aware of a Requirement or Requirement-Set that checks what the current era is? I thought it'd be neat to make the ai agenda for the civ I'm making not declare war on city states after the game reaches the Industrial Era.

(I suppose I could always approximate it by requiring the civ unlock a certain tech or civic)
I've also used "REQUIREMENT_GAME_ERA_ATLEAST_EXPANSION" from time to time. It just depends when you want something to trigger.
 
It seems as though creating bonuses around Era Score is hard because there is no effect attached to Era Score. They all are like "+Era Score even X condition" rather than "+Era Score" with the freedom to create the condition that provides it. Am I mistaken in this? I've looked and haven't found anything.
I'm trying to create a Pantheon that gives Era Score every time a Holy Site is constructed. I don't think it is possible (but please prove me wrong).
 
I'm having issues getting alternate colors showing for my custom civilization. I've copied the format verbatim from what's used by some default dlc 2 civs, but I'm getting errors saying that the column in the table doesn't exist. Here's the error log:

Code:
[2706072.028] [Configuration]: In XMLSerializer while updating table PlayerColors from file Chunk_Swiss_PlayerColors.xml.
[2706072.202] [Configuration]: Validating Foreign Key Constraints...
[2706072.203] [Configuration]: Passed Validation.
[2706075.407] [Gameplay] ERROR: table PlayerColors has no column named Alt1PrimaryColor
[2706075.407] [Gameplay]: In Query - insert into PlayerColors('Type', 'Usage', 'PrimaryColor', 'SecondaryColor', 'Alt1PrimaryColor', 'Alt1SecondaryColor', 'Alt2PrimaryColor', 'Alt2SecondaryColor', 'Alt3PrimaryColor', 'Alt3SecondaryColor') values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
[2706075.407] [Gameplay]: In XMLSerializer while updating table PlayerColors from file Chunk_Swiss_PlayerColors.xml.

The xml file seems pretty straightforward:
Code:
<GameData>
    <PlayerColors>
        <Row>
            <Type>LEADER_GUISAN</Type>
            <Usage>Unique</Usage>
            <PrimaryColor>COLOR_STANDARD_RED_MD</PrimaryColor>
            <SecondaryColor>COLOR_STANDARD_WHITE_LT</SecondaryColor>
            <Alt1PrimaryColor>COLOR_STANDARD_BLUE_MD</Alt1PrimaryColor>
            <Alt1SecondaryColor>COLOR_STANDARD_YELLOW_MD</Alt1SecondaryColor>
            <Alt2PrimaryColor>COLOR_STANDARD_YELLOW_MD</Alt2PrimaryColor>
            <Alt2SecondaryColor>COLOR_STANDARD_RED_MD</Alt2SecondaryColor>
            <Alt3PrimaryColor>COLOR_STANDARD_GREEN_LT</Alt3PrimaryColor>
            <Alt3SecondaryColor>COLOR_STANDARD_WHITE_LT</Alt3SecondaryColor>
        </Row>
    </PlayerColors>
</GameData>

If I comment out the lines having to do with alternative colors, it works fine, but obviously with only one set of available colors for the civ. I'm quite perplexed though, since the column names were taken straight from existing files. Is there something obvious I'm just not getting here?
 
Because the table you are attempting to use exists with a different definition within the InGame (code) Database than the "Colors" Database.

In order to use the column-names you are attempting your file has to be loaded via an UpdateColors Action rather than an UpdateDatabase Action.

InGame (code) Table Definitions added through an XML file C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data\Schema/Color_Tables.xml
Code:
<GameData>
	<Table name="Colors">
		<Column name="Type" type="text" notnull="true" primarykey="true"/>
		<Column name="Color" type="text"/>
		<Column name="Red" type="float"/>
		<Column name="Green" type="float"/>
		<Column name="Blue" type="float"/>
		<Column name="Alpha" type="float"/>
	</Table>

	<Table name="PlayerColors">
		<Column name="Type" type="text" notnull="true" primarykey="true" />
		<Column name="Usage" type="text" notnull="true" />
		<Column name="PrimaryColor" type="text" notnull="true" />
		<Column name="SecondaryColor" type="text" notnull="true" />
		<Column name="TextColor" type="text" />
	</Table>
</GameData>
"Colors" Database tables added via C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\Base\Assets\Database\ColorManager.sql
Code:
CREATE TABLE 'Colors'(
	'Type' TEXT NOT NULL,
	'Color' TEXT NOT NULL,
	PRIMARY KEY('Type')
);

CREATE TABLE 'PlayerColors'(
	'Type' TEXT NOT NULL, 
	'Usage' TEXT NOT NULL, 
	'PrimaryColor' TEXT NOT NULL, 
	'SecondaryColor' TEXT NOT NULL, 
	'Alt1PrimaryColor' TEXT,
	'Alt1SecondaryColor' TEXT,
	'Alt2PrimaryColor' TEXT,
	'Alt2SecondaryColor' TEXT,
	'Alt3PrimaryColor' TEXT,
	'Alt3SecondaryColor' TEXT,
	PRIMARY KEY ('Type')
);
Spoiler :
None of this is the least bit confusing to anyone. No! Really! I'm being serious here!
 
Last edited:
Thanks! I knew it had to be something basic that I just wasn't getting. Works like a charm. Now I can see the civ jerseys in all their bea... oh god... what have I done.

SwissJerseyTest.jpg

Some slight adjustments will be in order. Particularly on that last one, haha.
 
A friend asked me if the AI could be modded to never declare war and never accept a peace deal. The purpose would be for team games where the teams are a mix of human and AI players, so that only the human players will determine when their team goes to war or accepts peace.

I am not familiar with the Civ6 AI yet. Can someone point me to what files I would need to change? Or is this beyond the scope of what can be accomplished without DLL access? Is there any guides on modding the Civ6 AI? I am hoping this is possible without having an impact on how many units the AI builds or things like that.
 
Canada cannot declare surprise war. This is accomplished via a Modifier. A quick look at the "Diploactions" however does not show one unified "Declare War", so on the declare war side you would have to first copy/paste everything to do with Canada's "No Surprise War" trait-modifier, edit to make a new unique ModifierID (not ModifierType) with a requirement that it only applies to major civilizations who are not humans, and then copy that for all the different War-Declaration "Diploactions". Make Peace is simple, it is merely DIPLOACTION_MAKE_PEACE without the numerous different versions of war-source inherently attached, and covers all cases regardless of how the war was started. Whether or not this will lock the other members of the team from making peace I've no idea.

Diploactions are found in Vanilla file
C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data/DiplomaticActions.xml
The expacs add more and you'll have to dig through the files in the Expansion1 and Expansion2 folders at
C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\DLC
Or else look directly at the Database file after loading up a game and then exiting directly to desktop.
 
Canada cannot declare surprise war. This is accomplished via a Modifier. A quick look at the "Diploactions" however does not show one unified "Declare War", so on the declare war side you would have to first copy/paste everything to do with Canada's "No Surprise War" trait-modifier, edit to make a new unique ModifierID (not ModifierType) with a requirement that it only applies to major civilizations who are not humans, and then copy that for all the different War-Declaration "Diploactions". Make Peace is simple, it is merely DIPLOACTION_MAKE_PEACE without the numerous different versions of war-source inherently attached, and covers all cases regardless of how the war was started. Whether or not this will lock the other members of the team from making peace I've no idea.

Diploactions are found in Vanilla file The expacs add more and you'll have to dig through the files in the Expansion1 and Expansion2 folders atOr else look directly at the Database file after loading up a game and then exiting directly to desktop.
Hmm, I need to have a look again at Modifiers then, with this could we lock/unlock dynamically all diplo actions between specific civs, using dummy buildings and a modifier+requirements combination build using SQL based on all available civs in the DB?
 
The LOC text descriptions don't like to begin with blank spaces, and they will be removed.

Is there a way to indent text? Perhaps similar to "[NEWLINE]", so "[SPACE]" or "[INDENT*]" or some such.

* Asterisk added to stop this post getting indented and the word disappearing.
 
The LOC text descriptions don't like to begin with blank spaces, and they will be removed.

Is there a way to indent text? Perhaps similar to "[NEWLINE]", so "[SPACE]" or "[INDENT*]" or some such.

* Asterisk added to stop this post getting indented and the word disappearing.
I use a transparent FontIcon for custom indentation in my mod.
 
Thanks LeeS! I didn't expect that this was something that could be done with the modifier system - the number of things supported by it continues to surprise me. I will experiment with it and see if human players that are teamed up with AI are still able to declare war/make peace.
 
EDIT: Nevermind, I found the solution to the below question. LoadOrder needed to be high enough to overwrite the Expansion2 CItySupport file.

Original post:

I've restarted working on a personal mod I had been tinkering with a while ago, but I seem to have forgotten the proper ModBuddy rituals.

I want to replace CitySupport.lua. After some tinkering with actually trying to change things and nothing seeming to happen, I've tried again with these basic steps:

- Copy the CitySupport.lua from Expansion2/UI/Replacements to my mod (in mod buddy), UI/Replacements/CitySupport.lua
- Add a single 'print("MyMod: replaced CitySupport.lua");' statement to the CitySupport.lua file in my mod, and nothing else, so the file should not contain any errors.
- Add the file to ImportFiles in the ModBuddy project.
- Build the project, and verify that the built mod contains the CitySupport.lua file, and the built .modinfo in the mod's directory contains "UI/Replacements/CitySupport.lua" under both <Files>, and <ImportFiles>
- Start a game with my mod loaded

All of the "old stuff" in my mod merrily reports to Lua.log, so I know the mod is still doing things, however the print statement I added in my own CitySupport.lua does not appear.

Which piece of ModBuddy/LUA black magic voodoo have I forgotten? I am vaguely suspecting it might have something to do with "include" statements (i.e. files in the the game that include CitySupport somehow still include the base CitySupport file, not my modded one), but if that is the case I don't know what I could do about that.
 
Last edited:
I use a transparent FontIcon for custom indentation in my mod.
Thanks. I've decided not to use indentation.

What is the technical name for the text box that appears when hovering the cursor over something, such as an icon?

Is it an infobox?

rEvdFRk.png
 
As far as I've been able to tell it is a time-stamp value of some kind. It is not an internal user ID # for example because it is different in each mod made by the same person. My assumption that it is a timestamp of some kind is based on the fact that the value never goes down when creating a new mod, it only goes up from the last time you built a mod. Rebuild of the same mod results in a higher numerical value. So ==> timestamp assumption.
 
@Deliverator @Wolfdog and other units maker...

Do you know how many models (like warrior A, warrior B, etc...) we can set in an unit Artdef?
 
@Deliverator @Wolfdog and other units maker...

Do you know how many models (like warrior A, warrior B, etc...) we can set in an unit Artdef?

If you mean "How many variant Unit Members can you have?", I don't think there is a limit that I'm aware of. It will just randomly select from the pool of available Variations.
 
Back
Top Bottom