Help with issues that I don't know how to fix

679x

Warlord
Joined
Mar 30, 2017
Messages
289
I'm trying to make a custom Andorra civilization, but am getting errors that I don't know how to fix.

I am able to play as my mod, but the leader and civilization abilities aren't working. In the Database log it says "unique constraint error" and "no such table: Types" or something like that. The unique constraint error apparently is in the ModifierArguments section?

I don't know how to fix these errors. I thought unique constraint errors were from the same code being in multiple places, but I don't see where that happens. I also thought the "no such table: Types" would be from forgetting to have a Types table or forgetting to put something in said table, but I don't see any mistakes with that either, so I'm at a loss.

Unfortunately, I can't attach the mod file, because this website says the file is too large. So, I will copy the code in the files where the errors seem to be occurring. Hopefully this will be enough for someone to diagnose the problem.

Spoiler Problem File #1: Unique Building :

<?xml version="1.0" encoding="utf-8"?>
<GameInfo>

<Types>
<Row Type="BUILDING_CW_CASA" Kind="KIND_BUILDING"/>
</Types>

<Buildings>
<Row BuildingType="BUILDING_CW_CASA" Name="LOC_BUILDING_CW_CASA_NAME" Description="LOC_BUILDING_CW_CASA_DESCRIPTION" PrereqTech="TECH_CASTLES" PrereqDistrict="DISTRICT_CITY_CENTER" PurchaseYield="YIELD_GOLD" Cost="200" AdvisorType="ADVISOR_GENERIC" Maintenance="0" Housing="2" TraitType="TRAIT_CIVILIZATION_BUILDING_CW_CASA"/>
</Buildings>

<Building_YieldChanges>
<Row BuildingType="BUILDING_CW_CASA" YieldType="YIELD_CULTURE" YieldChange="1"/>
</Building_YieldChanges>

<Building_GreatPersonPoints>
<Row BuildingType="BUILDING_CW_CASA" GreatPersonClassType="GREAT_PERSON_CLASS_WRITER" PointsPerTurn="1"/>
</Building_GreatPersonPoints>

<Building_GreatWorks>
<Row BuildingType="BUILDING_CW_CASA" GreatWorkSlotType="GREATWORKSLOT_WRITING" NumSlots="1"/>
</Building_GreatWorks>



</GameInfo>


This next spoiler contains the section of the GameDefines code involving custom leader traits and civilization traits. I suspect there is a problem coming from here too. I wish I could upload the entire mod file but it just isn't letting me because the file is apparently too large.
Spoiler Section of Problem File #2: Unique Civ/Leader Traits :


--==========================================================================================================================
-- LEADERS: TRAITS
--==========================================================================================================================
-- Types
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Types
(Type, Kind)
VALUES ('TRAIT_LEADER_CW_ROGER_BERNARD_PAREAGE', 'KIND_TRAIT');
--------------------------------------------------------------------------------------------------------------------------
-- Traits
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Traits
(TraitType, Name, Description)
VALUES ('TRAIT_LEADER_CW_ROGER_BERNARD_PAREAGE', 'LOC_TRAIT_LEADER_CW_ROGER_BERNARD_PAREAGE_NAME', 'LOC_TRAIT_LEADER_CW_ROGER_BERNARD_PAREAGE_DESCRIPTION');
--------------------------------------------------------------------------------------------------------------------------
-- TraitModifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO TraitModifiers
(TraitType, ModifierId)
VALUES ('TRAIT_LEADER_CW_ROGER_BERNARD_PAREAGE', 'CW_ROGER_BERNARD_PAREAGE_CULTURE');
--------------------------------------------------------------------------------------------------------------------------
-- Modifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Modifiers
(ModifierId, ModifierType)
VALUES ('CW_ROGER_BERNARD_PAREAGE_CULTURE', 'MODIFIER_PLAYER_ADJUST_YIELD_CHANGE_PER_USED_INFLUENCE_TOKEN');
--------------------------------------------------------------------------------------------------------------------------
-- ModifierArguments
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO ModifierArguments
(ModifierId, Name, Value)
VALUES ('CW_ROGER_BERNARD_PAREAGE_CULTURE', 'YieldType', 'YIELD_CULTURE'),
('CW_ROGER_BERNARD_PAREAGE_CULTURE', 'Amount', '1');












