1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    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,409
    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