*HELP* XML civ trait

steveforez

Chieftain
Joined
Sep 18, 2014
Messages
56
Location
France
Well, my mod work good but my trait fail.
Spoiler Trait Code :

Code:
    <Modifiers>
        <Row>
            <ModifierId>TRAIT_ADDCULTURE_PASTURE</ModifierId>
            <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
            <SubjectRequirementSetId>PLOT_HAS_PASTURE_REQUIREMENTS</SubjectRequirementSetId>
        </Row>
        <Row>
            <ModifierId>TRAIT_ADDGOLD_PASTURE</ModifierId>
            <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
            <SubjectRequirementSetId>PLOT_HAS_PASTURE_REQUIREMENTS</SubjectRequirementSetId>
        </Row>
    </Modifiers>
   
    <ModifierArguments>
        <Row>
            <ModifierId>TRAIT_ADDCULTURE_PASTURE</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_CULTURE</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_ADDCULTURE_PASTURE</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_ADDGOLD_PASTURE</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_GOLD</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_ADDGOLD_PASTURE</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>
    </ModifierArguments>
   
    <RequirementSets>
        <Row>
            <RequirementSetId>PLOT_HAS_PASTURE_REQUIREMENTS</RequirementSetId>
            <RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
        </Row>
    </RequirementSets>

    <Requirements>
        <Row>
            <RequirementId>REQUIRES_PLOT_HAS_PASTURE</RequirementId>
            <RequirementType>REQUIREMENT_PLOT_IMPROVEMENT_TYPE_MATCHES</RequirementType>
        </Row>
    </Requirements>

    <RequirementArguments>
        <Row>
            <RequirementId>REQUIRES_PLOT_HAS_PASTURE</RequirementId>
            <Name>ImprovementType</Name>
            <Value>IMPROVEMENT_PASTURE</Value>
        </Row>
    </RequirementArguments>
   
    <RequirementSetRequirements>
        <Row>
            <RequirementSetId>PLOT_HAS_PASTURE_REQUIREMENTS</RequirementSetId>
            <RequirementId>REQUIRES_PLOT_HAS_PASTURE</RequirementId>
        </Row>
    </RequirementSetRequirements>
   
    <TraitModifiers>
        <Row TraitType="TRAIT_CIVILIZATION_HORSE_CULTURE">
            <ModifierId>TRAIT_ADDCULTURE_PASTURE</ModifierId>
        </Row>
        <Row TraitType="TRAIT_CIVILIZATION_HORSE_CULTURE">
            <ModifierId>TRAIT_ADDGOLD_PASTURE</ModifierId>
        </Row>
    </TraitModifiers>


(For write this, i have see on belief file in God of open sky )

Log Error :
[Gameplay] ERROR: UNIQUE constraint failed: RequirementSets.RequirementSetId
[3023901.534] [Gameplay]: Validating Foreign Key Constraints...
[3023901.553] [Gameplay]: Passed Validation.
[3024048.766] [FullTextSearch]: FTS - Creating Context
[3024050.390] [FullTextSearch]: FTS - Creating Context
[3024055.365] [FullTextSearch]: FTS - Creating Context
 
RequirementSet for a plot having a pasture is already a thing. Delete or comment out all the Requirement defining code and it should work.

Specifically, <Requirements>, <RequirementArguments>, <RequirementSets> and <RequirementSetRequirements> aren't needed.
 
@ITcore ok i try thanks.

EDIT : ok, the mod work but not the Trait ...

Spoiler New trait code :

Code:
    <Modifiers>
        <Row>
            <ModifierId>TRAIT_ADDCULTURE_PASTURE</ModifierId>
            <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
            <SubjectRequirementSetId>PLOT_HAS_PASTURE_REQUIREMENTS</SubjectRequirementSetId>
        </Row>
        <Row>
            <ModifierId>TRAIT_ADDGOLD_PASTURE</ModifierId>
            <ModifierType>MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD</ModifierType>
            <SubjectRequirementSetId>PLOT_HAS_PASTURE_REQUIREMENTS</SubjectRequirementSetId>
        </Row>
    </Modifiers>
 
    <ModifierArguments>
        <Row>
            <ModifierId>TRAIT_ADDCULTURE_PASTURE</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_CULTURE</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_ADDCULTURE_PASTURE</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_ADDGOLD_PASTURE</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_GOLD</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_ADDGOLD_PASTURE</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>
    </ModifierArguments>
 
    <TraitModifiers>
        <Row>
            <TraitType>TRAIT_CIVILIZATION_HORSE_CULTURE</TraitType>
            <ModifierId>TRAIT_ADDCULTURE_PASTURE</ModifierId>
        </Row>
        <Row>
            <TraitType>TRAIT_CIVILIZATION_HORSE_CULTURE</TraitType>
            <ModifierId>TRAIT_ADDGOLD_PASTURE</ModifierId>
        </Row>
    </TraitModifiers>


