[NFP] Help solving my mod's final syntax errors?

PartOfThatPoer

Chieftain
Joined
Jan 16, 2021
Messages
8
I have been sitting for days trying to get my civilization mod to work. The game starts now but the Uniques do not appear (and the city name ist the LOC instead of the actual name). Database spits out syntax errors that I for the love of god just cannot find.

Here is the databse-log:
Code:
[194392.516] [Localization]: StartupErrorMessages.xml
[194392.517] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[194405.283] [Localization]: Validating Foreign Key Constraints...
[194405.285] [Localization]: Passed Validation.
[194405.326] [Configuration]: Validating Foreign Key Constraints...
[194405.329] [Configuration]: Passed Validation.
[194410.184] [FullTextSearch]: Initializing FullTextSearch
[194413.526] [Gameplay]: Validating Foreign Key Constraints...
[194413.556] [Gameplay]: Passed Validation.
[194417.996] [Configuration]: Validating Foreign Key Constraints...
[194418.001] [Configuration]: Passed Validation.
[194421.372] [HallofFame]: Database found. Checking versions...
[194421.397] [HallofFame]: Database is up-to-date!
[194442.609] [FullTextSearch]: FTS - Creating Context
[194475.856] [Configuration]: Validating Foreign Key Constraints...
[194475.857] [Configuration]: Passed Validation.
[194482.164] [Gameplay] ERROR: near "(": syntax error
[194482.166] [Gameplay] ERROR: near "<": syntax error
[194482.168] [Gameplay] ERROR: UNIQUE constraint failed: Types.Type
[194482.168] [Gameplay] ERROR: UNIQUE constraint failed: Types.Type
[194482.176] [Gameplay] ERROR: near "(": syntax error
[194491.044] [Gameplay]: Validating Foreign Key Constraints...
[194491.107] [Gameplay]: Passed Validation.
[194528.337] [FullTextSearch]: FTS - Creating Context
[194528.339] [FullTextSearch]: FTS - Creating Context
[194529.920] [FullTextSearch]: FTS - Creating Context
[194531.273] [FullTextSearch]: FTS - Creating Context
[194535.596] [FullTextSearch]: FTS - Creating Context

At around the same timestamp the modding log spits out the following errors:

Code:
194482.154] Successfully released save point.
[194482.154] Applying Component - Volga_Germany_Database (UpdateDatabase)
[194482.156] UpdateDatabase - Loading Core/Civilization_Config.sql
[194482.159] UpdateDatabase - Loading Core/Civilization_UA.sql
[194482.165] Warning: UpdateDatabase - Error Loading SQL.
[194482.165] UpdateDatabase - Loading Core/Civilization_UI.sql
[194482.166] Warning: UpdateDatabase - Error Loading SQL.
[194482.167] UpdateDatabase - Loading Core/Civilization_UU.sql
[194482.168] Warning: UpdateDatabase - Error Loading SQL.
[194482.168] UpdateDatabase - Loading Leader/Leader_Agenda.sql
[194482.171] UpdateDatabase - Loading Leader/Leader_Core.sql
[194482.173] UpdateDatabase - Loading Leader/Leader_UA.sql
[194482.176] Warning: UpdateDatabase - Error Loading SQL.
[194482.177] Applying Component - Gametext (UpdateText)
[194482.177] Creating database save point.

So it's clear that the errors should occur in those files. However I cannot find anything wrong with them:

1. Civilization_UA:
Code:
/*
    UA
    Authors: PartOfThatPower
*/

-----------------------------------------------
-- Types
-----------------------------------------------

INSERT INTO    Types
        (Type,                                            Kind                    )
