Quick Modding Questions Thread

This log is from my Civ6 (all DLC included, some mods installed including 1 personal mod) when CTD occurred. Currently, CTD is continuously occurring at the beginning of the game.
What information can you (or we) get from this log? Also, What should I do to resolve the error?
Please let me know if there are any other logs needed to resolve the error.
 

Attachments

This log is from my Civ6 (all DLC included, some mods installed including 1 personal mod) when CTD occurred. Currently, CTD is continuously occurring at the beginning of the game.
What information can you (or we) get from this log? Also, What should I do to resolve the error?
Please let me know if there are any other logs needed to resolve the error.
Looks like a file called Kyushu_Config.xml is being loaded in both the FrontEnd and Ingame actions under an UpdateDatabase action-type
Code:
[2221258.215] [Gameplay] ERROR: no such table: Players
[2221258.215] [Gameplay]: In Query - insert into Players('CivilizationAbilityDescription', 'CivilizationAbilityIcon', 'CivilizationAbilityName', 'CivilizationIcon', 'CivilizationName', 'CivilizationType', 'LeaderAbilityDescription', 'LeaderAbilityIcon', 'LeaderAbilityName', 'LeaderIcon', 'LeaderName', 'LeaderType', 'Domain') values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
[2221258.215] [Gameplay]: In XMLSerializer while updating table Players from file Kyushu_Config.xml.
No single file (XML or SQL) can ever be listed under an UpdateDatabase action-trype in both the FrontEnd and the Ingame Actions.

The error specifies [Gameplay] (which is Database.log jargon for an error in InGameActions UpdateDatabase files) and that table "Players" is being used, which is not allowed in the InGameActions, so the file called Kyushu_Config.xml ought only to be loaded in the FrontEnd.


----------------------------------------------

An SQL file that is loading into one of UpdateColors or UpdateIcons has a fatal syntax error as noted by this message in Database.log:
Code:
[2221287.753] [Database] ERROR: near "(": syntax error
Unfortnately Modding.log does not give a reference to any file being loaded at that time (which is common with errors coming from files in UpdateColors). But the error is most likely located in the most recent mod(s) downloaded or enabled.

-------------------------------------------

The first issue would not make the game CTD or shunt back to the game's main menu but the second might very well do so.
 
Last edited:
Hi, quick question about changing plot yields based on adjacent districts:

I've figured out how to make adjacent tiles to a specific district gain yields; for example, tiles adjacent to a Commercial Hub gain +1 gold (with no buildings built in it). However, when a tile is overlapped by 2 adjacent commercial hubs, it still only gains +1 gold. I am certain that the game is probably just checking that as long as the plot is adjacent to a commercial hub (regardless of how many comhub districts are adjacent to it) it will gain +1.

Is there a way to make it so that a plot will gain +1 yield for each adjacent district, so that if a player builds cities close together they can stack the effect? (Similar to how preserve yields can stack)

Below is the code I have so far:
Code:
INSERT INTO TraitModifiers        
        (TraitType,                                                    ModifierId)
VALUES    ('TRAIT_LEADER_MG_SUNNY_LTRAIT',                        'MG_SUNNY_LTRAIT_ALL_GOL_1');
------------------------------------------------------------------------------------------------------------
INSERT INTO Modifiers
        (ModifierId,                                                ModifierType,                            SubjectRequirementSetId)
VALUES    ('MG_SUNNY_LTRAIT_ALL_GOL_1',                        'MODIFIER_PLAYER_ADJUST_PLOT_YIELD',                    'ADJACENT_TO_COMHUB_REQUIREMENTS');
------------------------------------------------------------------------------------------------------------
INSERT INTO ModifierArguments
        (ModifierId,                                                Name,                            Value)
VALUES    ('MG_SUNNY_LTRAIT_ALL_GOL_1',                                'Amount',                        '1'),
        ('MG_SUNNY_LTRAIT_ALL_GOL_1',                                'YieldType',                    'YIELD_GOLD');
------------------------------------------------------------------------------------------------------------
INSERT INTO RequirementSets
        (RequirementSetId,                                            RequirementSetType)
VALUES  ('ADJACENT_TO_COMHUB_REQUIREMENTS',                       'REQUIREMENTSET_TEST_ALL');

INSERT INTO RequirementSetRequirements
        (RequirementSetId,                                            RequirementId)
VALUES  ('ADJACENT_TO_COMHUB_REQUIREMENTS',                        'REQUIREMENT_TILE_ADJ_TO_COMHUB');

INSERT INTO Requirements
        (RequirementId,                                            RequirementType)
VALUES  ('REQUIREMENT_TILE_ADJ_TO_COMHUB',                         'REQUIREMENT_PLOT_ADJACENT_DISTRICT_TYPE_MATCHES');

