Thấy bác lantis999 làm mod cho unit rồi, mình sẽ hướng dẫn làm mod cho traits.
Traits nằm trong file export_descr_character_traits.txt, bao gồm thuộc tính của các traits và trigger cho nó.
Lấy ví dụ trait Handsome, thuộc tính của nó được viết như sau
Trait Handsome
Characters family
NoGoingBackLevel 1
AntiTraits Ugly
Level Handsome
Description Handsome_desc
EffectsDescription Handsome_effects_desc
Threshold 1
Effect LocalPopularity 1
Level Physically_Attractive
Description Physically_Attractive_desc
EffectsDescription Physically_Attractive_effects_desc
Threshold 2
Effect LocalPopularity 2
Level Striking_to_Behold
Description Striking_to_Behold_desc
EffectsDescription Striking_to_Behold_effects_desc
Threshold 3
Effect Authority 1
Effect LocalPopularity 3
Level Physically_Flawless
Description Physically_Flawless_desc
EffectsDescription Physically_Flawless_effects_desc
Epithet Physically_Flawless_epithet_desc
Threshold 4
Effect Command -1
Effect Authority 1
Effect LocalPopularity 4
Trong đó các level là "
Handsome, Physically_Attractive, Striking_to_Behold, Physically_Flawless", tương ứng với 1 con số "Threshold" sẽ được dùng ở phần trigger.
Trong mỗi level, sẽ có các thuộc tính tương ứng như Command, Authority ... và mức độ cho các thuộc tính này. Nếu ở Level Physically_Flawless, sửa
"Effect Command -1" thành
"Effect Command 9" thì tướng nào có trait này, đều sẽ có 9 sao command hết

.
Còn trigger, nó sẽ có cấu trúc như sau
Trigger dads_handsome
WhenToTest CharacterComesOfAge
Condition FatherTrait Handsome >= 1
Affects Handsome 1 Chance 50
Affects Handsome 1 Chance 25
Trigger này áp dụng cho general khi 16 tuổi. Trigger thường đi kèm với condition (không bắt buộc), như ở đây là Father phải có level Handsome trở lên. Trigger sẽ có cấu trúc là
Affects {Trait} {Threshold} Chance {Percentage}
ví dụ Affects Handsome 4 Chance 100 thì sẽ trả về trait handsome ở mức 4, tức là Physically_Flawless (đi kèm Authority 9 và Command 9) với xác suất 100%

.
Như vậy các Traits cần lưu ý bao gồm
- GoodCommander, Effect Command: tăng command
- GoodDiplomacy, Effect Authority: tăng Authority
- LoyaltyStarter, Effect Loyalty: tăng Loyalty
- Upright, giảm corruption
- HaleAndHearty, Effect Fertility and Hitpoints: tăng khả năng sinh con và hitpoints trong battle
- HighPersonalSecurity, Effect PersonalSecurity: phòng chống ám sát
- TouchedByTheGods hay PublicFaith, Effect Piety: tăng chỉ số Piety, không lo inquisitor ghé thăm
- StrategyDread và BattleDread, tăng Dread
- StrategyChivalry và BattleChivalry, tăng Chivalry
Nhưng làm sao để trigger các trait này cho faction của mình thôi. Lúc ấy phải dùng đến 1 trigger riêng là
Trigger random_birth_{faction}. Ví dụ như faction byzantium thì dùng
Trigger random_birth_byzantium.
Trigger random_birth_byzantium
WhenToTest CharacterComesOfAge
Condition FactionType byzantium
Affects {Trait} {Threshold} Chance 100
Chỉ cần đến tuổi trưởng thành là nó sẽ có cái traits đó.
Để đơn giản hơn, chúng ta sẽ nhét tất cả các thuộc tính vào 1 level của trait nào đó. Mình thích handsome nên nhét tất cả vào level 4 Physically_Flawless
Level Physically_Flawless
Description Physically_Flawless_desc
EffectsDescription Physically_Flawless_effects_desc
Epithet Physically_Flawless_epithet_desc
Threshold 4
Effect Command 9
Effect Dread 9
Effect Chivalry 9
Effect Authority 9
Effect Fertility 3
Effect HitPoints 4
Effect PersonalSecurity 4
Effect Piety 9
Effect Loyalty 9
Và trigger cho cái trait này
Trigger random_birth_byzantium
WhenToTest CharacterComesOfAge
Condition FactionType byzantium
Affects Handsome 4 Chance 100
Và kết quả đây
Thằng tướng 16 tuổi sẽ có full chỉ số, ám sát không chết, đẻ như heo giống...
Mình chưa attach file được nên bạn nào cần thì pm mình. Mình sẽ gửi file gốc export_descr_character_traits.txt