VALUES    ('TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UA',            'KIND_TRAIT'    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UA_SETTLER_FOOD',            'KIND_MODIFIER'    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',        'KIND_MODIFIER'    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UA_FREE_WORKER1',            'KIND_MODIFIER'    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2',            'KIND_MODIFIER'    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3',            'KIND_MODIFIER'    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4',            'KIND_MODIFIER'    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UA_RIVER_START',            'KIND_MODIFIER'    );


-----------------------------------------------
-- Traits
-----------------------------------------------

INSERT INTO    Traits   
        (TraitType,                                Name,                                            Description                                            )
VALUES    ('TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UA',    'LOC_TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UA_NAME',    'LOC_TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UA_DESCRIPTION'    );
        
-----------------------------------------------
-- CivilizationTraits
-----------------------------------------------

INSERT INTO    CivilizationTraits   
        (CivilizationType,                                TraitType                            )
VALUES    ('CIVILIZATION_PARTS_VOLGA_GERMANY',    'TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UA'    );

-----------------------------------------------
-- TraitModifiers
-----------------------------------------------

INSERT INTO    TraitModifiers   
        (TraitType,                                ModifierId                                                    )
VALUES    ('TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UA',    'MODIFIER_PARTS_VOLGA_GERMANY_UA_SETTLER_FOOD'        ),
        ('TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UA',    'MODIFIER_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS'    ),
        ('TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UA',    'MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER1'        ),
        ('TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UA',    'MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2'        ),
        ('TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UA',    'MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3'        ),
        ('TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UA',    'MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4'        ),
        ('TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UA',    'MODIFIER_PARTS_VOLGA_GERMANY_UA_RIVER_START'        );


-----------------------------------------------
-- DynamicModifiers
-----------------------------------------------


INSERT INTO    DynamicModifiers
        (ModifierType,                                            CollectionType,                    EffectType                                        )
VALUES    ('MODTYPE_PARTS_VOLGA_GERMANY_UA_SETTLER_FOOD',            'COLLECTION_PLAYER_TRAINED_UNITS',    'EFFECT_ADJUST_CITY_SETTLER_CONSUME_POP'    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',        'COLLECTION_PLAYER_PLOT_YIELDS',    'EFFECT_ADJUST_PLOT_YIELD'                    ),   
        ('MODTYPE_PARTS_VOLGA_GERMANY_UA_FREE_WORKER1',            'COLLECTION_PLAYER_BUILT_CITIES',    'EFFECT_GRANT_UNIT_IN_CITY'                    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2',            'COLLECTION_PLAYER_BUILT_CITIES',    'EFFECT_GRANT_UNIT_IN_CITY'                    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3',            'COLLECTION_PLAYER_BUILT_CITIES',    'EFFECT_GRANT_UNIT_IN_CITY'                    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4',            'COLLECTION_PLAYER_BUILT_CITIES',    'EFFECT_GRANT_UNIT_IN_CITY'                    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UA_RIVER_START',            'COLLECTION_PLAYER_CITIES',            'EFFECT_RIVER_ADJACENCY'                    );


-----------------------------------------------
-- Modifiers
-----------------------------------------------

INSERT INTO    Modifiers
        (ModifierId,                                        ModifierType,                                    OwnerRequirementSetId,                SubjectRequirementSetId,            RunOnce,    Permanent                        )
VALUES    ('MODIFIER_PARTS_VOLGA_GERMANY_UA_SETTLER_FOOD',        'MODTYPE_PARTS_VOLGA_GERMANY_UA_SETTLER_FOOD',                NULL,                                    NULL,                0,            1                            ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',        'MODTYPE_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS','REQSET_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',        NULL,                0,            1                            ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER1',        'MODTYPE_PARTS_VOLGA_GERMANY_UA_FREE_WORKER1',                 NULL,                                    NULL,                1,            0                            ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2',        'MODTYPE_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2',    'REQSET_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2',        NULL,                1,            0                            ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3',        'MODTYPE_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3',    'REQSET_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3',        NULL,                1,            0                            ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4',        'MODTYPE_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4',    'REQSET_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4',        NULL,                1,            0                            ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_RIVER_START',            'MODTYPE_PARTS_VOLGA_GERMANY_UA_RIVER_START',                NULL,                                    NULL,                 0 ,            0                            );

-----------------------------------------------
-- ModifierArguments
-----------------------------------------------

INSERT INTO    ModifierArguments
        (ModifierId,                                            Name,                            Value                                        )
VALUES    ('MODIFIER_PARTS_VOLGA_GERMANY_UA_SETTLER_FOOD',            'Enabled',                    0                                            ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',            'Amount',                    2                                            ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',            'YieldType',                    'YIELD_CULTURE'                            ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER1',            'AllowUniqueOverride',                    0                                ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER1',            'Amount',                    1                                            ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER1',            'UnitType',                        'UNIT_WORKER'                                   ),                                       
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2',            'AllowUniqueOverride',                    0                                ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2',            'Amount',                    1                                            ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2',            'UnitType',                        'UNIT_WORKER'                                ),                                       
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3',            'AllowUniqueOverride',                    0                                ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3',            'Amount',                    1                                            ),   
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3',            'UnitType',                        'UNIT_WORKER'                                ),                                       
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4',            'AllowUniqueOverride',                    0                                ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4',            'Amount',                    1                                            ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4',            'UnitType',                        'UNIT_WORKER'                                ),                                   
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_RIVER_START',            'Amount',                        2                                                ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_RIVER_START',            'Description',                        'Cities next to rivers gain +2 Food.'        ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_RIVER_START',            'DistrictType',                        'DISTRICT_CITY_CENTER'                        ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_RIVER_START',            'TilesRequired',                        0                                        ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UA_RIVER_START',            'YieldType',                        'YIELD_FOOD'                                );
    
-----------------------------------------------
-- RequirementSets
-----------------------------------------------

INSERT INTO RequirementSets
        (RequirementSetId,                    RequirementSetType                            )
VALUES    ('REQSET_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',    'REQUIREMENTSET_TEST_ALL'    ),
        ('REQSET_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2',    'REQUIREMENTSET_TEST_ALL'        ),
        ('REQSET_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3',    'REQUIREMENTSET_TEST_ALL'        ),
        ('REQSET_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4',    'REQUIREMENTSET_TEST_ALL'        );

-----------------------------------------------
-- RequirementSetRequirements
-----------------------------------------------

INSERT INTO RequirementSetRequirements
        (RequirementSetId,                    RequirementId                                                    )
VALUES    ('REQSET_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',    'REQ_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS'        ),
        ('REQSET_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2',    'REQ_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2'            ),
        ('REQSET_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3',    'REQ_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3'            ),
        ('REQSET_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4',    'REQ_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4'            );

-----------------------------------------------
-- Requirements
-----------------------------------------------

INSERT INTO Requirements
        (RequirementId,                        RequirementType,                                    Inverse                 )
VALUES    ('REQ_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',        'REQUIREMENT_PLOT_ADJACENT_TO_RIVER',    0                    ),
        ('REQ_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2',    'REQUIREMENT_PLAYER_HAS_AT_LEAST_NUMBER_CITIES',            0        ),
        ('REQ_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3',    'REQUIREMENT_PLAYER_HAS_AT_LEAST_NUMBER_CITIES',            0        ),
        ('REQ_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4',    'REQUIREMENT_PLAYER_HAS_AT_LEAST_NUMBER_CITIES',             0        );

INSERT INTO RequirementsArguments
        (RequirementID,                     Name,                                            Value     )
        ('REQ_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',        'MaxDistance',    0                        ),
        ('REQ_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',        'MinDistance',    0                        ),
        ('REQ_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2',    'Amount',            2                            ),
        ('REQ_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3',    'Amount',            3                            ),
        ('REQ_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4',    'Amount',             4                            );

2. Civilization UI:
Code:
/*
    UI
    Authors: PartOfThatPower
*/

-----------------------------------------------
-- Types
-----------------------------------------------       

INSERT INTO Types   
        (Type,                                    Kind            )
VALUES    ('DISTRICT_PARTS_VOLGA_GERMANY_UI',    'KIND_TRAIT'        );

-----------------------------------------------
-- Traits
-----------------------------------------------

INSERT INTO Traits
        (TraitType,                                Name                                    )
VALUES    ('DISTRICT_PARTS_VOLGA_GERMANY_UI',    'LOC_DISTRICT_PARTS_VOLGA_GERMANY_UI_NAME'    );

-----------------------------------------------
-- CivilizationTraits
-----------------------------------------------
        
INSERT INTO CivilizationTraits
        (TraitType,                                CivilizationType                )
VALUES    ('DISTRICT_PARTS_VOLGA_GERMANY_UI',    'CIVILIZATION_PARTS_VOLGA_GERMANY'    );


-----------------------------------------------
-- Buildings
-----------------------------------------------

INSERT INTO Districts    (
        DistrictType,
        Name,
        Description,
        TraitType,
        PrereqTech,
        PrereqCivic,
        Cost,
        Housing,
        PurchaseYield,
        Maintenance,
        CitizenSlots,
        OuterDefenseStrength,
        DefenseModifier,
        AdvisorType<d
        )
SELECT    'DISTRICT_PARTS_VOLGA_GERMANY_UI', -- BuildingType
        'LOC_DISTRICT_PARTS_VOLGA_GERMANY_UI_NAME', -- Name
        'LOC_DISTRICT_PARTS_VOLGA_GERMANY_UI_DESCRIPTION', -- Description
        'DISTRICT_PARTS_VOLGA_GERMANY_UI', -- TraitType
        'TECH_ASTROLOGY', -- PrereqTech
        PrereqCivic,
        Cost,
        Housing,
        PurchaseYield,
        Maintenance,
        CitizenSlots,
        OuterDefenseStrength,
        DefenseModifier,
        AdvisorType
FROM    Districts
WHERE    DistrictType = 'DISTRICT_HOLY_SITE';

-----------------------------------------------
-- BuildingReplaces
-----------------------------------------------

INSERT INTO DistrictReplaces
        (CivUniqueDistrictType,        ReplacesBuildingType    )
VALUES    ('DISTRICT_PARTS_VOLGA_GERMANY_UI',            'DISTRICT_HOLY_SITE'        );

INSERT INTO District_Adjacencies
        (DistrictType,            YieldChangeId                 )
        ('DISTRICT_PARTS_VOLGA_GERMANY_UI', 'River_Faith'    ),
        ('DISTRICT_PARTS_VOLGA_GERMANY_UI', 'River_Food'    );


INSERT INTO District_YieldChanges
        (YieldChangeId,                YieldType,            YieldChange    )
VALUES    ('River_Faith',            'YIELD_FAITH',    2                            ),   
        ('River_Food',            'YIELD_FOOD',    2                            );


3. Civilization_UU:
Code:
/*
    UU
    Authors: PartOfThatPower
*/

-----------------------------------------------
-- Types
-----------------------------------------------   
    
INSERT INTO Types
        (Type,                                        Kind            )
VALUES    ('TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UU',        'KIND_TRAIT'    ),
        ('UNIT_PARTS_VOLGA_GERMANY_UU',                        'KIND_UNIT'        ),
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',                    'KIND_ABILITY'    ),
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_DOMAIN_PRODUCTION'        ), -- Inserting the "Reduce production cost" Modifier
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_MOVEMENT'    ), -- Inserting the "increased movement" Modifier
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'MODIFIER_PARTS_VOLGA_GERMANY_UU_IGNORE_RIVER'    ); -- Inserting the "ignore river" Modifier


-----------------------------------------------
-- Tags
-----------------------------------------------   
    
INSERT INTO Tags
        (Tag,                        Vocabulary        )
VALUES    ('CLASS_PARTS_VOLGA_GERMANY_UU',    'ABILITY_CLASS'    );

-----------------------------------------------
-- TypeTags
-----------------------------------------------       

INSERT INTO TypeTags
        (Type,                        Tag                        )
VALUES    ('UNIT_PARTS_VOLGA_GERMANY_UU',        'CLASS_PARTS_VOLGA_GERMANY_UU'    ),
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'CLASS_PARTS_VOLGA_GERMANY_UU'    );

