1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[R&F] Adding a Custom Civ Trait

Discussion in 'Mod Creation Help' started by Kino_, Mar 3, 2018.

  1. Kino_

    Kino_ Chieftain

    Joined:
    Jul 28, 2006
    Messages:
    4
    Hey,

    So I'm attempting to make my first mod. I'm using Josh's template and I've managed to get most of what I want working. However, something I've done below is wrong. It's the only thing I've changed from loading fine to crashing back to the main menu.

    Code:
    --==========================================================================================================================
    -- CIVILIZATIONS: TRAITS
    --==========================================================================================================================
    -- Types
    --------------------------------------------------------------------------------------------------------------------------   
    INSERT INTO Types   
           (Type,                                                   Kind)
    VALUES   ('TRAIT_CIVILIZATION_KIN_GRIND',                   'KIND_TRAIT'),
           ('TRAIT_CIVILIZATION_BUILDING_KIN_CUSTOM',           'KIND_TRAIT');   
    --------------------------------------------------------------------------------------------------------------------------           
    -- Traits           
    --------------------------------------------------------------------------------------------------------------------------               
    INSERT INTO Traits               
           (TraitType,                                                   Name,                                                   Description)
    VALUES   ('TRAIT_CIVILIZATION_KIN_GRIND',                   'LOC_TRAIT_CIVILIZATION_KIN_GRIND_NAME',               'LOC_TRAIT_CIVILIZATION_KIN_GRIND_DESCRIPTION'),
           ('TRAIT_CIVILIZATION_BUILDING_KIN_CUSTOM',           'LOC_TRAIT_CIVILIZATION_BUILDING_KIN_CUSTOM_NAME',       'LOC_TRAIT_CIVILIZATION_BUILDING_KIN_CUSTOM_DESCRIPTION');   
    --------------------------------------------------------------------------------------------------------------------------       
    -- TraitModifiers       
    --------------------------------------------------------------------------------------------------------------------------           
    INSERT INTO TraitModifiers           
           (TraitType,                                           ModifierId)
    VALUES   ('TRAIT_CIVILIZATION_KIN_GRIND',                   'KIN_TRAIT_IMPROVEMENT_FARM_PRODUCTION');                                                                                   
    --------------------------------------------------------------------------------------------------------------------------
    -- Modifiers
    --------------------------------------------------------------------------------------------------------------------------
    INSERT INTO Modifiers   
           (ModifierId,                                       ModifierType,                                   SubjectRequirementSetId)
    VALUES   ('KIN_TRAIT_IMPROVEMENT_FARM_PRODUCTION',           'MODIFIER_PLAYER_UNITS_ADJUST_PLOT_YIELD'       'PLOT_HAS_IMPROVEMENT_FARM_REQUIREMENTS');           
    --------------------------------------------------------------------------------------------------------------------------
    -- ModifierArguments
    --------------------------------------------------------------------------------------------------------------------------
    INSERT INTO ModifierArguments
           (ModifierId,                                   Name,                       Value)
    VALUES   ('KIN_TRAIT_IMPROVEMENT_FARM_PRODUCTION',       'YieldType',               'YIELD_PRODUCTION'),
           ('KIN_TRAIT_IMPROVEMENT_FARM_PRODUCTION',       'Amount',                   '3');   
           --------------------------------------------------------------------------------------------------------------------------
    -- RequirementSets
    --------------------------------------------------------------------------------------------------------------------------
    INSERT INTO RequirementSets
           (RequirementSetId,                                       RequirementSetType,               RequirementId)
    VALUES   ('PLOT_HAS_IMPROVEMENT_FARM_REQUIREMENTS',               'REQUIREMENTSET_TEST_ALL',       'REQUIRES_PLOT_HAS_FARM');    
    Can anyone see what I've done wrong?

    Many thanks.
     
  2. LeeS

    LeeS Imperator

    Joined:
    Jul 23, 2013
    Messages:
    5,724
    Location:
    Illinois, USA
    Missing comma in the VALUES line
    Code:
    INSERT INTO Modifiers   
           (ModifierId,                                       ModifierType,                                   SubjectRequirementSetId)
    VALUES   ('KIN_TRAIT_IMPROVEMENT_FARM_PRODUCTION',           'MODIFIER_PLAYER_UNITS_ADJUST_PLOT_YIELD'       'PLOT_HAS_IMPROVEMENT_FARM_REQUIREMENTS'); 
    Also, integer values don't need '' wraps, so
    Code:
    '3'
    for your amount value can be stated as
    Code:
    3
    I think the database will stil still interpret '3' as an integer but you don't need to perform the extra typing.
     
  3. Kino_

    Kino_ Chieftain

    Joined:
    Jul 28, 2006
    Messages:
    4
    Thanks, frustrating to know it was something so simple! Much appreciated.
     

Share This Page