Unique improvement not appearing in-game at all

vibach

Chieftain
Joined
May 18, 2023
Messages
6
So I created this unique improvement called a lamppost, but when I add it in the game, it always just look as though its a leader or civ trait (normally a unique building/district/improvement in the loading screen would say unique infrastructure with the icon appearing next to it), and there is no option to build it, nor did it appear in the game civilopedia. Here are the files for it, I just genuinely do not know where to start looking, the log just said there are uh foreign key but I am unable to identify exactly where the issue is. If someone can look through the code and guide me on what I did wrong that would be greatly appreciated.
 

Attachments

  • Tepiggo.zip
    1.8 MB · Views: 6
Here is the code for the improvement (copied the format of the sphinx when I inserted it into Improvements, I tried using other improvements at first but the mod refuses to load, when I use this it load into the game but the improvement is still nowhere to be seen)
SQL:
-- Civilization_UI
-- Author: Bach
-- DateCreated: 8/29/2023 8:19:08 PM
--------------------------------------------------------------
INSERT INTO Types
        (Type,                                            Kind)
VALUES    ('TRAIT_CIVILIZATION_IMPROVEMENT_LAMPPOST',        'KIND_TRAIT'),
        ('IMPROVEMENT_LAMPPOST',                        'KIND_IMPROVEMENT');

INSERT INTO CivilizationTraits
        (TraitType,                                        CivilizationType)
VALUES    ('TRAIT_CIVILIZATION_IMPROVEMENT_LAMPPOST',        'CIVILIZATION_BC_TEPIGGO');

INSERT INTO Traits
        (TraitType,                                        Name,                         Description )
VALUES    ('TRAIT_CIVILIZATION_IMPROVEMENT_LAMPPOST',        'LOC_TRAIT_CIVILIZATION_IMPROVEMENT_LAMPPOST_NAME', Null);

INSERT INTO Improvements (
        ImprovementType,
        Name,
        Description,
        Icon,
        PlunderType,
        PlunderAmount,
        Buildable,
        PrereqCivic,
        TraitType,
        Appeal,
        SameAdjacentValid
        )
VALUES    (
        'IMPROVEMENT_LAMPPOST',
        'LOC_IMPROVEMENT_LAMPPOST_NAME',
        'LOC_IMPROVEMENT_LAMPPOST_DESCRIPTION',
        'ICON_IMPROVEMENT_LAMPPOST',
        'PLUNDER_FAITH',
        25,
        1,
        'CIVIC_CRAFTSMANSHIP',
        'TRAIT_CIVILIZATION_IMPROVEMENT_LAMPPOST',
        1
        1);

INSERT INTO Improvement_ValidTerrains
        (ImprovementType,            TerrainType)
VALUES    ('IMPROVEMENT_LAMPPOST',    'TERRAIN_GRASS_MOUNTAIN'),
        ('IMPROVEMENT_LAMPPOST',    'TERRAIN_PLAINS_MOUNTAIN'),
        ('IMPROVEMENT_LAMPPOST',    'TERRAIN_TUNDRA_MOUNTAIN'),
        ('IMPROVEMENT_LAMPPOST',    'TERRAIN_SNOW_MOUNTAIN'),
        ('IMPROVEMENT_LAMPPOST',    'TERRAIN_DESERT_MOUNTAIN');

INSERT INTO Improvement_ValidBuildUnits
        (ImprovementType,            UnitType)
VALUES    ('IMPROVEMENT_LAMPPOST',    'UNIT_BUILDER');

INSERT INTO Improvements_XP2
        (ImprovementType,            BuildOnAdjacentPlot    )
VALUES    ('IMPROVEMENT_LAMPPOST',    1                    );

INSERT INTO ImprovementModifiers
        (ImprovementType,            ModifierId)
VALUES    ('IMPROVEMENT_LAMPPOST',    'LAMPPOST_CULTURE_ADJACENT_TILES');

INSERT INTO Modifiers(
        ModifierId,
        ModifierType,
        SubjectRequirementSetId
        )
VALUES    (
        'LAMPPOST_CULTURE_ADJACENT_TILES',
        'MODIFIER_PLAYER_ADJUST_PLOT_YIELD',
        'LAMPPOST_ADJACENT_TILES'
        );

INSERT INTO ModifierArguments
        (ModifierId,                            Name,            Value            )
VALUES    ('LAMPPOST_CULTURE_ADJACENT_TILES',        'YieldType',    'YIELD_CULTURE'    ),
        ('LAMPPOST_CULTURE_ADJACENT_TILES',        'Amount',        1                );

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

INSERT INTO RequirementSetRequirements
        (RequirementSetId,                RequirementId)
VALUES    ('LAMPPOST_ADJACENT_TILES',        'ADJACENT_TO_LAMPPOST');