INSERT INTO TypeTags (Type,        Tag)
SELECT     'UNIT_PARTS_VOLGA_GERMANY_UU',    Tag
FROM     TypeTags
WHERE     Type = 'UNIT_SETTLER';

-----------------------------------------------
-- Traits
-----------------------------------------------
        
INSERT INTO Traits
        (TraitType,                                Name                            )
VALUES    ('TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UU',    'LOC_UNIT_PARTS_VOLGA_GERMANY_UU_NAME'    );

-----------------------------------------------
-- CivilizationTraits
-----------------------------------------------
        
INSERT INTO CivilizationTraits
        (CivilizationType,                TraitType                            )
VALUES    ('CIVILIZATION_PARTS_VOLGA_GERMANY',    'TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UU'    );

-----------------------------------------------
-- Units
-----------------------------------------------   
    
INSERT INTO Units    (
        UnitType,
        Name,
        Description,
        TraitType,
        BaseMoves,
        Cost,
        PurchaseYield,
        AdvisorType,
        Combat,
        RangedCombat,
        Range,
        BaseSightRange,
        ZoneOfControl,
        Domain,
        FormationClass,
        PromotionClass,
        Maintenance,
        MandatoryObsoleteTech,
        PrereqTech,
        PrereqCivic
        )
SELECT    'UNIT_PARTS_VOLGA_GERMANY_UU',    -- UnitType
        'LOC_UNIT_PARTS_VOLGA_GERMANY_UU_NAME',    -- Name
        'LOC_UNIT_PARTS_VOLGA_GERMANY_UU_DESCRIPTION', -- Description
        'TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UU', -- TraitType
        BaseMoves,
        Cost,
        PurchaseYield,
        AdvisorType,
        Combat,
        RangedCombat,
        Range,
        BaseSightRange,
        ZoneOfControl,
        Domain,
        FormationClass,
        PromotionClass,
        Maintenance,
        MandatoryObsoleteTech,
        PrereqTech,
        PrereqCivic
