View Full Version : Bugged trait - Can't find the issue
Meneldil
12-11-2005, 09:43
I'm trying to make a different 'factionleader' trait for each faction. Although it seems quite easy, I for some reason can't do that without getting a CTD when right-clicking on a faction character.
I tried with the Byzantine faction leader. Here's the trait, as in export_descr_character_traits :
Trait :
;------------------------------------------
Trait Byzantineleader
Characters family
Level Basileus
Description Basileus_desc
EffectsDescription Basileus_effects_desc
Threshold 1
Effect Influence 2
Effect Command 1
Effect PersonalSecurity 3
;------------------------------------------
Trigger :
;------------------------------------------
Trigger Byzantineleader
WhenToTest BecomesFactionLeader
Condition FactionType sassanids
Affects Byzantineleader 1 Chance 100
;------------------------------------------
I'm absolutely lost at what was going on. I just deleted all the vanilla traits, both in traits files and descr_strat. I copied the 'factionleader' traits and renamed everything 'Byzantineleader' or 'Basileus', created entries in VnV_enums and corresponding descriptions. I tried to delete or to change the 'Condition FactionType sassanids', but with no effect. The only thing that could cause the issues is that I deleted the anti-trait factionheir.
The trait is correctly validated by the traits and ancilliaries validator.
GiantMonkeyMan
12-11-2005, 23:16
has the guy still got the old faction leader trait in descr_strat?... also the faction heir/leader triggers have to work together... perhaps make a new faction heir trait as well unless you can't be bothered but from a quick glance that looks fine....
Try differentiating the trigger name from the trait name, maybe this causes the problems.
Malrubius
12-12-2005, 17:00
the VnVs enums file (actually, all enums files) are ignored by RTW. You need to edit export_VnVs.txt in your Data\text folder with the correct entries. The validator does not work with this Unicode file, so it doesn't check for valid entries in export_VnVs.txt, but it does generate a sample enums file for all non-hidden traits, which must have corresponding entries in export_VnVs, so you just need to make sure those entries exist.
{Basileus} Basileus
{Basileus_desc}
This dude is the basileus!
{Basileus_effects_desc}
+1 Influence
The giveaway is that it CTD's when you pull up the general's list of traits. That means the entry in export_VnVs.txt is bad.
Meneldil
12-13-2005, 13:08
Well, I found the issue. Apparently, I had to give it an 'antitrait heir'. If I delete it, it CTD's, but it work fine with the antitrait (even if there's no trigger to activate it).
Now, I'm facing another problem. I've spent 1 hour wondering why this trait wouldn't work.
Trait :
;------------------------------------------
Trait Jorsalfar
Characters family
Level Jorsalfar
Description Jorsalfar_desc
EffectsDescription Jorsalfar_effects_desc
Epithet Jorsalfar_epithet_desc
Threshold 1
Effect Influence 2
Effect Management 2
;------------------------------------------
Trigger :
;------------------------------------------
Trigger Jerusalem_Captured_Viking
WhenToTest CharacterTurnEnd
Condition EndedInSettlement
and RemainingMPPercentage = 100
and SettlementName Jerusalem
and CultureType hun
Affects Jorsalfar 1 Chance 100
;------------------------------------------
It has the good entries in export_VnVs (including the epithet one). Basically, the character should get this train when he ends his turn in Jerusalem, with his full MP. But, whatever the hell I do, the trait just *won't* work when there's a condition 'and SettlementName Jerusalem'. I tried to make a WhenToTest GeneralCaptureSettlement - Condition SettlementName Jerusalem' trigger, it didn't work either.
Now, I'm not totally stupid, and I double, and even triple checked the settlement's name. I even tried with the settlement in game name ('al-Quds aš-Šarīf'. It caused a fatal error because of unrecognized letters), with the province tag (Judea), and with the province in game name (also Judea).
I know the settlementname condition works with the anciliaries in BI/RTW, but does it work aswell with traits ?
For now, I'll leave it like that, as I don't want to spend a whole day finding the issue, but I just see no reason this trait wouldn't work.
Meneldil
12-13-2005, 14:59
Ok, after reading all the topics related to traits, anciliaries and scripts, I finally found what was going on.
The SettlementName condition definitely looks for the display name (here, 'al-Quds aš-Šarīf'), not for the tag (in my case 'Jerusalem'). Since using the 'al-Quds aš-Šarīf' name in the trait file create a fatal error, I changed the display name to 'al-Quds as-Sarif', and changed the condition to
SettlemmentName al-Quds_as-Sarif
It didnt work, so I changed the display name to 'Jerusalem', and the condition to settlementname Jerusalem, and it worked fine.
It might be an old news to experienced traiters/scripters, but I haven't seen any reference to that in any topic.
Edit : I should have looked better - https://forums.totalwar.org/vb/showthread.php?t=43121
Malrubius
12-13-2005, 17:22
Working on the EB map, I'd figure you'd have known about this. :san_wink: That's why we have no Settlement Names with spaces in them.
Meneldil
12-14-2005, 13:21
Heh, I never bothered about the names, I was told not to edit them. :san_wink:
Now, I'm having another problem : none of the traits I made work. They worked fine yesterday, but today, they won't trigger. This is driving me crazy :san_shocked:
Malrubius
12-15-2005, 01:34
What changed between yesterday and today?
Meneldil
12-15-2005, 18:09
Well, not a lot of thing, I just tried to clear the whole file by sorting triggers in alphabetical order. Something was likely deleted or replaced in the process. I'll just restart the whole stuff over. I'm now a little bit more experienced, so it will probably be easier.
Malrubius
12-17-2005, 01:16
Moving or deleting triggers shouldn't cause a crash; deleting the trait descriptions would. When rearranging triggers, remember that their order matters (they are processed from top of the file down, so a trigger at the bottom that relies on a trigger at the top being set will fail to work if you swap them).
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.