Newbie needs help with errors (Gamedefines & Icons)

drakthug

Chieftain
Joined
Jul 17, 2021
Messages
4
Ummmm hi I'm new at this :) I've never even posted on a forum like this before lol

I'm trying to make a new Civ and I'm using Joshs_Template with help from friends (Hi Mikey), copying their code and game code etc.

The mod tool isn't giving me any errors and I do see the modded civ in the selection screen but when I try to actually load into a game it fails every time.
The warnings that I'm finding in the Modding.log are:

[3064018.409] UpdateDatabase - Loading Core/Joshs_Template_GameDefines.sql
[3064018.497] Warning: UpdateDatabase - Error Loading SQL.

and

[3064018.505] ModArtLoader - Loading Core/Joshs_Template_Icons.xml
[3064018.505] Warning: ModArtLoader - Could not load file. Unknown extension.

I've been going through these as thoroughly as I can looking for mistakes but I can't figure it out :/ Maybe someone more experienced could look through my modifiers / Icon folder and check if you see anything weird.

For context: The leader trait is supposed to make it so the tiles next to the City Center increase appeal by either 2 or 4 depending on the existing appeal, then to increase Culture, Gold, and Faith yields based on that appeal.

I also have two units (very open to change) and a building in there, and the Civilization trait is borrowed from my friend for place-holding purposes.

Modifiers: 1, 2, 3, 4, 5
Icon
 
Modifiers file #1 -- missing comma in the very last row in the image. This is a fatal syntax error -- nothing else from within the same file will successfully be added to the game's database.

You can zip the actual files and attach the zip, and you can also post code portions in a post using code blocks.

Trying to parse out what else you might be doing wrong is too difficult when you have to swap back and forth between multiple png files and you cannot directly copy the code and paste it into an SQL database viewer program or other utility like Notepad.

And as a final note you should be looking at Database.log as well as modding.log
 
Oh thank you! I didn't catch that missing comma at all, and looking through it again I found another one missing.
I didn't know to check the database log either and I figured out the mod was conflicting with another mod and now I can actually load into the game!

My current problem is the appeal modifiers doesn't seem to be doing anything and I'm not finding any specific errors in the logs relating to it.
I'll try pasting the code here and include a zip of the folder.
Thank you for the advice!

Code:
--------------------------------------------------------------------------------------------------------------------------       
-- TraitModifiers       
--------------------------------------------------------------------------------------------------------------------------           
INSERT INTO TraitModifiers           
        (TraitType,                                                    ModifierId)
VALUES    ('TRAIT_LEADER_HONEY',                        'HONEY_APPEAL_EXTRA'),
        ('TRAIT_LEADER_HONEY',                        'HONEY_DISTRICT_CULTURE_CHARMING'),
        ('TRAIT_LEADER_HONEY',                        'HONEY_DISTRICT_GOLD_CHARMING'),
        ('TRAIT_LEADER_HONEY',                        'HONEY_DISTRICT_FAITH_CHARMING'),
        ('TRAIT_LEADER_HONEY',                        'HONEY_DISTRICT_CULTURE_BREATHTAKING'),
        ('TRAIT_LEADER_HONEY',                        'HONEY_DISTRICT_GOLD_BREATHTAKING'),
        ('TRAIT_LEADER_HONEY',                        'HONEY_DISTRICT_FAITH_BREATHTAKING');
--------------------------------------------------------------------------------------------------------------------------
-- Modifiers
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO Modifiers   
        (ModifierId,                                                ModifierType,                                            SubjectRequirementSetId)