FROM    Units
WHERE    UnitType = 'UNIT_SETTLER';

-----------------------------------------------
-- UnitUpgrades
-----------------------------------------------
        
INSERT INTO UnitUpgrades (Unit,    UpgradeUnit)
SELECT     'UNIT_PARTS_VOLGA_GERMANY_UU',    UpgradeUnit
FROM     UnitUpgrades
WHERE    Unit = 'UNIT_SETTLER';

-----------------------------------------------
-- UnitAiInfos
-----------------------------------------------
        
INSERT INTO UnitAiInfos (UnitType,    AiType)
SELECT     'UNIT_PARTS_VOLGA_GERMANY_UU',        AiType
FROM     UnitAiInfos
WHERE     UnitType = 'UNIT_SETTLER';
        
-----------------------------------------------
-- UnitReplaces
-----------------------------------------------
        
INSERT INTO UnitReplaces
        (CivUniqueUnitType,        ReplacesUnitType    )
VALUES    ('UNIT_PARTS_VOLGA_GERMANY_UU',    'UNIT_SETTLER'        );

-----------------------------------------------
-- UnitAbilities
-----------------------------------------------

INSERT INTO UnitAbilities
        (UnitAbilityType,            Name,                                Description                                    )
VALUES    ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'LOC_ABILITY_PARTS_VOLGA_GERMANY_UU_NAME',    'LOC_ABILITY_PARTS_VOLGA_GERMANY_UU_DESCRIPTION'    );