INSERT INTO RequirementArguments
        (RequirementId,                                                Name,                Value)
VALUES  ('REQUIREMENT_TILE_ADJ_TO_COMHUB',                           'DistrictType',        'DISTRICT_COMMERCIAL_HUB'),
        ('REQUIREMENT_TILE_ADJ_TO_COMHUB',                           'MaxRange',            '1'),
        ('REQUIREMENT_TILE_ADJ_TO_COMHUB',                           'MinRange',            '1'),
        ('REQUIREMENT_TILE_ADJ_TO_COMHUB',                           'MustBeFunctioning',    'TRUE');
If anyone has any insights, I would greatly appreciate it! :)
 
Hello! How to make modifier take effect on all units in borders of single city?

Never mind. But think it may be done by using COLLECTION_UNIT_NEAREST_OWNER_CITY. Actually, I would like to increase terrain movement cost somehow. Is that possible?
 
Hi, quick question about changing plot yields based on adjacent districts:

I've figured out how to make adjacent tiles to a specific district gain yields; for example, tiles adjacent to a Commercial Hub gain +1 gold (with no buildings built in it). However, when a tile is overlapped by 2 adjacent commercial hubs, it still only gains +1 gold. I am certain that the game is probably just checking that as long as the plot is adjacent to a commercial hub (regardless of how many comhub districts are adjacent to it) it will gain +1.

Is there a way to make it so that a plot will gain +1 yield for each adjacent district, so that if a player builds cities close together they can stack the effect? (Similar to how preserve yields can stack)
The Preserve does its thing via table Adjacent_AppealYieldChanges rather than via a modifier
Code:
	<Adjacent_AppealYieldChanges>
		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_FAITH" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_GROVE"/>
		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="2" MaximumValue="3" YieldChange="1" YieldType="YIELD_FAITH" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_CHARMING" BuildingType="BUILDING_GROVE"/>
		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_FOOD" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_GROVE"/>
		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="2" MaximumValue="3" YieldChange="1" YieldType="YIELD_FOOD" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_CHARMING" BuildingType="BUILDING_GROVE"/>
		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_CULTURE" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_GROVE"/>
		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_GOLD" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_SANCTUARY"/>
		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="2" MaximumValue="3" YieldChange="1" YieldType="YIELD_GOLD" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_CHARMING" BuildingType="BUILDING_SANCTUARY"/>
		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_SCIENCE" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_SANCTUARY"/>
		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="2" MaximumValue="3" YieldChange="1" YieldType="YIELD_SCIENCE" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_CHARMING" BuildingType="BUILDING_SANCTUARY"/>
		<Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_PRODUCTION" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_SANCTUARY"/>
	</Adjacent_AppealYieldChanges>
Modifiers that grant effects based on adjacency tend to act in the way you've experienced -- like a boolean yes/no rather than a cummulative for the number of adjacent X Unlike table Adjacency_YieldChanges which inherently will add the effect for each and every adjacent tile if you set the number of tiles needed to "1".

You could try a "Count" RequirementArgument but I am not sure that will actually work for the District Type Matches RequirementType. If it does work you would need one unique modifier for each level of the "Count", along with its needed unique Requirement and set of RequirementArguments. I think RequirementArguments also can use a number of tiles needed argument but I cannot remember the exact "Name" setting you would need and I am not sure a REQUIREMENT_PLOT_ADJACENT_DISTRICT_TYPE_MATCHES would implement it.
 
Last edited:
Hello everyone :)
I am trying to make every unit able to capture cities.
I thought I would have to convert every ranged unit to melee in order to do that - but everytime I change every single aspect of the slinger to the melee counterparts in the "Units.xml" and move the slinger lines into the melee paragraphs the game just crashes. Does anyone know to convert existing ranged units to melee?
 
The Preserve does its thing via table Adjacent_AppealYieldChanges rather than via a modifier
Code:
    <Adjacent_AppealYieldChanges>
        <Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_FAITH" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_GROVE"/>
        <Row DistrictType="DISTRICT_PRESERVE" MinimumValue="2" MaximumValue="3" YieldChange="1" YieldType="YIELD_FAITH" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_CHARMING" BuildingType="BUILDING_GROVE"/>
        <Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_FOOD" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_GROVE"/>
        <Row DistrictType="DISTRICT_PRESERVE" MinimumValue="2" MaximumValue="3" YieldChange="1" YieldType="YIELD_FOOD" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_CHARMING" BuildingType="BUILDING_GROVE"/>
        <Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_CULTURE" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_GROVE"/>
        <Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_GOLD" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_SANCTUARY"/>
        <Row DistrictType="DISTRICT_PRESERVE" MinimumValue="2" MaximumValue="3" YieldChange="1" YieldType="YIELD_GOLD" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_CHARMING" BuildingType="BUILDING_SANCTUARY"/>
        <Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_SCIENCE" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_SANCTUARY"/>
        <Row DistrictType="DISTRICT_PRESERVE" MinimumValue="2" MaximumValue="3" YieldChange="1" YieldType="YIELD_SCIENCE" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_CHARMING" BuildingType="BUILDING_SANCTUARY"/>
        <Row DistrictType="DISTRICT_PRESERVE" MinimumValue="4" MaximumValue="100" YieldChange="2" YieldType="YIELD_PRODUCTION" Unimproved="true" Description="LOC_TOOLTIP_APPEAL_BREATHTAKING" BuildingType="BUILDING_SANCTUARY"/>
    </Adjacent_AppealYieldChanges>