VALUES    ('HONEY_APPEAL_EXTRA',                        'MODIFIER_PLAYER_CITIES_ADJUST_CITY_APPEAL',                    'ADJACENT_TO_CITYCENTER_REQUIREMENTS'),
        ('HONEY_DISTRICT_CULTURE_CHARMING',            'MODIFIER_PLAYER_CITIES_ADJUST_DISTRICT_YIELD_BASED_ON_APPEAL',            Null),
        ('HONEY_DISTRICT_GOLD_CHARMING',            'MODIFIER_PLAYER_CITIES_ADJUST_DISTRICT_YIELD_BASED_ON_APPEAL',            Null),
        ('HONEY_DISTRICT_FAITH_CHARMING',            'MODIFIER_PLAYER_CITIES_ADJUST_DISTRICT_YIELD_BASED_ON_APPEAL',            Null),
        ('HONEY_DISTRICT_CULTURE_BREATHTAKING',        'MODIFIER_PLAYER_CITIES_ADJUST_DISTRICT_YIELD_BASED_ON_APPEAL',            Null),
        ('HONEY_DISTRICT_GOLD_BREATHTAKING',        'MODIFIER_PLAYER_CITIES_ADJUST_DISTRICT_YIELD_BASED_ON_APPEAL',            Null),
        ('HONEY_DISTRICT_FAITH_BREATHTAKING',        'MODIFIER_PLAYER_CITIES_ADJUST_DISTRICT_YIELD_BASED_ON_APPEAL',            Null);
--------------------------------------------------------------------------------------------------------------------------
-- ModifierArguments
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO ModifierArguments
        (ModifierId,                                                    Name,                                Value)
VALUES    ('HONEY_APPEAL_EXTRA',                                'Amount',                            '2'),

        ('HONEY_DISTRICT_CULTURE_CHARMING',                    'Description',                        'LOC_DISTRICT_APPEAL_CULTURE'),
        ('HONEY_DISTRICT_CULTURE_CHARMING',                    'DistrictType',                        'DISTRICT_THEATER'),
        ('HONEY_DISTRICT_CULTURE_CHARMING',                    'RequiredAppeal',                    '2'),
        ('HONEY_DISTRICT_CULTURE_CHARMING',                    'YieldChange',                        '2'),
        ('HONEY_DISTRICT_CULTURE_CHARMING',                    'YieldType',                        'YIELD_CULTURE'),

        ('HONEY_DISTRICT_GOLD_CHARMING',                    'Description',                        'LOC_DISTRICT_APPEAL_GOLD'),
        ('HONEY_DISTRICT_GOLD_CHARMING',                    'DistrictType',                        'DISTRICT_COMMERCIAL_HUB'),
        ('HONEY_DISTRICT_GOLD_CHARMING',                    'RequiredAppeal',                    '2'),
        ('HONEY_DISTRICT_GOLD_CHARMING',                    'YieldChange',                        '2'),
        ('HONEY_DISTRICT_GOLD_CHARMING',                    'YieldType',                        'YIELD_GOLD'),

        ('HONEY_DISTRICT_FAITH_CHARMING',                    'Description',                        'LOC_DISTRICT_APPEAL_FAITH'),
        ('HONEY_DISTRICT_FAITH_CHARMING',                    'DistrictType',                        'DISTRICT_HOLY_SITE'),
        ('HONEY_DISTRICT_FAITH_CHARMING',                    'RequiredAppeal',                    '2'),
        ('HONEY_DISTRICT_FAITH_CHARMING',                    'YieldChange',                        '2'),
        ('HONEY_DISTRICT_FAITH_CHARMING',                    'YieldType',                        'YIELD_FAITH'),

        ('HONEY_DISTRICT_CULTURE_BREATHTAKING',                'Description',                        'LOC_DISTRICT_APPEAL_CULTURE'),
        ('HONEY_DISTRICT_CULTURE_BREATHTAKING',                'DistrictType',                        'DISTRICT_THEATER'),
        ('HONEY_DISTRICT_CULTURE_BREATHTAKING',                'RequiredAppeal',                    '4'),
        ('HONEY_DISTRICT_CULTURE_BREATHTAKING',                'YieldChange',                        '4'),
        ('HONEY_DISTRICT_CULTURE_BREATHTAKING',                'YieldType',                        'YIELD_CULTURE'),

        ('HONEY_DISTRICT_GOLD_BREATHTAKING',                'Description',                        'LOC_DISTRICT_APPEAL_GOLD'),
        ('HONEY_DISTRICT_GOLD_BREATHTAKING',                'DistrictType',                        'DISTRICT_COMMERCIAL_HUB'),
        ('HONEY_DISTRICT_GOLD_BREATHTAKING',                'RequiredAppeal',                    '4'),
        ('HONEY_DISTRICT_GOLD_BREATHTAKING',                'YieldChange',                        '4'),
        ('HONEY_DISTRICT_GOLD_BREATHTAKING',                'YieldType',                        'YIELD_GOLD'),

        ('HONEY_DISTRICT_FAITH_BREATHTAKING',                'Description',                        'LOC_DISTRICT_APPEAL_FAITH'),
        ('HONEY_DISTRICT_FAITH_BREATHTAKING',                'DistrictType',                        'DISTRICT_HOLY_SITE'),
        ('HONEY_DISTRICT_FAITH_BREATHTAKING',                'RequiredAppeal',                    '4'),
        ('HONEY_DISTRICT_FAITH_BREATHTAKING',                'YieldChange',                        '4'),
        ('HONEY_DISTRICT_FAITH_BREATHTAKING',                'YieldType',                        'YIELD_FAITH');