-----------------------------------------------
-- UnitAbilityModifiers

-- These setup the modifers for your ability by hooking your specified modifiers into the ability.
-- "UnitAbilityType" is the Unit's Ability to which you are inserting the "ModifierID", or the modifier, into.
-----------------------------------------------
        
INSERT INTO UnitAbilityModifiers
        (UnitAbilityType,            ModifierId                                )
VALUES  ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_DOMAIN_PRODUCTION'        ), -- Inserting the "Reduce production cost" Modifier
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_MOVEMENT'      ),
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'MODIFIER_PARTS_VOLGA_GERMANY_UU_IGNORE_RIVER' );
-----------------------------------------------
-- DynamicModifiers

-- This is where we start to define the Modifiers.
-----------------------------------------------

INSERT INTO    DynamicModifiers
        (ModifierType,                                CollectionType,                EffectType                                    )
VALUES    ('MODTYPE_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_DOMAIN_PRODUCTION',        'COLLECTION_OWNER',            'EFFECT_ADJUST_UNIT_DOMAIN_PRODUCTION'    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_MOVEMENT',                    'COLLECTION_PLAYER_UNITS',    'EFFECT_ADJUST_UNIT_MOVEMENT'    ),
        ('MODTYPE_PARTS_VOLGA_GERMANY_UU_IGNORE_RIVER',                         'COLLECTION_PLAYER_UNITS', 'EFFECT_ADJUST_UNIT_IGNORE_RIVERS' );
-----------------------------------------------
-- Modifiers

-- This is where we attach the ModType made in "DynamicModifiers" to our "ModifierID" mentioned in the first section.
-----------------------------------------------

INSERT INTO    Modifiers
        (ModifierId,                                ModifierType,                                OwnerRequirementSetId,    SubjectRequirementSetId,                Permanent,    RunOnce    )
VALUES    ('MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_DOMAIN_PRODUCTION',        'MODTYPE_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_DOMAIN_PRODUCTION',            NULL,                    NULL,            1,            0        ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_MOVEMENT',                'MODTYPE_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_MOVEMENT',                    NULL,                    NULL,    1,            0                ),
        ('MODIFIER_PARTS_VOLGA_GERMANY_UU_IGNORE_RIVER',                        'MODTYPE_PARTS_VOLGA_GERMANY_UU_IGNORE_RIVER',                             NULL,                     NULL,     1,                     0         );
-----------------------------------------------
-- ModifierArguments

-- This is where we further define the Modifiers.
-----------------------------------------------

INSERT INTO    ModifierArguments       
        (ModifierId,                                Name,        Value    )
VALUES    ('MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_DOMAIN_PRODUCTION',        'Amount',    -25        ), -- States that you adjust production modifier by -50%
        ('MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_MOVEMENT',    'Amount',    1                    ), -- States that you adjust the movement by 1.
        ('MODIFIER_PARTS_VOLGA_GERMANY_UU_IGNORE_RIVER',    'Ignore',    1                            ); -- States that you ignore river .

-----------------------------------------------
-- ModifierStrings

-- This is where we are going to link the Localisation to the Unit's Ability
-----------------------------------------------

INSERT INTO ModifierStrings
        (ModifierId,                                Context,    Text                                        )
VALUES  ('MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_MOVEMENT',    'Movement increased by 1.',    'LOC_MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_MOVEMENT'    ), -- Links the Unit to display his ability's text.
VALUES  ('MODIFIER_PARTS_VOLGA_GERMANY_UU_IGNORE_RIVER',    'Ignores rivers.',    'LOC_MODIFIER_PARTS_VOLGA_GERMANY_UU_IGNORE_RIVER'    ); -- Links the Unit to display his ability's text.

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

4. Finally, Leader_UA:

Code:
/*
    UA
    Authors: PartOFThatPower
*/

-----------------------------------------------
-- Types
-----------------------------------------------

INSERT INTO    Types
        (Type,                                                Kind            )
VALUES    ('TRAIT_LEADER_PARTS_REUTER_UA',                    'KIND_TRAIT'    ),
        ('MODTYPE_PARTS_REUTER_UA_DOUBLE_ALLIANCE',            'KIND_MODIFIER'    ),
        ('MODTYPE_PARTS_REUTER_UA_TRADE_BONUS1',            'KIND_MODIFIER'    ),
        ('MODTYPE_PARTS_REUTER_UA_TRADE_BONUS2',            'KIND_MODIFIER'    ),
        ('MODTYPE_PARTS_REUTER_UA_ECONOMIC_SLOT',            'KIND_MODIFIER'    );
-----------------------------------------------
-- Traits
-----------------------------------------------

INSERT INTO    Traits
        (TraitType,                            Name,                                        Description                                        )
VALUES    ('TRAIT_LEADER_PARTS_REUTER_UA',    'LOC_TRAIT_LEADER_PARTS_REUTER_UA_NAME',    'LOC_TRAIT_LEADER_PARTS_REUTER_UA_DESCRIPTION'    );
        
-----------------------------------------------
-- LeaderTraits
-----------------------------------------------

INSERT INTO    LeaderTraits
        (LeaderType,            TraitType                        )
VALUES    ('LEADER_PARTS_REUTER',    'TRAIT_LEADER_PARTS_REUTER_UA'    );

----------------------------------------------
-- TraitModifiers
-----------------------------------------------

INSERT INTO    TraitModifiers   
        (TraitType,                                ModifierId                                        )
VALUES    ('TRAIT_LEADER_PARTS_REUTER_UA',    'MODIFIER_PARTS_REUTER_UA_DOUBLE_ALLIANCE'            ),
        ('TRAIT_LEADER_PARTS_REUTER_UA',    'MODIFIER_PARTS_REUTER_UA_TRADE_BONUS1'                ),
        ('TRAIT_LEADER_PARTS_REUTER_UA',    'MODIFIER_PARTS_REUTER_UA_TRADE_BONUS2'                ),
        ('TRAIT_LEADER_PARTS_REUTER_UA',    'MODIFIER_PARTS_REUTER_UA_ECONOMIC_SLOT'            );

-----------------------------------------------
-- DynamicModifiers
-----------------------------------------------


INSERT INTO    DynamicModifiers
        (ModifierType,                                    CollectionType,                    EffectType                                                                    )
VALUES    ('MODTYPE_PARTS_REUTER_UA_DOUBLE_ALLIANCE',            'COLLECTION_ALLIANCE_PLAYERS',        'EFFECT_ADJUST_ALLIANCE_POINTS_FOR_TRADE_MODIFIER'                    ),   
        ('MODTYPE_PARTS_REUTER_UA_TRADE_BONUS1',            'COLLECTION_ALLIANCE_TRADEROUTES',    'EFFECT_ADJUST_CITY_TRADE_ROUTE_YIELD_FOR_INTERNATIONAL'            ),
        ('MODTYPE_PARTS_REUTER_UA_TRADE_BONUS2',            'COLLECTION_ALLIANCE_TRADEROUTES',    'EFFECT_ADJUST_CITY_TRADE_ROUTE_YIELD_FOR_INTERNATIONAL'            ),
        ('MODTYPE_PARTS_REUTER_UA_ECONOMIC_SLOT',            'COLLECTION_OWNER',                    'EFFECT_ADJUST_GOVERNMENT_SLOTS'                                    );

-----------------------------------------------
-- Modifiers
-----------------------------------------------

INSERT INTO    Modifiers
        (ModifierId,                                        ModifierType,                                    OwnerRequirementSetId,                SubjectRequirementSetId,            RunOnce,    Permanent        )
VALUES    ('MODIFIER_PARTS_REUTER_UA_DOUBLE_ALLIANCE',    'MODTYPE_PARTS_REUTER_UA_DOUBLE_ALLIANCE',                NULL,                                NULL,                                0,            1            ),
        ('MODIFIER_PARTS_REUTER_UA_TRADE_BONUS1',        'MODTYPE_PARTS_REUTER_UA_TRADE_BONUS1',                    NULL,                                NULL,                                0,            1            ),
        ('MODIFIER_PARTS_REUTER_UA_TRADE_BONUS2',        'MODTYPE_PARTS_REUTER_UA_TRADE_BONUS2',                     NULL,                                NULL,                                0,            1            ),
        ('MODIFIER_PARTS_REUTER_UA_ECONOMIC_SLOT',        'MODTYPE_PARTS_REUTER_UA_ECONOMIC_SLOT', 'REQSET_PARTS_REUTER_UA_ECONOMIC_SLOT',            NULL,                                0,            1            );

----------------------------------------------
-- ModifierArguments
-----------------------------------------------
INSERT INTO    ModifierArguments
        (ModifierId,                                            Name,                            Value                                    )
VALUES    ('MODIFIER_PARTS_REUTER_UA_DOUBLE_ALLIANCE',            'Amount',                    100                                            ),
        ('MODIFIER_PARTS_REUTER_UA_TRADE_BONUS1',            'Amount',                    3                                                ),
        ('MODIFIER_PARTS_REUTER_UA_TRADE_BONUS1',            'YieldType',                    'YIELD_PRODUCTION'                            ),
        ('MODIFIER_PARTS_REUTER_UA_TRADE_BONUS2',            'Amount',                    3                                                ),
        ('MODIFIER_PARTS_REUTER_UA_TRADE_BONUS2',            'YieldType',                    'YIELD_SCIENCE'                                ),
        ('MODIFIER_PARTS_REUTER_UA_ECONOMIC_SLOT',            'Amount',                    1                                                ),
        ('MODIFIER_PARTS_REUTER_UA_ECONOMIC_SLOT',            'GovernmentSlotType',                    'SLOT_ECONOMIC'                        );



INSERT INTO RequirementSets
        (RequirementSetId,                    RequirementSetType                                )
VALUES    ('REQSET_PARTS_REUTER_UA_ECONOMIC_SLOT',    'REQUIREMENTSET_TEST_ALL'                );


INSERT INTO RequirementSetRequirements
        (RequirementSetId,                    RequirementId                                    )
VALUES    ('REQSET_PARTS_REUTER_UA_ECONOMIC_SLOT',    'REQ_PARTS_REUTER_UA_ECONOMIC_SLOT'        );


INSERT INTO Requirements
        (RequirementId,                        RequirementType,                                    Inverse )
VALUES    ('REQ_PARTS_REUTER_UA_ECONOMIC_SLOT',        'REQUIREMENT_PLAYER_HAS_CIVIC',                0        );

INSERT INTO RequirementsArguments
        (RequirementID,                                     Name,                            Value         )
        ('REQ_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',        'civicType',    'CIVIC_CLASS_STRUGGLE'        );

Could anyone please help me trying to figure out the errors? Please tell me if you need any other files.

Thanks!
 
[194482.164] [Gameplay] ERROR: near "(": syntax error
Code:
INSERT INTO RequirementsArguments
        (RequirementID,                     Name,                                            Value     )
        ('REQ_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',        'MaxDistance',    0                        ),
        ('REQ_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',        'MinDistance',    0                        ),
        ('REQ_PARTS_VOLGA_GERMANY_UA_FREE_WORKER2',    'Amount',            2                            ),
        ('REQ_PARTS_VOLGA_GERMANY_UA_FREE_WORKER3',    'Amount',            3                            ),
        ('REQ_PARTS_VOLGA_GERMANY_UA_FREE_WORKER4',    'Amount',             4                            );

[194482.166] [Gameplay] ERROR: near "<": syntax error
Code:
INSERT INTO Districts    (
        DistrictType,
        Name,
        Description,
        TraitType,
        PrereqTech,
        PrereqCivic,
        Cost,
        Housing,
        PurchaseYield,
        Maintenance,
        CitizenSlots,
        OuterDefenseStrength,
        DefenseModifier,
        AdvisorType<d
        )
AdvisorType<d



[194482.168] [Gameplay] ERROR: UNIQUE constraint failed: Types.Type
First)
Not how the "Types" table works. ModiiferIds are never registered in the Types table.
Code:
INSERT INTO Types
        (Type,                                        Kind            )
VALUES    ('TRAIT_CIVILIZATION_PARTS_VOLGA_GERMANY_UU',        'KIND_TRAIT'    ),
        ('UNIT_PARTS_VOLGA_GERMANY_UU',                        'KIND_UNIT'        ),
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',                    'KIND_ABILITY'    ),
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_DOMAIN_PRODUCTION'        ), -- Inserting the "Reduce production cost" Modifier
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_MOVEMENT'    ), -- Inserting the "increased movement" Modifier
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'MODIFIER_PARTS_VOLGA_GERMANY_UU_IGNORE_RIVER'    ); -- Inserting the "ignore river" Modifier
Second)
You get the error because you can only state the same "Type" value once in table "Types". You've listed 'ABILITY_PARTS_VOLGA_GERMANY_UU', four times.This is correct
Code:
 ('ABILITY_PARTS_VOLGA_GERMANY_UU',                    'KIND_ABILITY'    ),