INSERT INTO Requirements
        (RequirementId,                RequirementType)
VALUES    ('ADJACENT_TO_LAMPPOST',    'REQUIREMENT_PLOT_ADJACENT_TO_OWNER');

--These 2 segments below serve to slow down other civ's unit when they are adjacent to a lamppost
--This first segment slows down all units when they are adjacent to lamppost
INSERT INTO Types
        (Type,                        Kind)
VALUES    ('ABILITY_LAMPPOST_SLOW',    'KIND_ABILITY');

INSERT INTO TypeTags
        (Type,                        Tag)
VALUES    ('ABILITY_LAMPPOST_SLOW',    'CLASS_ALL_UNITS');
--Could have just make this requirement set for the +1 culture to adjacent tile thing as well and use it there, but oh well.
INSERT INTO UnitAbilities
        (Description,                                Name,                                UnitAbilityType)
VALUES    ('LOC_ABILITY_LAMPPOST_SLOW_DESCRIPTION',    'LOC_ABILITY_LAMPPOST_SLOW_NAME',    'ABILITY_LAMPPOST_SLOW');

INSERT INTO UnitAbilityModifiers
        (UnitAbilityType,                    ModifierId)
VALUES    ('ABILITY_LAMPPOST_SLOW',            'SLOWED_MOVEMENT');

INSERT INTO Modifiers
        (ModifierId,                ModifierType                                SubjectRequirementSetId)
VALUES    ('SLOWED_MOVEMENT',            'MODIFIER_PLAYER_UNIT_ADJUST_MOVEMENT',        'NEXT_TO_LAMPPOST');

INSERT INTO ModifierArguments
        (ModifierId,                Name,            Value    )
VALUES    ('SLOWED_MOVEMENT',            'Amount',        -1        );

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

INSERT INTO RequirementSetRequirements
        (RequirementSetId,        RequirementId                        )
VALUES    ('NEXT_TO_LAMPPOST',    'REQUIRES_UNIT_ADJACENT_TO_LAMPPOST');

INSERT INTO Requirements
        (RequirementId,                            RequirementType)
VALUES    ('REQUIRES_UNIT_ADJACENT_TO_LAMPPOST',    'REQUIREMENT_PLOT_ADJACENT_IMPROVEMENT_TYPE_MATCHES');

INSERT INTO RequirementArguments
        (RequirementId,                            Name,                Value)
VALUES    ('REQUIRES_UNIT_ADJACENT_TO_LAMPPOST',    'ImprovementType',    'IMPROVEMENT_LAMPPOST');
--This 2nd segment counter the first segment by buffing the speed of this civ's unit when adjacent to the lamppost
--By doing this, this civ's unit is unaffected, whilst all other civ's unit are slowed down as was the original intention.
INSERT INTO Types
        (Type,                            Kind)
VALUES    ('ABILITY_LAMPPOST_COUNTER',    'KIND_ABILITY');

INSERT INTO TypeTags
        (Type,                            Tag)
VALUES    ('ABILITY_LAMPPOST_COUNTER',    'CLASS_ALL_UNITS');

INSERT INTO UnitAbilities
        (Description,                                    Name,                                    UnitAbilityType)
VALUES    ('LOC_ABILITY_LAMPPOST_COUNTER_DESCRIPTION',    'LOC_ABILITY_LAMPPOST_COUNTER_NAME',    'ABILITY_LAMPPOST_COUNTER');

INSERT INTO UnitAbilityModifiers
        (UnitAbilityType,                        ModifierId)
VALUES    ('ABILITY_LAMPPOST_COUNTER',            'COUNTER_MOVEMENT');

INSERT INTO Modifiers
        (ModifierId,                    ModifierType                                    SubjectRequirementSetId)
VALUES    ('COUNTER_MOVEMENT',            'MODIFIER_PLAYER_UNIT_ADJUST_MOVEMENT',            'NEXT_TO_LAMPPOST');

INSERT INTO ModifierArguments
        (ModifierId,                    Name,            Value    )
VALUES    ('COUNTER_MOVEMENT',            'Amount',        1        );

INSERT INTO TraitModifiers
        (TraitType,                                                ModifierId)
VALUES    ('TRAIT_CIVILIZATION_BC_AGUM_PASS_WONDER_BUILDER',        'LAMPPOST_SLOW_COUNTER');

INSERT INTO Modifiers
        (ModifierId,                ModifierType)
VALUES    ('LAMPPOST_SLOW_COUNTER',    'MODIFIER_PLAYER_UNITS_GRANT_ABILITY');

INSERT INTO ModifierArguments
        (ModifierId,                Name,            Value)
VALUES    ('LAMPPOST_SLOW_COUNTER',    'AbilityType',    'ABILITY_LAMPPOST_COUNTER');
 
Last edited:
Top Bottom