Modification to the Trait Table?

Protroid

Chieftain
Joined
Apr 13, 2013
Messages
57
Location
United States
Hello, I want to make a civilization that provides units with a 20% Combat bonus if they are adjacent to a friendly city, similar to the Defender of the Faith religious belief. However, the code for DotF is in the Beliefs table, not Traits. If anyone can either help or direct me to a good tutorial on how to add this to the Traits table, that would be wonderful.
 
If you track down the part of CivUP/GEM where he gives Ghandi an worker instead of a warrior to start the game, you'll find an excellent example of creating a custom trait that links from XML to lua and could then be applied to any civilization in theory. I know because that's what I did :) It was a while ago though, if you need more direction I can go look again. Suprisingly I think it's in CivUP not GEM - pay special attention to his tools lua files (MT_whatever) and grep is your friend. In the leader xml for Ghandi there is a trait called NoWarrior, grep on that and you should find all you need.
 
I believe I've found it in G&KEnhancedMod/GEM/Leaders/GEL_Data;

<Update>
<Where Type="TRAIT_POPULATION_GROWTH" />
<Set CityUnhappinessModifier="0"
PopulationUnhappinessModifier="-20"
NoWarrior="true"
FreeUnit="UNITCLASS_WORKER"
/>
<!-- 100, -50 -->
</Update>

Please forgive my incompetence in advance (I am not entirely familiar with LUA) but how would I go about re-creating this system in a new mod?
 
Back
Top Bottom