Results 1 to 8 of 8

Thread: Need Help For Triggers for Traits

  1. #1

    Default Need Help For Triggers for Traits

    This is driving me nuts. I hope someone is willing to help. Making modifications for personal use and have been toying with the idea that certain families in-game get bonuses to their descendants when they come of age. What I can't get is why the game ctd's when triggering for factions that are not player controlled? Like my character gets the bonuses, no ctd's, but other factions crash??? Please help modders....

    Here's the stuff you can stick at the bottom of the export_character_desc, no need to test my custom traits (it works), but the triggers for original eb2 traits keep failing.

    ;------------------------------------------------------------------------------------
    Trigger MakedonianAntigonides_Dynast_CharacterComesOfAge
    WhenToTest CharacterComesOfAge

    Condition FactionType f_makedonia
    and FatherTrait MakedonianAntigonides > 0

    Affects LoyaltyLevel 2 Chance 50
    Affects NaturalCharisma 1 Chance 50
    Affects NaturalEnergy 1 Chance 50
    Affects Temperament 1 Chance 50
    Affects HaleAndHearty 2 Chance 25

    ;------------------------------------------------------------------------------------
    Trigger Arsacid_Dynast_ComesOfAge
    WhenToTest CharacterComesOfAge

    Condition FactionType f_parthia
    and FatherTrait ParthiaArshaki > 2

    Affects Brave 4 Chance 50
    Affects NaturalIntelligence 1 Chance 100
    Affects NaturalCharisma 2 Chance 100
    Affects NaturalEnergy 2 Chance 50
    Affects Fertility 4 Chance 50

    ;------------------------------------------------------------------------------------
    Trigger Mauryan_Dynast_ComesOfAge
    WhenToTest CharacterComesOfAge

    Condition FactionType f_gandhara
    and FatherTrait GandharaMagadha > 0

    Affects Determined 1 Chance 50
    Affects NaturalIntelligence 2 Chance 50
    Affects NaturalCharisma 2 Chance 100
    Affects NaturalEnergy 1 Chance 100
    Affects Fertility 4 Chance 50

    ;------------------------------------------------------------------------------------
    Trigger Gens_Cornelia_ComesOfAge
    WhenToTest CharacterComesOfAge

    Condition FactionType f_rome
    and FatherTrait GensCornelia > 1

    Affects Determined 3 Chance 50
    Affects NaturalIntelligence 2 Chance 50
    Affects NaturalCharisma 1 Chance 100
    Affects LoyaltyLevel 2 Chance 50
    Affects HaleAndHearty 2 Chance 100

    ;------------------------------------------------------------------------------------
    Trigger Gens_Ivlia_ComesOfAge
    WhenToTest CharacterComesOfAge

    Condition FactionType f_rome
    and FatherTrait GensIvlia > 1

    Affects GoodLeader 5 Chance 25
    Affects NaturalEnergy 1 Chance 50
    Affects NaturalCharisma 2 Chance 50
    Affects Temperament 1 Chance 50
    Affects Fertile 8 Chance 50

    ;------------------------------------------------------------------------------------

    I've tearing my hair out trying to figure what went wrong. The spacing? The trigger names are all unique. I always play as Macedonia, and when there was only one set of custom triggers for my personal faction it went off, no problems. The log always shows this (I modified descr strat so that Yavanaraja is 15, just 4 turns till testing):

    18:09:31.732 [game.script.trigger] [trace] Trigger <Mauryan_Dynast_ComesOfAge> fired
    18:09:31.732 [system.rpt] [error] Unspecified error. Please compress your error log in a zip format and upload it on the EBII technical help forum.

  2. #2

    Default Re: Need Help For Triggers for Traits

    Follow up, I got rid of all triggers except for the makedonian (which has a 2 or 3 custom triggers above that for extra bonuses for my customized char - Alkyoneus ) and I got to turn 5 without any problems (Demetrius, second son of Antigonos was aged up to 15 to test for my stuff). Is there a length limit in export_descr_character_traits? Like anything past a certain line number becomes an error? I am completely stumped. Help pleassseee.

  3. #3

    Default Re: Need Help For Triggers for Traits

    Double post, see below.
    Last edited by MIKE GOLF; March 12, 2024 at 08:27 AM.

  4. #4

    Default Re: Need Help For Triggers for Traits

    In some of your triggers you are trying to grant more levels then the trait has. Fertile only has 3 levels in the game and you have a trigger trying to grant 8 levels of this trait: Affects Fertile 8 Chance 50. The same applies to: Affects Fertility 4 Chance 50.
    Spoiler Alert, click show to read: 
    Code:
    ;------------------------------------------
    Trait Fertile
        Characters family
        NoGoingBackLevel 8
    
        Level Fruitful
            Description Fruitful_desc
            EffectsDescription Fruitful_effects_desc
            Threshold  1
    
            Effect Fertility  1
    
        Level Fertile
            Description Fertile_desc
            EffectsDescription Fertile_effects_desc
            Threshold  4
    
            Effect Fertility  2
    
        Level Prolific
            Description Prolific_desc
            EffectsDescription Prolific_effects_desc
            Threshold  8
    
            Effect Fertility  3

    Also there is no trait called 'Determined' only EthnoDetermined, there is a trait 'Duty' that has 'Determined' as one of its levels.
    Spoiler Alert, click show to read: 
    Code:
    ;------------------------------------------
    Trait Duty
        Characters family
    
        Level Determined
            Description Determined_desc
            EffectsDescription Determined_effects_desc
            Threshold  1
    
            Effect Piety  1
    
        Level Ambitious
            Description Ambitious_desc
            EffectsDescription Ambitious_effects_desc
            Threshold  3
    
            Effect Piety  2
            Effect Command  1
            Effect PersonalSecurity -1
            Effect Loyalty -1
    Last edited by MIKE GOLF; March 12, 2024 at 08:31 AM.

  5. #5

    Default Re: Need Help For Triggers for Traits

    Ok...this might fundamentally change my understanding of the structure of these text files...but I'll hear the answer to my question. Those traits - fertile for example - have thresholds right? So fertile level 1 (fruitful) has a threshold of 1. Fertile level 2 (Fertile) has a threshold of 4. Fertile level 3 (Prolific) has a value of 8. I always thought the values after the trait name in the affects line are those "points" to add up to the threshold. Am I wrong?

    DANG!! Thanks for pointing out what my nigh blind eyes missed. Determined you little %$##....

  6. #6

    Default Re: Need Help For Triggers for Traits

    The trigger 'Affects Fertile 8 Chance 50' is the number of levels the trigger will grant, which is not the same as the traits threshold number. I'd have to reread the tutorial again to define what threshold means in the edct, but I haven't had a cup of coffee yet and I have to bugger off to work as well. Hope this helps.

  7. #7
    Foederatus
    Join Date
    May 2011
    Location
    Far North
    Posts
    33

    Default Re: Need Help For Triggers for Traits

    Your initial inclination that "Affects" is adding points into the given trait line is correct per the EDCT tutorial.

    We can see an example of this in the existing EDCT:

    Trigger SakaRauka_CharacterComesOfAge
    WhenToTest CharacterComesOfAge


    Condition FactionType f_saka
    and FatherTrait SakaRauka > 0
    and Trait EthnoDetermined < 1
    [...]
    Affects Warmonger 3 Chance 80

    There aren't three tiers in the warmonger trait line and we aren't getting a CTD 80% of the time SakaRauka characters come of age, but what we are getting is an 80% chance of 3 points in the warmonger trait line and, if we hit 5 points, the character gains the first tier "Warlike". Now if you're writing conditions in a trait trigger or elsewhere like the script or for an ancillary trigger i.e. Condition Trait Scholarly > 1, note that that is referring to tiers of the trait, in this case Erudite or above (> the first tier, Cultured).

    I think you're getting CTDs because of what was already mentioned: some of your triggers reference "Fertility" when the trait line is "Fertile", the Determined issue, etc.

    If you're going to play with traits or ancillaries I would recommend using Squid's ATVTW tool, as it will generally catch these mistakes so you can fix them before ever having to start the game and deal with CTDs. That way in-game you can focus on just testing the implementation and balance.

    https://www.twcenter.net/forums/show...lary-Validator

    And lastly I do think a smoother way to implement what you're going for with some of these larger values like Brave 4 or Fertile 4 is to stagger them across multiple Affects lines.

    For example:
    Affects Brave 2 Chance 50
    Affects Brave 2 Chance 50

    This way it's not a 50/50 all-or-nothing situation where the character gets 0 or 4 points, instead they have a good chance of 2 points and smaller chances of none or all, if that makes sense.

    You'll see this used a lot in the existing coming of age related traits i.e.
    Trigger ParthiaSurenCharacterComesOfAge
    WhenToTest CharacterComesOfAge


    Condition FactionType f_parthia
    and FatherTrait ParthiaSuren > 1
    and Trait EthnoDetermined < 1


    [...]
    Affects GoodLeader 2 Chance 60
    Affects GoodLeader 2 Chance 60

  8. #8

    Default Re: Need Help For Triggers for Traits

    Thank you as well Vardavar!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •