PDA

View Full Version : Help with adding a trait



Sheep
06-02-2009, 09:58
Hello all,

I'm attempting to add an antitrait for the Roman_Provincial_Governor_Effect trait, which confers bonuses to characters who become governors of "provinces" (ie, Sicily, Achaia). Currently, as I understand it, if a character leaves the "province" he is governor of, he won't lose the bonuses because there is no antitrait, and in fact if he comes back the bonuses will be duplicated. See here (https://forums.totalwar.org/vb/showpost.php?p=2223558&postcount=2) and here (https://forums.totalwar.org/vb/showpost.php?p=2242269&postcount=6) in this thread (https://forums.totalwar.org/vb/showthread.php?p=2242269#post2242269).

I've tinkered around in the trait file before, changing thresholds and adding triggers (basically copy and paste work), but I have no experience adding new traits. The problem is that when I add the new trait, it messes things up drastically. When I start a new Roman game, the family name of all the characters has disappeared (ie, it just says "Manius " instead of "Manius Curius Dentatus") and if you right-click on the character to open up his scroll, the game CTDs with no error message.

Here is what I've written. It's the middle trait of three listed below. I know I need to make it an antitrait of the first one but I left it off to narrow down where the problem is. I still get the same problem in-game whether it's listed as an antitrait or not so I'm pretty sure it's in this code somewhere.


;------------------------------------------
Trait Roman_Provincial_Governor_Effect
Characters family
Hidden
ExcludeCultures barbarian, eastern, egyptian, carthaginian, greek, nomad

Level Hidden
Description Hidden_desc
EffectsDescription Hidden_effects_desc
Threshold 1

Effect Management 1
Effect Law 1

;------------------------------------------
Trait noRoman_Provincial_Governor_Effect
Characters family
Hidden
ExcludeCultures barbarian, eastern, egyptian, carthaginian, greek, nomad

Level LoseGovBonus
Description Hidden_desc
EffectsDescription Hidden_effects_desc
Threshold 1

;------------------------------------------
Trait Propraetor_Provinciae
Characters family
ExcludeCultures barbarian, eastern, egyptian, carthaginian, greek, nomad
NoGoingBackLevel 2
AntiTraits Proconsul_Provinciae

Level Propraetor_Provinciae
Description Propraetor_Provinciae_desc
EffectsDescription Propraetor_Provinciae_effects_desc
Threshold 1

Effect Influence 1

I'm hoping an obvious problem pops out at someone when they look at this because I can't figure out what's wrong. Or maybe there is something I need to add somewhere else to make this work? I added {LoseGovBonus} to export_VnVs at the end and I have not changed any triggers in the trait file yet or added anything other than what you see above. Thanks in advance!

Atraphoenix
06-03-2009, 00:32
you have added required lines like
Renowned_General
Renowned_General_desc
Renowned_General_effects_desc
Famous_General
Famous_General_desc
Famous_General_effects_desc your new trait to export_descr_VnVs_enums.txt also export_VnVs.txt like
¬--------------------

{Swift} Swift

{Swift_desc}
Different people move at different paces.

{Swift_effects_desc}
+90% movement; have not you?
if you forget editing any of the file you will get a certain CTD :whip:
you have to write the description of the trait.

Sheep
06-03-2009, 10:33
you have added required lines like your new trait to export_descr_VnVs_enums.txt also export_VnVs.txt like ; have not you?
if you forget editing any of the file you will get a certain CTD :whip:
you have to write the description of the trait.

I added it to export_VnVs but I was under the impression the enums file was obsolete now. I added it anyway and nothing changed. Oh well, guess I will just wait for EB to post a fix or someone else to figure it out.

konny
06-03-2009, 17:24
When I start a new Roman game, the family name of all the characters has disappeared (ie, it just says "Manius " instead of "Manius Curius Dentatus") and if you right-click on the character to open up his scroll, the game CTDs with no error message.

This sounds as if the game is not able to read the trait file at all. Do the characters have any command stars displayed on the start map?


Here is what I've written. It's the middle trait of three listed below. I know I need to make it an antitrait of the first one but I left it off to narrow down where the problem is. I still get the same problem in-game whether it's listed as an antitrait or not so I'm pretty sure it's in this code somewhere.

My guess would be that you accidently have hit spa ce or re
turn
somewhere in the file while browsing around. Or that the level name "LoseGovBonus" is allready used for another trait. In this case use another, by guarantee unique, name. If you had messed up the format at one point, it would be nearly impossible to find the error. Use a backbup of the trait file and start anew.


At this point I would like to advertise my Excel Traiteditor, even though it was written for M2TW, most of it would work for RTW too: http://www.twcenter.net/forums/showthread.php?t=259316 ;-)

Atraphoenix
06-03-2009, 21:52
At this point I would like to advertise my Excel Traiteditor, even though it was written for M2TW, most of it would work for RTW too: http://www.twcenter.net/forums/showthread.php?t=259316 ;-)

when I started to mod EOM, unfortunately I had to write their codes one by one. Though M2TW has an ancillary editor, I could not work it for RTW, this may be because I use vista.
At least, squid's trait and ancillary verificator saved my life.

it does not edit trait and ancillaries but a perfect tool to check and verify them, I forgot the link but you can find it "modding tools for RTW".

It may help you a lot. you should try it as well.

I hope konny would make an ancillary editor for me :yes:

konny
06-04-2009, 00:08
I hope konny would make an ancillary editor for me :yes:

I am using this for ancillaries too (that is for the triggers). The only difference would be the AcquireAnciallry instead of Affects. For making the new ancillary itself I always use an existing one as blueprint. I also use the exact name of the ancillary in all descrs, the image and the trigger. That way I can make tons of similar ancillaries very fast with C&P.

MerlinusCDXX
06-12-2009, 20:32
... "LoseGovBonus" is allready used for another trait. In this case use another, by guarantee unique, name. If you had messed up the format at one point, it would be nearly impossible to find the error. Use a backbup of the trait file and start anew.


At this point I would like to advertise my Excel Traiteditor, even though it was written for M2TW, most of it would work for RTW too: http://www.twcenter.net/forums/showthread.php?t=259316 ;-)

Is it possible that the "LoseGovBonus" entry is used with the 'Not in his Satrapy' trait for Arche Seleukeia? The way their gov bonus works is that the bonus is gained through an ancillary, and the trait kicks in if the governor is not present in the settlement required by the trigger. Would traits for another faction even affect Romani governor traits?

konny
06-17-2009, 14:06
Is it possible that the "LoseGovBonus" entry is used with the 'Not in his Satrapy' trait for Arche Seleukeia? The way their gov bonus works is that the bonus is gained through an ancillary, and the trait kicks in if the governor is not present in the settlement required by the trigger. Would traits for another faction even affect Romani governor traits?

Depends on how it is coded. In general the engine does not care on the faction of the character, as long as you do not explicitly tell it to do so.