Modifiers that grant effects based on adjacency tend to act in the way you've experienced -- like a boolean yes/no rather than a cummulative for the number of adjacent X Unlike table Adjacency_YieldChanges which inherently will add the effect for each and every adjacent tile if you set the number of tiles needed to "1".

You could try a "Count" RequirementArgument but I am not sure that will actually work for the District Type Matches RequirementType. If it does work you would need one unique modifier for each level of the "Count", along with its needed unique Requirement and set of RequirementArguments. I think RequirementArguments also can use a number of tiles needed argument but I cannot remember the exact "Name" setting you would need and I am not sure a REQUIREMENT_PLOT_ADJACENT_DISTRICT_TYPE_MATCHES would implement it.

I see what you mean, its possible that it might need a count requirement.
However, the Korean civ ability "Three Kingdoms" does a similar thing I am looking for with their Seowons and Mines/Farms (which stack with multiple adjacent Seowons).

Looking through the modifiers used for their ability, I found that it just uses MODIFIER_PLAYER_ADJUST_PLOT_YIELD (the modifier I am using currently) and two Requirements; one for checking adjacent district (REQUIREMENT_PLOT_ADJACENT_DISTRICT_TYPE_MATCHES) which is the Requirement I am using for my own, as well as (REQUIRES_PLOT_HAS_MINE) which I wouldn't need since I want my districts to apply the yield regardless of improvements/features.

However, I also see that the Korean ability also adds values into 2 tables; Improvement_Adjacencies and Adjacent_YieldChanges.
Code:
-<Improvement_Adjacencies>

<Row YieldChangeId="Mine_ScienceSeowonAdjacency" ImprovementType="IMPROVEMENT_MINE"/>

<Row YieldChangeId="Farm_FoodSeowonAdjacency" ImprovementType="IMPROVEMENT_FARM"/>

</Improvement_Adjacencies>


-<Adjacency_YieldChanges>

<Row Description="Placeholder" AdjacentDistrict="DISTRICT_SEOWON" TilesRequired="1" YieldChange="1" YieldType="YIELD_SCIENCE" ID="Mine_ScienceSeowonAdjacency"/>

<Row Description="Placeholder" AdjacentDistrict="DISTRICT_SEOWON" TilesRequired="1" YieldChange="1" YieldType="YIELD_FOOD" ID="Farm_FoodSeowonAdjacency"/>

</Adjacency_YieldChanges>

How would I go about implementing this? Would I be able to add something like this into my own mod?
Code:
INSERT INTO Adjacency_YieldChanges
        (Description,        AdjacentDistrict,            TilesRequired,        YieldChange,        YieldType,        ID)
VALUES  ('Placeholder',      'DISTRICT_PRESERVE',        '1',                '1',                'YIELD_CULTURE',   Null);

I think I might be onto something, I'm just unsure on how to exactly execute it.
 
The Seowon stacking works because it is an Adjacency_YieldChange implemented via table Improvement_Adjacencies. In order to make the Adjacency_YieldChange work for a non-district plot, it must be tied to an improvement, and the YieldChangeId must be linked to that improvement in table Improvement_Adjacencies
Code:
INSERT INTO Adjacency_YieldChanges
	(ID, Description, YieldType, YieldChange, TilesRequired, AdjacentDistrict)
VALUES	('Farm_LRS_CampusAdjacency','Placeholder','YIELD_FOOD',1,1,'DISTRICT_CAMPUS');

INSERT INTO Improvement_Adjacencies
	(ImprovementType, YieldChangeId)