--==========================================================================================================================
-- CIVILIZATIONS: TRAITS
--==========================================================================================================================
-- Types
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Types
(Type, Kind)
VALUES ('TRAIT_CIVILIZATION_BUILDING_CW_CASA', 'KIND_TRAIT'),
('TRAIT_CIVILIZATION_CW_PYRENEES', 'KIND_TRAIT'),
('MODIFIER_CW_PLAYER_CITIES_TERRAIN_ADJACENCY', 'KIND_MODIFIER');
--------------------------------------------------------------------------------------------------------------------------
-- Traits
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Traits
(TraitType, Name, Description)
VALUES ('TRAIT_CIVILIZATION_BUILDING_CW_CASA', 'LOC_TRAIT_CIVILIZATION_BUILDING_CW_CASA_NAME', 'LOC_TRAIT_CIVILIZATION_BUILDING_CW_CASA_DESCRIPTION'),
('TRAIT_CIVILIZATION_CW_PYRENEES', 'LOC_TRAIT_CIVILIZATION_CW_PYRENEES_NAME', 'LOC_TRAIT_CIVILIZATION_CW_PYRENEES_DESCRIPTION');
--------------------------------------------------------------------------------------------------------------------------
-- TraitModifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO TraitModifiers
(TraitType, ModifierId)
VALUES ('TRAIT_CIVILIZATION_CW_PYRENEES', 'CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN'),
('TRAIT_CIVILIZATION_CW_PYRENEES', 'CW_TRAIT_PYRENEES_GRASS_MOUNTAIN'),
('TRAIT_CIVILIZATION_CW_PYRENEES', 'CW_TRAIT_PYRENEES_DESERT_MOUNTAIN'),
('TRAIT_CIVILIZATION_CW_PYRENEES', 'CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN'),
('TRAIT_CIVILIZATION_CW_PYRENEES', 'CW_TRAIT_PYRENEES_SNOW_MOUNTAIN'),
('TRAIT_CIVILIZATION_CW_PYRENEES', 'CW_TRAIT_PYRENEES_PALACE_SLOTS');
--------------------------------------------------------------------------------------------------------------------------
-- DynamicModifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT OR REPLACE INTO DynamicModifiers
(ModifierType, CollectionType, EffectType)
VALUES ('MODIFIER_CW_PLAYER_CITIES_TERRAIN_ADJACENCY', 'COLLECTION_PLAYER_CITIES', 'EFFECT_TERRAIN_ADJACENCY');
--------------------------------------------------------------------------------------------------------------------------
-- Modifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Modifiers
(ModifierId, ModifierType)
VALUES ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
('CW_TRAIT_PYRENEES_PALACE_SLOTS', 'MODIFIER_PLAYER_CITIES_ADJUST_EXTRA_GREAT_WORK_SLOTS');
--------------------------------------------------------------------------------------------------------------------------
-- ModifierArguments
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO ModifierArguments
(ModifierId, Name, Value)
VALUES ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'TerrainType', 'TERRAIN_PLAINS_MOUNTAIN'),
('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'YieldType', 'YIELD_CULTURE'),
('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'Amount', '2'),

('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'TerrainType', 'TERRAIN_PLAINS_MOUNTAIN'),
('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'YieldType', 'YIELD_GOLD'),
('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'Amount', '2'),

('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'TerrainType', 'TERRAIN_PLAINS_MOUNTAIN'),
('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'YieldType', 'YIELD_PRODUCTION'),
('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'Amount', '2'),


('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'TerrainType', 'TERRAIN_GRASS_MOUNTAIN'),
('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'YieldType', 'YIELD_CULTURE'),
('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'Amount', '2'),

('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'TerrainType', 'TERRAIN_GRASS_MOUNTAIN'),
('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'YieldType', 'YIELD_GOLD'),
('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'Amount', '2'),

('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'TerrainType', 'TERRAIN_GRASS_MOUNTAIN'),
('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'YieldType', 'YIELD_PRODUCTION'),
('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'Amount', '2'),


('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'TerrainType', 'TERRAIN_DESERT_MOUNTAIN'),
('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'YieldType', 'YIELD_CULTURE'),
('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'Amount', '2'),

('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'TerrainType', 'TERRAIN_DESERT_MOUNTAIN'),
('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'YieldType', 'YIELD_GOLD'),
('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'Amount', '2'),

('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'TerrainType', 'TERRAIN_DESERT_MOUNTAIN'),
('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'YieldType', 'YIELD_PRODUCTION'),
('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'Amount', '2'),


('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'TerrainType', 'TERRAIN_TUNDRA_MOUNTAIN'),
('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'YieldType', 'YIELD_CULTURE'),
('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'Amount', '2'),

('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'TerrainType', 'TERRAIN_TUNDRA_MOUNTAIN'),
('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'YieldType', 'YIELD_GOLD'),
('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'Amount', '2'),

('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'TerrainType', 'TERRAIN_TUNDRA_MOUNTAIN'),
('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'YieldType', 'YIELD_PRODUCTION'),
('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'Amount', '2'),


('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'TerrainType', 'TERRAIN_SNOW_MOUNTAIN'),
('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'YieldType', 'YIELD_CULTURE'),
('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'Amount', '2'),

('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'TerrainType', 'TERRAIN_SNOW_MOUNTAIN'),
('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'YieldType', 'YIELD_GOLD'),
('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'Amount', '2'),

('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'TerrainType', 'TERRAIN_SNOW_MOUNTAIN'),
('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'YieldType', 'YIELD_PRODUCTION'),
('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'Amount', '2'),


('CW_TRAIT_PYRENEES_PALACE_SLOTS', 'BuildingType', 'BUILDING_PALACE'),
('CW_TRAIT_PYRENEES_PALACE_SLOTS', 'GreatWorkSlotType', 'GREATWORKSLOT_PALACE'),
('CW_TRAIT_PYRENEES_PALACE_SLOTS', 'Amount', '2');
--------------------------------------------------------------------------------------------------------------------------
-- Types
--------------------------------------------------------------------------------------------------------------------------
INSERT OR REPLACE INTO Types
(Type, Kind)
VALUES ('MODIFIER_CW_PLAYER_CITIES_TERRAIN_ADJACENCY', 'KIND_MODIFIER');

--------------------------------------------------------------------------------------------------------------------------
-- LeaderTraits
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO LeaderTraits
(LeaderType, TraitType)
VALUES ('LEADER_CW_ROGER_BERNARD', 'TRAIT_LEADER_CW_ROGER_BERNARD_PAREAGE');



----------------------------------------------------------------------------------------------------------------------------
-- CivilizationTraits
----------------------------------------------------------------------------------------------------------------------------
INSERT INTO CivilizationTraits
(TraitType, CivilizationType)
VALUES ('TRAIT_CIVILIZATION_BUILDING_CW_CASA', 'CIVILIZATION_CW_ANDORRA'),
('TRAIT_CIVILIZATION_CW_PYRENEES', 'CIVILIZATION_CW_ANDORRA');








As you can probably tell from that code, I am trying to give my civ a Culture, Gold, and Production bonus in cities settled adjacent to Mountain tiles. I posted another thread on this asking how this can be done, and I received responses saying it probably wasn't possible.

HOWEVER, I found an Ethiopia mod that gives Faith bonuses in cities settled adjacent to Mountains (or Hills). So, using that as a guideline, I went ahead and wrote my own code that should work the same way as the Ethiopia mod's code, but with different bonuses. If the Ethiopia mod works, mine should too, right? I must've done something wrong.

If necessary for diagnosing the problem, ask for another part of the code and I will provide it. As I said before, this website simply isn't letting me upload the entire mod file and that's why I'm just copying and pasting parts of code onto this thread.

To recap, the problem is that I am getting unique constraint errors (probably in ModifierArguments in problem file #2?) and "no such table: Types" (in the Building file, which is problem file #1).

If someone can help me out and find the problem, it'd be greatly appreciated. I really want to learn how to mod without needing help every time I try, but at least I am [kind of] learning. Hopefully in the future I'll have my own set of custom civilizations and leaders that actually WORK lol

Thanks in advance :)
 
Here is the database log:

[512527.599] [Localization]: Validating Foreign Key Constraints...
[512527.668] [Localization]: Passed Validation.
[512527.840] [Configuration]: Validating Foreign Key Constraints...
[512527.840] [Configuration]: Passed Validation.
[512541.751] [FullTextSearch]: Initializing FullTextSearch
[512544.841] [Gameplay]: Validating Foreign Key Constraints...
[512544.859] [Gameplay]: Passed Validation.
[512546.779] [Configuration] ERROR: no such table: Types
[512546.779] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
[512546.779] [Configuration]: In XMLSerializer while updating table Types from file Joshs_Template_Buildings.xml.
[512547.029] [Configuration]: Validating Foreign Key Constraints...
[512547.029] [Configuration]: Passed Validation.
[512573.883] [FullTextSearch]: FTS - Creating Context
[512577.004] [FullTextSearch]: FTS - Creating Context
[512638.500] [Configuration] ERROR: no such table: Types
[512638.509] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
[512638.509] [Configuration]: In XMLSerializer while updating table Types from file Joshs_Template_Buildings.xml.
[512638.518] [Configuration]: Validating Foreign Key Constraints...
[512638.518] [Configuration]: Passed Validation.
[512642.020] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
[512642.020] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
[512642.141] [Gameplay]: Validating Foreign Key Constraints...
[512642.161] [Gameplay]: Passed Validation.
[512697.048] [FullTextSearch]: FTS - Creating Context
[512697.843] [FullTextSearch]: FTS - Creating Context
[512701.265] [FullTextSearch]: FTS - Creating Context
[513210.855] [FullTextSearch]: FullTextSearch - Shutting down
 
Try the code below for your building...
Code:
--==========================================================================================================================
-- Districts
--==========================================================================================================================
-- Types
-------------------------------------   
INSERT INTO Types   
        (Type,                                            Kind)
VALUES    ('BUILDING_CW_CASA',                        'KIND_BUILDING');
-----------------------------------------------------------------------------------
-- Buildings
-----------------------------------------------------------------------------------
INSERT INTO Buildings
            (BuildingType,            Name,                            Description,                        PrereqCivic,    PrereqDistrict,            PurchaseYield,    Cost,    AdvisorType,        Maintenance,    Housing,    TraitType)
VALUES        ('BUILDING_CW_CASA',    'LOC_BUILDING_CW_CASA_NAME',    'LOC_BUILDING_CW_CASA_DESCRIPTION',    'TECH_CASTLES', 'DISTRICT_CITY_CENTER', 'YIELD_GOLD',    200,    'ADVISOR_GENERIC',    0,                2,            'TRAIT_CIVILIZATION_BUILDING_CW_CASA');
-----------------------------------------------------------------------------------
-- Building_YieldChanges
-----------------------------------------------------------------------------------
INSERT INTO Building_YieldChanges
            (BuildingType,            YieldType,            YieldChange)
VALUES        ('BUILDING_CW_CASA',    'YIELD_CULTURE',    1);
-----------------------------------------------------------------------------------
-- Building_GreatPersonPoints
-----------------------------------------------------------------------------------
INSERT INTO Building_GreatPersonPoints
            (BuildingType,            GreatPersonClassType,            PointsPerTurn)
VALUES        ('BUILDING_CW_CASA',    'GREAT_PERSON_CLASS_WRITER',    1);
-----------------------------------------------------------------------------------
-- Building_GreatWorks
-----------------------------------------------------------------------------------
INSERT INTO Building_GreatWorks
            (BuildingType,            GreatWorkSlotType,            NumSlots)
VALUES        ('BUILDING_CW_CASA',    'GREATWORKSLOT_WRITING',    1);
--==========================================================================================================================
--==========================================================================================================================

If the above doesn't work, upload the mod folder. Take out the assets and textures (if any) and just upload the core files needed for the mod to run. It would be easier to trouble shoot.
 
Last edited:
Try the code below for your building...
Code:
--==========================================================================================================================
-- Districts
--==========================================================================================================================
-- Types
------------------------------------- 
INSERT INTO Types 
        (Type,                                            Kind)
VALUES    ('BUILDING_CW_CASA',                        'KIND_BUILDING');
-----------------------------------------------------------------------------------
-- Buildings
-----------------------------------------------------------------------------------
INSERT INTO Buildings
            (BuildingType,            Name,                            Description,                        PrereqCivic,    PrereqDistrict,            PurchaseYield,    Cost,    AdvisorType,        Maintenance,    Housing,    TraitType)
VALUES        ('BUILDING_CW_CASA',    'LOC_BUILDING_CW_CASA_NAME',    'LOC_BUILDING_CW_CASA_DESCRIPTION',    'TECH_CASTLES', 'DISTRICT_CITY_CENTER', 'YIELD_GOLD',    200,    'ADVISOR_GENERIC',    0,                2,            'TRAIT_CIVILIZATION_BUILDING_CW_CASA');
-----------------------------------------------------------------------------------
-- Building_YieldChanges
-----------------------------------------------------------------------------------
INSERT INTO Building_YieldChanges
            (BuildingType,            YieldType,            YieldChange)
VALUES        ('BUILDING_CW_CASA',    'YIELD_CULTURE',    1);
-----------------------------------------------------------------------------------
-- Building_GreatPersonPoints
-----------------------------------------------------------------------------------
INSERT INTO Building_GreatPersonPoints
            (BuildingType,            GreatPersonClassType,            PointsPerTurn)
VALUES        ('BUILDING_CW_CASA',    'GREAT_PERSON_CLASS_WRITER',    1);
-----------------------------------------------------------------------------------
-- Building_GreatWorks
-----------------------------------------------------------------------------------
INSERT INTO Building_GreatWorks
            (BuildingType,            GreatWorkSlotType,            NumSlots)
VALUES        ('BUILDING_CW_CASA',    'GREATWORKSLOT_WRITING',    1);
--==========================================================================================================================
--==========================================================================================================================

If the above doesn't work, upload the mod folder. Take out the assets and textures (if any) and just upload the core files needed for the mod to run. It would be easier to trouble shoot.
Thanks, I will try that tomorrow.

Currently my civ just has custom icons and a leader background and that's it for art. If I simply take those art files out, will the mod still run?

Anybody got any ideas on how to fix the civ and leader abilities, based on the code that I posted in the original thread post?
 
This set of messages in the Database.log is saying that you are trying to load a file into the <FrontEnd>/<Settings> side of the database, but the file contains code that is only valid for the <InGameActions>/<Components> database:
Code:
[512546.779] [Configuration] ERROR: no such table: Types
 [512546.779] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
 [512546.779] [Configuration]: In XMLSerializer while updating table Types from file Joshs_Template_Buildings.xml.
Table <Types> is only valid in the Gameplay side of the database, so any XML or SQL file that contains table <Types> must be loaded in an action that is either <InGameActions> or <Components> in the modinfo file.

You are getting the Unique Constraint Error because you are repeating (multiple times) the following info within table <ModifierArguments>:
Code:
VALUES ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'TerrainType', 'TERRAIN_PLAINS_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'YieldType', 'YIELD_CULTURE'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'Amount', '2'),

 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'TerrainType', 'TERRAIN_PLAINS_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'YieldType', 'YIELD_GOLD'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'Amount', '2'),
This second occurance of a row with 'CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN' violates the rule that every row within the table must have a unique set of designators for the combination of columns "ModifierId" and "Name". You violate this rule with the second row with 'CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER' and the second row with ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'TerrainType', 'TERRAIN_PLAINS_MOUNTAIN'),, and so on for the other terrain-types. You would need a modifier ID with a name like 'CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN_CULTURE' and 'CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN_GOLD' for the plains-mountains example.

Upload the mod to a file-sharing site such as dropbox, and then in a post add a link to where the mod can be downloaded. For file-sharing sites, mediafire is not really a good site anymore because it is rampant with pop-ups, attempts to trick you into downloading stuff you don't need, and downright malware.
 
Last edited:
This set of messages in the Database.log is saying that you are trying to load a file into the <FrontEnd>/<Settings> side of the database, but the file contains code that is only valid for the <InGameActions>/<Components> database:
Code:
[512546.779] [Configuration] ERROR: no such table: Types
 [512546.779] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
 [512546.779] [Configuration]: In XMLSerializer while updating table Types from file Joshs_Template_Buildings.xml.
Table <Types> is only valid in the Gameplay side of the database, so any XML or SQL file that contains table <Types> must be loaded in an action that is either <InGameActions> or <Components> in the modinfo file.

You are getting the Unique Constraint Error because you are repeating (multiple times) thoe following info within table <ModifierArguments>:{code][/code]


Upload the mod to a file-sharing site such as dropbox, and then in a post add a link to where the mod can be downloaded. For file-sharing sites, mediafire is not really a good site anymore because it is rampant with pop-ups, attempts to trick you into downloading stuff you don't need, and downright malware.
Thank you, in my reply to KoubaK I said I'd try it 'tomorrow', but that didn't happen because A: I forgot about it, lol, and B: I was busy making a 2nd civilization, Madagascar, which ended up giving me the same issues...

So whenever I have the time/desire to code again, I will do what you said and see what happens!

By the way, where you said "you are repeating (multiple times) the following info within table <ModifierArguments>", what code are you referring to?
 
Thank you, in my reply to KoubaK I said I'd try it 'tomorrow', but that didn't happen because A: I forgot about it, lol, and B: I was busy making a 2nd civilization, Madagascar, which ended up giving me the same issues...

So whenever I have the time/desire to code again, I will do what you said and see what happens!

By the way, where you said "you are repeating (multiple times) the following info within table <ModifierArguments>", what code are you referring to?
The code in your original post, in the second spoiler.
Spoiler :
Code:
--------------------------------------------------------------------------------------------------------------------------
 -- ModifierArguments
 --------------------------------------------------------------------------------------------------------------------------
 INSERT INTO ModifierArguments
 (ModifierId, Name, Value)
 VALUES ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'TerrainType', 'TERRAIN_PLAINS_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'YieldType', 'YIELD_CULTURE'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'Amount', '2'),

 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'TerrainType', 'TERRAIN_PLAINS_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'YieldType', 'YIELD_GOLD'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'Amount', '2'),

 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'TerrainType', 'TERRAIN_PLAINS_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'YieldType', 'YIELD_PRODUCTION'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'Amount', '2'),


 ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'TerrainType', 'TERRAIN_GRASS_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'YieldType', 'YIELD_CULTURE'),
 ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'Amount', '2'),

 ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'TerrainType', 'TERRAIN_GRASS_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'YieldType', 'YIELD_GOLD'),
 ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'Amount', '2'),

 ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'TerrainType', 'TERRAIN_GRASS_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'YieldType', 'YIELD_PRODUCTION'),
 ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN', 'Amount', '2'),


 ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'TerrainType', 'TERRAIN_DESERT_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'YieldType', 'YIELD_CULTURE'),
 ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'Amount', '2'),

 ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'TerrainType', 'TERRAIN_DESERT_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'YieldType', 'YIELD_GOLD'),
 ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'Amount', '2'),

 ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'TerrainType', 'TERRAIN_DESERT_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'YieldType', 'YIELD_PRODUCTION'),
 ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN', 'Amount', '2'),


 ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'TerrainType', 'TERRAIN_TUNDRA_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'YieldType', 'YIELD_CULTURE'),
 ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'Amount', '2'),

 ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'TerrainType', 'TERRAIN_TUNDRA_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'YieldType', 'YIELD_GOLD'),
 ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'Amount', '2'),

 ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'TerrainType', 'TERRAIN_TUNDRA_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'YieldType', 'YIELD_PRODUCTION'),
 ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN', 'Amount', '2'),


 ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'TerrainType', 'TERRAIN_SNOW_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'YieldType', 'YIELD_CULTURE'),
 ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'Amount', '2'),

 ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'TerrainType', 'TERRAIN_SNOW_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'YieldType', 'YIELD_GOLD'),
 ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'Amount', '2'),

 ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'TerrainType', 'TERRAIN_SNOW_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'YieldType', 'YIELD_PRODUCTION'),
 ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN', 'Amount', '2'),

Also when you want to wrap actual code, use [.code]xml code goes here[./code] without the period-signs in front of "code" and "/code".

Doing so will give you this
Code:
xml code goes here
 
Last edited:
This set of messages in the Database.log is saying that you are trying to load a file into the <FrontEnd>/<Settings> side of the database, but the file contains code that is only valid for the <InGameActions>/<Components> database:
Code:
[512546.779] [Configuration] ERROR: no such table: Types
 [512546.779] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
 [512546.779] [Configuration]: In XMLSerializer while updating table Types from file Joshs_Template_Buildings.xml.
Table <Types> is only valid in the Gameplay side of the database, so any XML or SQL file that contains table <Types> must be loaded in an action that is either <InGameActions> or <Components> in the modinfo file.

You are getting the Unique Constraint Error because you are repeating (multiple times) the following info within table <ModifierArguments>:
Code:
VALUES ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'TerrainType', 'TERRAIN_PLAINS_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'YieldType', 'YIELD_CULTURE'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'Amount', '2'),

 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'TerrainType', 'TERRAIN_PLAINS_MOUNTAIN'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'YieldType', 'YIELD_GOLD'),
 ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'Amount', '2'),
This second occurance of a row with 'CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN' violates the rule that every row within the table must have a unique set of designators for the combination of columns "ModifierId" and "Name". You violate this rule with the second row with 'CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'DistrictType', 'DISTRICT_CITY_CENTER' and the second row with ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN', 'TerrainType', 'TERRAIN_PLAINS_MOUNTAIN'),, and so on for the other terrain-types. You would need a modifier ID with a name like 'CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN_CULTURE' and 'CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN_GOLD' for the plains-mountains example.

Upload the mod to a file-sharing site such as dropbox, and then in a post add a link to where the mod can be downloaded. For file-sharing sites, mediafire is not really a good site anymore because it is rampant with pop-ups, attempts to trick you into downloading stuff you don't need, and downright malware.
Ok, so I did what you said, and I am able to play as my civilization with no errors in the database, but unfortunately the unique ability that gives yields from mountains doesn't work. I don't get the bonus yields even though my capital was settled next to a mountain.

--------

This past weekend I took a break from coding my Andorra mod and went to work on a Madagascar one. This one had the same unique constraint error that the Andorra one had, but I was able to fix that in BOTH mods with your help. It also had the same building error. That got fixed too.

However...

I am still having problems with art not working in either mod, and in my Madagascar mod in particular, the leader ability is SUPPOSED to give +1 food from certain districts being adjacent to eachother, but this isn't working. No errors about this in the database log. I will note that the same ability gives +1 culture for Entertainment Complexes being adjacent to other districts, and this works just fine. It's just not working for food. Since no districts or abilities in the official game are giving food from districts, I'm assuming that it's not possible to have districts provide food? Or if it is possible, it just requires more than what I wrote? I can post the Madagascar mod afterward as well if you (or someone else) suspect that it's just a problem with my code.

Anyway, here is the Dropbox link for my Andorra mod, as requested:


Thanks for your help, if it weren't for you and this forum, all I would know how to code is a unique ability that grants an extra policy card slot lol
 
I'm a bit picky.... you mind upload the ModBuddy files instead?
I don't feel like importing all of your files into ModBuddy (I know, I'm lazy!)
They should be in your "Documents\Firaxis ModBuddy\Civilization VI" folder.
Thanks!
 
Code:
--------------------------------------------------------------------------------------------------------------------------
-- DynamicModifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT OR REPLACE INTO DynamicModifiers			
	(ModifierType,						CollectionType,				EffectType)
VALUES	('MODIFIER_CW_PLAYER_CITIES_TERRAIN_ADJACENCY',		'COLLECTION_PLAYER_CITIES',		'EFFECT_TERRAIN_ADJACENCY');

--------------------------------------------------------------------------------------------------------------------------
-- Modifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Modifiers	
	(ModifierId,							ModifierType)
VALUES	('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN_GOLD',			'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
	('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN_CULTURE',			'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
	('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN_PRODUCTION',		'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),

	('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN_GOLD',			'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
	('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN_CULTURE',			'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
	('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN_PRODUCTION',			'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),

	('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN_GOLD',			'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
	('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN_CULTURE',			'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
	('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN_PRODUCTION',		'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),

	('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN_GOLD',			'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
	('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN_CULTURE',			'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
	('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN_PRODUCTION',		'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),

	('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN_GOLD',			'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
	('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN_CULTURE',			'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
	('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN_PRODUCTION',			'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),

	('CW_TRAIT_PYRENEES_PALACE_SLOTS',				'MODIFIER_PLAYER_CITIES_ADJUST_EXTRA_GREAT_WORK_SLOTS');
as compared to Suk's code
Code:
-------------------------------------
-- DynamicModifiers
-------------------------------------					
INSERT OR REPLACE INTO DynamicModifiers			
	(ModifierType,						CollectionType,			EffectType)
VALUES	('MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',	'COLLECTION_PLAYER_CITIES',	'EFFECT_TERRAIN_ADJACENCY');

-- Modifiers
-------------------------------------					
INSERT INTO Modifiers			
	(ModifierId,							ModifierType,							SubjectRequirementSetId)
VALUES	('TRAIT_SUK_SOLOMONIC_DYNASTY_PLAINS_HILLS',			'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',			null),
	('TRAIT_SUK_SOLOMONIC_DYNASTY_PLAINS_MOUNTAIN',			'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',			null),
		
	('TRAIT_SUK_SOLOMONIC_DYNASTY_GRASS_MOUNTAIN',			'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',			null),
	('TRAIT_SUK_SOLOMONIC_DYNASTY_GRASS_HILLS',			'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',			null),
		
	('TRAIT_SUK_SOLOMONIC_DYNASTY_DESERT_MOUNTAIN',			'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',			null),
	('TRAIT_SUK_SOLOMONIC_DYNASTY_DESERT_HILLS',			'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',			null),
		
	('TRAIT_SUK_SOLOMONIC_DYNASTY_TUNDRA_MOUNTAIN',			'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',			null),
	('TRAIT_SUK_SOLOMONIC_DYNASTY_TUNDRA_HILLS',			'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',			null),
		
	('TRAIT_SUK_SOLOMONIC_DYNASTY_SNOW_MOUNTAIN',			'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',			null),
	('TRAIT_SUK_SOLOMONIC_DYNASTY_SNOW_HILLS',			'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',			null);
You aren't getting a database error for this mistake because column "ModifierType" in table "Modifiers" doesn't require a reference to a valid "ModifierType".

In case you still don't see it: 'MODIFIER_CW_PLAYER_CITIES_TERRAIN_ADJACENCY' != 'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'
 
Code:
--------------------------------------------------------------------------------------------------------------------------
-- DynamicModifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT OR REPLACE INTO DynamicModifiers           
    (ModifierType,                        CollectionType,                EffectType)
VALUES    ('MODIFIER_CW_PLAYER_CITIES_TERRAIN_ADJACENCY',        'COLLECTION_PLAYER_CITIES',        'EFFECT_TERRAIN_ADJACENCY');

--------------------------------------------------------------------------------------------------------------------------
-- Modifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Modifiers   
    (ModifierId,                            ModifierType)
VALUES    ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN_GOLD',            'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
    ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN_CULTURE',            'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
    ('CW_TRAIT_PYRENEES_PLAINS_MOUNTAIN_PRODUCTION',        'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),

    ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN_GOLD',            'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
    ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN_CULTURE',            'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
    ('CW_TRAIT_PYRENEES_GRASS_MOUNTAIN_PRODUCTION',            'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),

    ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN_GOLD',            'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
    ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN_CULTURE',            'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
    ('CW_TRAIT_PYRENEES_DESERT_MOUNTAIN_PRODUCTION',        'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),

    ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN_GOLD',            'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
    ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN_CULTURE',            'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
    ('CW_TRAIT_PYRENEES_TUNDRA_MOUNTAIN_PRODUCTION',        'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),

    ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN_GOLD',            'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
    ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN_CULTURE',            'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),
    ('CW_TRAIT_PYRENEES_SNOW_MOUNTAIN_PRODUCTION',            'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'),

    ('CW_TRAIT_PYRENEES_PALACE_SLOTS',                'MODIFIER_PLAYER_CITIES_ADJUST_EXTRA_GREAT_WORK_SLOTS');
as compared to Suk's code
Code:
-------------------------------------
-- DynamicModifiers
-------------------------------------                   
INSERT OR REPLACE INTO DynamicModifiers           
    (ModifierType,                        CollectionType,            EffectType)
VALUES    ('MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',    'COLLECTION_PLAYER_CITIES',    'EFFECT_TERRAIN_ADJACENCY');

-- Modifiers
-------------------------------------                   
INSERT INTO Modifiers           
    (ModifierId,                            ModifierType,                            SubjectRequirementSetId)
VALUES    ('TRAIT_SUK_SOLOMONIC_DYNASTY_PLAINS_HILLS',            'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',            null),
    ('TRAIT_SUK_SOLOMONIC_DYNASTY_PLAINS_MOUNTAIN',            'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',            null),
       
    ('TRAIT_SUK_SOLOMONIC_DYNASTY_GRASS_MOUNTAIN',            'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',            null),
    ('TRAIT_SUK_SOLOMONIC_DYNASTY_GRASS_HILLS',            'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',            null),
       
    ('TRAIT_SUK_SOLOMONIC_DYNASTY_DESERT_MOUNTAIN',            'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',            null),
    ('TRAIT_SUK_SOLOMONIC_DYNASTY_DESERT_HILLS',            'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',            null),
       
    ('TRAIT_SUK_SOLOMONIC_DYNASTY_TUNDRA_MOUNTAIN',            'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',            null),
    ('TRAIT_SUK_SOLOMONIC_DYNASTY_TUNDRA_HILLS',            'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',            null),
       
    ('TRAIT_SUK_SOLOMONIC_DYNASTY_SNOW_MOUNTAIN',            'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',            null),
    ('TRAIT_SUK_SOLOMONIC_DYNASTY_SNOW_HILLS',            'MODIFIER_SUK_PLAYER_CITIES_TERRAIN_ADJACENCY',            null);
You aren't getting a database error for this mistake because column "ModifierType" in table "Modifiers" doesn't require a reference to a valid "ModifierType".

In case you still don't see it: 'MODIFIER_CW_PLAYER_CITIES_TERRAIN_ADJACENCY' != 'MODIFIER_CW_PLAYER_CITIES_DISTRICT_ADJACENCY'
OHHHHHH!!!!! I don't understand how I did that. But thank you, I didn't catch that at all, even though I looked over the code a lot trying to figure out what was wrong...

...Tomorrow I will edit the code and then, finally, it should work. if i don't do anything wrong in the meantime. You're a lifesaver :D

Assuming I won't get any other errors tomorrow, all that remains is the whole art issue. I used a Youtube tutorial and template for making this mod, unfortunately but understandably it doesn't cover modifiers or any part of creating a custom civilization/leader ability, hence my lack of skill in that area. Anyway, I posted a comment asking if the uploader had any idea why my art wouldn't work. The problem with that is that he can't see my code/files to see where I went wrong.

Oh, yea, and the district food thing for my other mod that I mentioned. If I can't get that sorted out I'll probably just change the ability to something else.
 
Hmm, this is weird, I fixed the code so that it uses TERRAIN_ADJACENCY instead of DISTRICT_ADJACENCY. But it still won't work. I'm not receiving any of the bonus yields even though I moved my starting settler until I found a mountain to settle next to, and I even settled my second city adjacent to 3 mountains at once. Nothing.

Database still shows no errors.

What is going on?
 
So I fixed the artwork, everything works now except for this darn mountain adjacency bonus. I don't know why it isn't working... I looked at Sukritact's Ethiopia code because it also has adjacency bonuses for mountains, and tried to write my own code using that as a guideline and mine still won't work. I played as Ethiopia to make sure it was even working properly, which it was. It's just that mine isn't.

Here is a dropbox link for my updated Andorra mod. Once the civilization trait works properly (and possibly is nerfed a bit) my mod should be completed.


To recap for anyone who might be visiting this thread for the first time, I'm trying to make my custom civilization's ability so that it gives yields (per turn) for each mountain tile adjacent to a city center. Unfortunately, this ability isn't working at all, so I don't get any yields when I settle cities next to mountain tiles.

If anyone can figure out what the problem is (from downloading the updated mod file) it'd be greatly appreciated.

Thanks again to those who have helped me out so far.
 
Hmm... so after working on my 2nd mod I found that I couldn't figure out how to get my districts to provide food for adjacent districts. It worked though when I just changed Food to a different yield. There are no districts in the official game that provide food for adjacent districts (or that provide food at all, for that matter).

So now... is it even possible to get districts (e.g. city centre) to provide yields for adjacent mountains, if the yield is something that wouldn't normally be given for adjacent mountains? I'm trying to make a district provide production/gold/food for nearby mountains, but none of those three yields are given in the official game when you have any district adjacent to a mountain. However, Sukritact's Ethiopia gives Faith for adjacent mountains, and it works fine! Why? Because Holy Sites already give Faith for adjacent mountains. (How many times can I say "adjacent mountains"?)

Basically I suspect now that more is required to get a district to provide different-than-usual yields for adjacent terrain. I might have to make it so that my civ's bonus only provides Science for each adjacent mountain, since there is a district that provides science for adjacent mountains.

Or am I wrong about this?

And yes I am aware that this will be my 4th consecutive post...
 
So now... is it even possible to get districts (e.g. city centre) to provide yields for adjacent mountains, if the yield is something that wouldn't normally be given for adjacent mountains? I'm trying to make a district provide production/gold/food for nearby mountains, but none of those three yields are given in the official game when you have any district adjacent to a mountain. However, Sukritact's Ethiopia gives Faith for adjacent mountains, and it works fine! Why? Because Holy Sites already give Faith for adjacent mountains. (How many times can I say "adjacent mountains"?)
I have a wild - and very odd and probably not worth the effort - idea: make a replacement district for the city center that functions the same way but has yields for what you want.
Maybe you could have a custom building that spawns in the city upon founding, like Rome's.

Maybe you can make the city center district so that adjacent mountains will give you adjacent mountain yields, maybe make a custom building that spawns in the City Center (like Rome's) that gives adjacent mountain yields for adjacent mountains. These adjacent mountains would give the adjacent mountain-based building adjacent mountain yields so that if you have adjacent mountains then the adjacent mountains will give adjacent mountain yields. These said adjacent mountains would only give adjacent mountain yields to Andorra.

I think that Adjacent mountains adjacent mountains adjacent mountains adjacent mountains adjacent mountains adjacent mountains adjacent mountains adjacent mountains are a good idea.

(I think I beat you :p)
 
Hmm... so after working on my 2nd mod I found that I couldn't figure out how to get my districts to provide food for adjacent districts. It worked though when I just changed Food to a different yield. There are no districts in the official game that provide food for adjacent districts (or that provide food at all, for that matter).

So now... is it even possible to get districts (e.g. city centre) to provide yields for adjacent mountains, if the yield is something that wouldn't normally be given for adjacent mountains? I'm trying to make a district provide production/gold/food for nearby mountains, but none of those three yields are given in the official game when you have any district adjacent to a mountain. However, Sukritact's Ethiopia gives Faith for adjacent mountains, and it works fine! Why? Because Holy Sites already give Faith for adjacent mountains. (How many times can I say "adjacent mountains"?)

Basically I suspect now that more is required to get a district to provide different-than-usual yields for adjacent terrain. I might have to make it so that my civ's bonus only provides Science for each adjacent mountain, since there is a district that provides science for adjacent mountains.

Or am I wrong about this?

And yes I am aware that this will be my 4th consecutive post...


Yes you can add bonuses for City Centers specific to a civilization. Look at how Brazil gets its adjacency bonuses for Jungle. That should also work for the City Center since it is after all a District.
 
Yes you can add bonuses for City Centers specific to a civilization. Look at how Brazil gets its adjacency bonuses for Jungle. That should also work for the City Center since it is after all a District.
Jungle is a feature, not terrain though. I think the difficulty comes when you try to make terrain adjacency for districts. (Mountains are terrain, not features) It should be fine if I wanted to give faith/science from terrain adjacent to districts, because that's how campuses and holy sites work, but I wonder if it just isn't possible for a different yield than faith or science. Or at least, if it is possible, it probably requires more code that I don't know how to do. But I haven't tested out my theory by changing the yield to science in my mod yet, so I'm just guessing. But...

I have a wild - and very odd and probably not worth the effort - idea: make a replacement district for the city center that functions the same way but has yields for what you want.
Maybe you could have a custom building that spawns in the city upon founding, like Rome's.

Maybe you can make the city center district so that adjacent mountains will give you adjacent mountain yields, maybe make a custom building that spawns in the City Center (like Rome's) that gives adjacent mountain yields for adjacent mountains. These adjacent mountains would give the adjacent mountain-based building adjacent mountain yields so that if you have adjacent mountains then the adjacent mountains will give adjacent mountain yields. These said adjacent mountains would only give adjacent mountain yields to Andorra.

I think that Adjacent mountains adjacent mountains adjacent mountains adjacent mountains adjacent mountains adjacent mountains adjacent mountains adjacent mountains are a good idea.

(I think I beat you :p)
Lol, yes, you certainly did beat me...

But! I read in another post that in the recent Nubia update, they added "CityAdjacentTerrain" which is used for a Nubian scenario building! This is exactly what I can use to make my mod work the way I wanted it to, and with it I'll be able to use your method of having a custom building in city centres, either upon founding, or maybe it can be cheaply built if the city has adjacent mountains. I'm not sure how CityAdjacentTerrain works exactly, and I can't check it out yet because I'm on Mac and the update isn't released for Mac yet :( But thanks for the suggestion, I'll try it once they release the update for Mac :)
 
Jungle is a feature, not terrain though. I think the difficulty comes when you try to make terrain adjacency for districts. (Mountains are terrain, not features) It should be fine if I wanted to give faith/science from terrain adjacent to districts, because that's how campuses and holy sites work, but I wonder if it just isn't possible for a different yield than faith or science. Or at least, if it is possible, it probably requires more code that I don't know how to do. But I haven't tested out my theory by changing the yield to science in my mod yet, so I'm just guessing. But...


Terrain should be possible. It's how the Dance of the Aurora and the Desert Folklore pantheons work.
 
Top Bottom