--------------------------------------------------------------------------------------------------------------------------
-- RequirementArguments for AdjCityCenter Changes
--------------------------------------------------------------------------------------------------------------------------
INSERT INTO RequirementSets
        (RequirementSetId,                                            RequirementSetType)
VALUES  ('ADJACENT_TO_CITYCENTER_REQUIREMENTS',                       'REQUIREMENTSET_TEST_ALL');

INSERT INTO RequirementSetRequirements
        (RequirementSetId,                                            RequirementId)
VALUES  ('ADJACENT_TO_CITYCENTER_REQUIREMENTS',                        'REQUIREMENT_TILE_ADJ_TO_CITYCENTER');

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

INSERT INTO RequirementArguments
        (RequirementId,                                                Name,                Value)
VALUES  ('REQUIREMENT_TILE_ADJ_TO_CITYCENTER',                           'DistrictType',        'DISTRICT_CITY_CENTER'),
        ('REQUIREMENT_TILE_ADJ_TO_CITYCENTER',                           'MaxRange',            '1'),
        ('REQUIREMENT_TILE_ADJ_TO_CITYCENTER',                           'MinRange',            '1'),
        ('REQUIREMENT_TILE_ADJ_TO_CITYCENTER',                           'MustBeFunctioning',    'TRUE');
 

Attachments

Code:
		<Row>
			<ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_CITY_APPEAL</ModifierType>
			<CollectionType>COLLECTION_PLAYER_CITIES</CollectionType>
			<EffectType>EFFECT_ADJUST_CITY_APPEAL</EffectType>
		</Row>
The effect of the modifier type is applied directly upon the city itself rather than directly upon the plots belonging to the city. The indirect effect is upon the plots that belong to the city. But since the effect is applied directly upon the city, the requirement that the city be adjacent to a city center can never be satisfied. In order for the requirement to be applied upon individual plots, the effect would have to be one that is applied directly upon plots.

None of the EffectTypes I see in the game files or in the database for adjusting plot appeal values are direct effects on plots, but rather implemented by passing through being attached to the city itself.
 
Okay, I got my modifiers sorted out, thank you so much! :)
At this point the mod is almost done but my icons (unique units and building) are still not working correctly (they just show up as empty) and I'm specifically trying to make the unique building icon be the Grand Master's Chapel which I think is "ICON_ATLAS_EXPANSION_1_DISTRICT_BUILDINGS" Index="5" but nothing's showing up + in the create game menu when I hover over another civ and then back to my civ their unique building shows up as my unique building until I hover over something else so I don't know what's going on there