Spoiler Screen :
 
Last edited:
Maybe i don't use good modifier ?

I m really lost in this f***** trait. I don't have database or gameeffect error in log .... Why he don't want work !!!

I really need help !
 
You did add the TraitType: TRAIT_CIVILIZATION_HORSE_CULTURE to the CivilizationType, right? Should be:

<CivilizationTraits>
<Row CivilizationType="YOUR_CIV_HERE" TraitType="TRAIT_CIVILIZATION_HORSE_CULTURE" />
</CivilizationTraits>
 
Yeah, I'll check it out. Add it an archive and upload the file so I can load it up in my program.
 
ok thanks for your time

(log dialog in my last try)
Spoiler database log :

[3049677.508] [Localization]: Validating Foreign Key Constraints...
[3049677.509] [Localization]: Passed Validation.
[3049677.687] [Configuration]: Validating Foreign Key Constraints...
[3049677.688] [Configuration]: Passed Validation.
[3049685.072] [FullTextSearch]: Initializing FullTextSearch
[3049688.304] [Gameplay]: Validating Foreign Key Constraints...
[3049688.322] [Gameplay]: Passed Validation.
[3049690.328] [Configuration]: Validating Foreign Key Constraints...
[3049690.329] [Configuration]: Passed Validation.
[3049712.323] [FullTextSearch]: FTS - Creating Context
[3049733.538] [Configuration]: Validating Foreign Key Constraints...
[3049733.539] [Configuration]: Passed Validation.
[3049831.300] [Gameplay]: Validating Foreign Key Constraints...
[3049831.379] [Gameplay]: Passed Validation.
[3049890.011] [FullTextSearch]: FTS - Creating Context
[3049891.915] [FullTextSearch]: FTS - Creating Context
[3049896.470] [FullTextSearch]: FTS - Creating Context
 

Attachments

  • Huns.zip
    1.4 KB · Views: 53
Last edited:
1) Missing KIND_LEADER type.

2) Missing KIND_UNIT type.

3) Missing leader trait (you have Civ traits).

Do you have any of the DLC leaders? If so, model the mod after that layout. Or, better yet, insert your code into a mod civ and test that out.
 
i do make the leader kind and the unit kind in the civ file to ? i send you the complete build mod ..
 

Attachments

  • Huns.zip
    6.3 MB · Views: 109
I'm sorry, but I can't seem to figure it out. It's weird that it doesn't show any error's in the logs despite not working.
 
yes , i try to change the key mod and rebuild. If don't work, i looking another trait ... Civ VI is very hard for make mod ...
Thank you again ITcore for take a little of your time.
 
Steveforez, I fixed your Huns.xml and the pasture/culture/gold ability works now. For whatever reason, the game engine did not like you using a Requirement Set (PLOT_HAS_PASTURE_REQUIREMENTS) without spelling it out in your own mod. It was simply not registering the Requirement formula. That happens quite often. So I usually reformulate base game Requirements instead of referencing the ones already spelled out. I adapted it for your purposes and inserted it into Huns.xml. I also used a different ModifierType -- MODIFIER_PLAYER_ADJUST_PLOT_YIELD -- I find this one is cleaner, more straightforward and gives more consistent results. The one you were using is usually employed in a 2-step formula TRAIT_ADDCULTURE_PASTURE / TRAIT_ADDCULTURE_PASTURE_MODIFIER in the base game, and I think it's intended to be used that way (although I've seen people use it without the 2-step approach, but always in simpler application, never for Traits/Beliefs/BuildingModifiers/Etc.). I have a suspicion that MODIFIER_CITY_PLOT_YIELDS_ADJUST_PLOT_YIELD is meant to have a qualification -- i.e., What City? How Characterized? For example, does it follow Panteon Requirements? Without the extra condition it feels disembodied.

Anyways, the file is attached. I only considered the Trait and did not look any further. Good luck!
 

Attachments

  • Huns.xml
    8.8 KB · Views: 72
Top Bottom