VALUES	('IMPROVEMENT_FARM','Farm_LRS_CampusAdjacency');
You cannot have "null" as the ID in table Adjacency_YieldChanges
Code:
CREATE TABLE "Adjacency_YieldChanges" (
		"ID" TEXT NOT NULL,
               ...etc....
 
Code:
<ModifierId>TRAIT_MINES_SCIENCE_SEOWON </ModifierId>
Isn't actually implemented. It is defined in the Exp1 Major Civs file but then never attached to any trait, building, improvement, etc.

I think it may have been implemented at one time but was removed from the "active deck" by one of the patches. Probably because Firaxis realized it would not stack when stemming from a Modifier.
 
The Seowon stacking works because it is an Adjacency_YieldChange implemented via table Improvement_Adjacencies. In order to make the Adjacency_YieldChange work for a non-district plot, it must be tied to an improvement, and the YieldChangeId must be linked to that improvement in table Improvement_Adjacencies
Code:
INSERT INTO Adjacency_YieldChanges
    (ID, Description, YieldType, YieldChange, TilesRequired, AdjacentDistrict)
VALUES    ('Farm_LRS_CampusAdjacency','Placeholder','YIELD_FOOD',1,1,'DISTRICT_CAMPUS');

INSERT INTO Improvement_Adjacencies
    (ImprovementType, YieldChangeId)
VALUES    ('IMPROVEMENT_FARM','Farm_LRS_CampusAdjacency');
You cannot have "null" as the ID in table Adjacency_YieldChanges
Code:
CREATE TABLE "Adjacency_YieldChanges" (
        "ID" TEXT NOT NULL,
               ...etc....
Ah, that makes sense. Yeah, it looks like it'll probably take a count requirement, if its even possible. Very helpful information, nonetheless. Many thanks! :)
 
Okay bear with me, how do I change the name of my mod folder without breaking everything? Am I just stuck with what I named it?
unknown.png

I imagine everything containing "Test" would have to be edited but I don't know if the modbuddy is gonna like that.
 
Okay bear with me, how do I change the name of my mod folder without breaking everything? Am I just stuck with what I named it?
unknown.png

I imagine everything containing "Test" would have to be edited but I don't know if the modbuddy is gonna like that.

In my opinion, is better to modify all you want in the file system, then when done, make a new clean mod in ModBuddy.
Then open in file explorer, copy your previous files and folders to that new brand mod folder.
Then finally at mobuddy add your items to the project.
 
I created a custom civ in Modbuddy, built it, and it appeared in the create game screen, but when I pressed start game, an error message popped up after a few seconds saying "There was an error starting the game. We recommend disabling any mods and trying again. Error- One or more mods failed to load content" and then it gives me the option to manage mods or close. Does anyone know a solution to this? I'm using MC's Master Template btw.
 
Your InGame code is no good. Look in Database.log for error messages. Then compare the timestamps at the beginnings of these messages for similar timestamps in the file Modding.log which will give you a better idea which file failed to load properly.
\Documents\My Games\Sid Meier's Civilization VI\Logs[/quote ]is where these error logging files can be found on Windows machines..
The logging messages in Modding.log will generally have the same timestamp or a slightly smaller numerical timestamp as compared to those found in Database.log
 
Your InGame code is no good. Look in Database.log for error messages. Then compare the timestamps at the beginnings of these messages for similar timestamps in the file Modding.log which will give you a better idea which file failed to load properly.
The logging messages in Modding.log will generally have the same timestamp or a slightly smaller numerical timestamp as compared to those found in Database.log
Thanks. What do I do when I've found the file?
 
I tacked on a movement mod on another mod, but I get the error
Code:
[Configuration] ERROR: no such table: Units
I'm guessing Units is in another database, but how do I get it to update the right database? I couldn't figure it out

the mod is
Code:
UPDATE Units SET BaseMoves = BaseMoves + 1;
in an SQL file
 
One SQL file is set to load in the wrong Database in your mod.

There is no Units table available in [Configuration] (ie <FrontEndActions>), file must be set for <InGameActions>
 
Thanks. What do I do when I've found the file?
What does Database.log report for errors? Without knowing what sort of errors you are getting it is nigh on to impossible to respond meaningfully.

You might have incorrect SQL (or XML) syntax. Missing commas or semi-colons where necessary or just fundamental code mistakes stemming from not have a good enough grasp on how database coding works, and what the various database-tables used in the game require and accept. These kinds of mistakes usually result for SQL files with messages like
near ")": syntax error
So look through database log for message saying "near" something there is a syntax error. "Near" in database.log lingo means previous to but that does not mean directly before an indicated character symbol. Sometimes the indicated error can be several lines before the indicated character. Database.log reports the "nearest" thing it can understand before the syntax error.

You might have incorrect ModBuddy / Modino file procedures

You might simply have typo mismatches such as calling something UNIT_CHEESEBURGLER in one place and UNIT_CHEESEBURLAR elsewhere. This will usually result in Invalid Reference messages in Database.log

You might have tried to add something to the game which it already has, such as a unit called UNIT_SETTLER. This sort of thing will always show up in Database.log as a Unique Constraint error message.

These are common types of errors that have probably come up with pointers to the needed solution earlier in this thread.
 
Last edited:
Back
Top Bottom