Here's my current code for the icons.xml folder. I'm wondering if I have to make the icons myself, but I should be able to pull them from the game, no?

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameData>
    <IconTextureAtlases>
        <!--Leader Icons-->
        
        <Row Name="ICON_ATLAS_LEADER_HONEY" IconSize="32"  IconsPerRow="1" IconsPerColumn="1" Filename="ICON_LEADER_HONEY_32.dds"/>
        <Row Name="ICON_ATLAS_LEADER_HONEY" IconSize="45"  IconsPerRow="1" IconsPerColumn="1" Filename="ICON_LEADER_HONEY_45.dds"/>
        <Row Name="ICON_ATLAS_LEADER_HONEY" IconSize="50"  IconsPerRow="1" IconsPerColumn="1" Filename="ICON_LEADER_HONEY_50.dds"/>
        <Row Name="ICON_ATLAS_LEADER_HONEY" IconSize="55"  IconsPerRow="1" IconsPerColumn="1" Filename="ICON_LEADER_HONEY_55.dds"/>
        <Row Name="ICON_ATLAS_LEADER_HONEY" IconSize="64"  IconsPerRow="1" IconsPerColumn="1" Filename="ICON_LEADER_HONEY_64.dds"/>
        <Row Name="ICON_ATLAS_LEADER_HONEY" IconSize="80"  IconsPerRow="1" IconsPerColumn="1" Filename="ICON_LEADER_HONEY_80.dds"/>
        <Row Name="ICON_ATLAS_LEADER_HONEY" IconSize="256" IconsPerRow="1" IconsPerColumn="1" Filename="ICON_LEADER_HONEY_256.dds"/>

        <!--CIV Icons-->

        <Row Name="ICON_ATLAS_CIV_PARADISO" IconSize="32"  IconsPerRow="1" IconsPerColumn="1" Filename="ICON_CIV_PARADISO_32.dds"/>
        <Row Name="ICON_ATLAS_CIV_PARADISO" IconSize="45"  IconsPerRow="1" IconsPerColumn="1" Filename="ICON_CIV_PARADISO_45.dds"/>
        <Row Name="ICON_ATLAS_CIV_PARADISO" IconSize="50"  IconsPerRow="1" IconsPerColumn="1" Filename="ICON_CIV_PARADISO_50.dds"/>
        <Row Name="ICON_ATLAS_CIV_PARADISO" IconSize="55"  IconsPerRow="1" IconsPerColumn="1" Filename="ICON_CIV_PARADISO_55.dds"/>
        <Row Name="ICON_ATLAS_CIV_PARADISO" IconSize="64"  IconsPerRow="1" IconsPerColumn="1" Filename="ICON_CIV_PARADISO_64.dds"/>
        <Row Name="ICON_ATLAS_CIV_PARADISO" IconSize="80"  IconsPerRow="1" IconsPerColumn="1" Filename="ICON_CIV_PARADISO_80.dds"/>
        <Row Name="ICON_ATLAS_CIV_PARADISO" IconSize="256" IconsPerRow="1" IconsPerColumn="1" Filename="ICON_CIV_PARADISO_256.dds"/>
        

    </IconTextureAtlases>

    <IconDefinitions>
        <!--Leader Icons-->
        <Row Name="ICON_LEADER_HONEY" Atlas="ICON_ATLAS_LEADER_HONEY" Index="0"/>

        <!--Civilization Icons-->
        <Row Name="ICON_CIVILIZATION_PARADISO" Atlas="ICON_ATLAS_CIV_PARADISO" Index="0"/>

        <!--Building Icons-->
        <Row Name="ICON_BUILDING_STAR_THEATER" Atlas="ICON_ATLAS_EXPANSION_1_DISTRICT_BUILDINGS" Index="5"/>
        <Row Name="ICON_UNIT_KRON" Index="45" Atlas="ICON_ATLAS_UNITS"/>
        <Row Name="ICON_UNIT_HORSEY" Index="22" Atlas="ICON_ATLAS_UNITS"/>
    </IconDefinitions>
</GameData>

I'm getting this error in my database as well and I'm having a hard time understanding it.

Code:
[3208576.151] [Database] ERROR: FOREIGN KEY constraint failed
[3208576.151] [Database]: While executing - 'insert into IconDefinitions('Name', 'Atlas', 'Index') values (?, ?, ?);'
[3208576.151] [Database]: In XMLSerializer while inserting row into table insert into IconDefinitions('Name', 'Atlas', 'Index') with  values (ICON_BUILDING_STAR_THEATER, ICON_ATLAS_EXPANSION_1_DISTRICT_BUILDINGS, 5, ).
[3208576.151] [Database]: In XMLSerializer while updating table IconDefinitions from file C:/Users/Madde/Documents/My Games/Sid Meier's Civilization VI/Mods/Test/Core/Joshs_Template_Icons.xml.
[3208576.151] [Database] ERROR: FOREIGN KEY constraint failed
 
Back
Top Bottom