This is all incorrect. These value statements are not necessary since only ModiiferTypes are registered in table "Types" as "KIND_MODIFIER" but "ModifierIds" are never shown in table "Types".
Code:
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_DOMAIN_PRODUCTION'        ), -- Inserting the "Reduce production cost" Modifier
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'MODIFIER_PARTS_VOLGA_GERMANY_UU_ADJUST_UNIT_MOVEMENT'    ), -- Inserting the "increased movement" Modifier
        ('ABILITY_PARTS_VOLGA_GERMANY_UU',    'MODIFIER_PARTS_VOLGA_GERMANY_UU_IGNORE_RIVER'    ); -- Inserting the "ignore river" Modifier

[194482.168] [Gameplay] ERROR: UNIQUE constraint failed: Types.Type
Same basic error but I don't see where it is at. Bear in mind you can never add a duplicate that is already in the game as a "Type", which might be the problem since I don't spot the repeat at the moment




[194482.176] [Gameplay] ERROR: near "(": syntax error
Code:
INSERT INTO RequirementsArguments
        (RequirementID,                                     Name,                            Value         )
        ('REQ_PARTS_VOLGA_GERMANY_UA_CULTURE_RIVERS',        'civicType',    'CIVIC_CLASS_STRUGGLE'        );
And also Capitalization in many cases is important. The game may or may not equate 'civicType' with 'CivicType'.
 
Last edited:
Hi,

Thank you very much!
Now most things work and no syntax errors appear, but there are still three issues:
- the unique district's model does not appear in the game (it should just be a holy site district).
- the in-game icons for the unique unit and district do not appear (should just be the settler and holy site icons).
- the leader screen still depicts the default screen (Cleopatra).

I played around with the files and Modbuddy but am unable to fix these errors. Can anyone help me find out what I did wrong? the mod is attached.
 

Attachments

  • EmptyMod1.rar
    20.5 MB · Views: 819
Top Bottom