Trying to add traits to my civ

Rosetwig

Chieftain
Joined
Dec 28, 2016
Messages
2
So this is my first modded civ. Everything has gone ok up until making the civ trait. It's the last thing to do before the civ i complete. I've solved everything up until this point but i just can't figure out how to make it work.

I want to make it so all lake tiles give culture and all forest tiles give extra food and productions. As far as i understand Lakes are the same as coasts as far as code is concerned. So it will make it so that lake and coast tiles give cultre and im okay with that.

<Trait_Terrains>
<Row>
<TraitType>TRAIT_SKOG_OCH_SJÖ</TraitType>
<TerrainType>TERRAIN_FORREST</TerrainType>
<YieldType>YIELD_PRODUCTION</YieldType>
<Yield>1</Yield>
</Row>
<Row>
<TraitType>TRAIT_SKOG_OCH_SJÖ</TraitType>
<TerrainType>TERRAIN_FORREST</TerrainType>
<YieldType>YIELD_FOOD</YieldType>
<Yield>2</Yield>
</Row>
<Row>
<TraitType>TRAIT_SKOG_OCH_SJÖ</TraitType>
<TerrainType>TERRAIN_COAST</TerrainType>
<YieldType>YIELD_CULTURE</YieldType>
<Yield>1</Yield>
</Row>
</Trait_Terrains>

This is how i wrote it but it doesn't work. and by doesn't work i mean it make all the ui dissapear after you've slected the civ.
Any idea how to make it work?
 
Firstly, 'Forests' are not a terrain but a Feature, so you are unable to use forests in the <TerrainType>-tag under <Trait_Terrains>. Furthermore, you misspelled Forest for Forrest (Forest has a single r and not a double r). :)
I'm not entirely sure if there's an equivalent trait for features instead, but what I do know is that the Longhouse building (from the Iroquioi) shares something which you want, namely production on forests!
Code:
<Building_FeatureYieldChanges>
     [..]
     <Row>
            <BuildingType>BUILDING_LONGHOUSE</BuildingType>
            <FeatureType>FEATURE_FOREST</FeatureType>
            <YieldType>YIELD_PRODUCTION</YieldType>
            <Yield>1</Yield>
        </Row>
    [..]
 </Building_FeatureYieldChanges>
So what you could is create a dummy building (see the description below) which utilises this table. (You can try to add an additional row to make it provide food as well, though I'm unsure if Firaxis has coded this in as well. Trying it wouldn't hurt I guess!)
But how do we get this building in every city of ours, you may ask? Well, for that we resort to a part of Carthage's trait: A free harbour in every city.
Now, we're not really interested in the Harbour-part, but more in the "I get a free building in every city"-part! So check how it is coded for Carthage, but adapt it to grant your 'Longhouse dummy' to your civ instead!

-----------
dummy building: A building that is hidden from the view of the player to give a certain effect. It's usually used as a marker for something, or to grant bonuses for a Unique Ability.


------------

P.s. You posted in the wrong subforum and I've asked a mod to move this
P.p.s. You can use [CODE] and [/CODE] tags to neatly order your code, since it preserves spacing!
 
The "Modding Tutorials and Reference" sub-forum is for completed modding tutorials and reference guides. All queries and requests for help go in the main Creation and Customisation forum. I've moved this thread to there.
 
Back
Top Bottom