Need a little help with TerrainType and ModifierArguments

Nagol Strache

Chieftain
Joined
Jan 14, 2016
Messages
18
As the title states, I'm having a bit of an issue with getting TerrainType and ModifierArguments to work. What I'm trying to do is create a unique ability that grants adjacency bonus to non-campus and holy site districts from mountains. For testing purposes I have it set to give a +10 science adjacency to the campus from mountains on the plains (I also removed the normal +1 adjacency as well).

When testing it out it doesn't seem to add the bonus, but it does remove the normal adjacency bonus. The database log doesn't seem to have any issues with anything, so I'm not sure if using TerrainType in this senario works or not.

Here's the code I have written, I'll also have the files to download if that is more helpful.
Spoiler Code :

Code:
<GameInfo>
    <Modifiers>
        <Row>
            <ModifierId>TRAIT_ADJACENT_MOUNTAINS_CAMPUS</ModifierId>
            <ModifierType>MODIFIER_PLAYER_CITIES_FEATURE_ADJACENCY</ModifierType>
        </Row>
    </Modifiers>
    <ModifierArguments>
        <Row>
            <ModifierId>TRAIT_ADJACENT_MOUNTAINS_CAMPUS</ModifierId>
            <Name>DistrictType</Name>
            <Value>DISTRICT_CAMPUS</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_ADJACENT_MOUNTAINS_CAMPUS</ModifierId>
            <Name>TerrainType</Name>
            <Value>TERRAIN_PLAINS_MOUNTAIN</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_ADJACENT_MOUNTAINS_CAMPUS</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_SCIENCE</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_ADJACENT_MOUNTAINS_CAMPUS</ModifierId>
            <Name>Amount</Name>
            <Value>10</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_ADJACENT_MOUNTAINS_CAMPUS</ModifierId>
            <Name>Description</Name>
            <Value>LOC_DISTRICT_JUNGLE_2_SCIENCE</Value>
        </Row>
    </ModifierArguments>
    <ExcludedAdjacencies>
        <Row YieldChangeId="Mountains_Science1" TraitType="TRAIT_DWARF_ADJACENT_MOUNTAINS"/>
        <Row YieldChangeId="Mountains_Science2" TraitType="TRAIT_DWARF_ADJACENT_MOUNTAINS"/>
    </ExcludedAdjacencies>
    <TraitModifiers>
        <Row>
            <TraitType>TRAIT_DWARF_ADJACENT_MOUNTAINS</TraitType>
            <ModifierId>TRAIT_ADJACENT_MOUNTAINS_CAMPUS</ModifierId>
        </Row>
    </TraitModifiers>
</GameInfo>


Any help will be very much appreciated!
 

Attachments

The basic problem here is that you are trying to apply a Modifier that references a Feature (i.e. FEATURE_JUNGLE) to a Terrain (i.e. TERRAIN_PLAINS_MOUNTAIN). Unfortunately, this is impossible. The Civ 6 XML language is not nearly flexible or advanced enough to allow the switch. The Modifier you used utilizes a built-in GameEffect that's exposed by the DLL. In other words, it's hardcoded. What you need to do is to find a modifier that does what you need it to do. If I come across anything I'll let you know. You should take a look in GameEffects.xml and Modifiers.xml. It may very well be that there is no modifier that fits. In that case, you'll need to get creative and find a work-around. I recommend you read the two excellent chapters here: https://forums.civfanatics.com/reso...ter-1-creating-and-attaching-modifiers.25683/ to start.
 
Yeah, I managed to find what I was looking for in the Beliefs data because I remembered that there's a belief that gives the Holy Site extra faith from tundra. I've been able to get it to work properly, so mission accomplished I guess.

Side Question: I'm adding the text that pops up when you mouse over a tile to see what's giving you what adjacencies, and I'm having a ERROR: NOT NULL appear in the database. Any idea what that might be about?

Spoiler Code :

Code:
<Row Tag="LOC_TRAIT_ADJACENT_MOUNTAINS_DISTRICT_COMMERCIAL_HUB1">
            <Text>+{1_num} [ICON_Gold] Gold from Mountain {1_Num : plural 1?tile; other?tiles;}.</Text>
        </Row>

        <Row Tag="LOC_TRAIT_ADJACENT_MOUNTAINS_DISTRICT_COMMERCIAL_HUB2">
            <Text>+{1_num} [ICON_Gold] Gold from Mountain {1_Num : plural 1?tile; other?tiles;}.</Text>
        </Row>

        <Row Tag="LOC_TRAIT_ADJACENT_MOUNTAINS_DISTRICT_COMMERCIAL_HUB3">
            <Text>+{1_num} [ICON_Gold] Gold from Mountain {1_Num : plural 1?tile; other?tiles;}.</Text>
        </Row>

        <Row Tag="LOC_TRAIT_ADJACENT_MOUNTAINS_DISTRICT_COMMERCIAL_HUB4">
            <Text>+{1_num} [ICON_Gold] Gold from Mountain {1_Num : plural 1?tile; other?tiles;}.</Text>
        </Row>

        <Row Tag="LOC_TRAIT_ADJACENT_MOUNTAINS_DISTRICT_COMMERCIAL_HUB5">
            <Text>+{1_num} [ICON_Gold] Gold from Mountain {1_Num : plural 1?tile; other?tiles;}.</Text>


Edit: Never mind, found out what was causing it. I accidentally misspelled the commercial hub in another file that was calling these, lol
 
Last edited:
Back
Top Bottom