Results 1 to 11 of 11

Thread: Remove a trait from an existing general

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Stylix's Avatar MOS Team Member
    Join Date
    Apr 2008
    Location
    Alabama, U.S.A.
    Posts
    2,263

    Default Remove a trait from an existing general

    Does anyone happen to know how to set up a trigger to test a general at the end of the turn and remove a trait from this character. I have tried to modify the export_desc_character_traits.txt file by adding a new trigger which would remove a trait but the only line that I know of to alter a trait is the 'Affects' trait line. I know I can put a negative number in and lower a trait, but how can I remove it completely?

    Thank you in advance.

  2. #2

    Icon1 Re: Remove a trait from an existing general

    Code:
    ;------------------------------------------
    Trait Despoiler
        Characters family
    
        Level Looter
            Description Looter_desc
            EffectsDescription Looter_effects_desc
            Threshold  1
            Effect Looting   10 
    
        Level Pillager
            Description Pillager_desc
            EffectsDescription Pillager_effects_desc
    	Epithet Pill2_epi
            Threshold  3
    
            Effect Looting   20 
    
        Level Sacker_of_Cities
            Description Sacker_of_Cities_desc
            EffectsDescription Sacker_of_Cities_effects_desc
            Threshold  5
    
            Effect Looting   30
    Code:
    ;------------------------------------------
    Trigger remove_despoiler_Looter
        WhenToTest CharacterTurnEnd
    
        Condition Trait Despoiler = 1
    
        Affects Despoiler  -1  Chance  100
    
    ;------------------------------------------
    Trigger remove_despoiler_pillager
        WhenToTest CharacterTurnEnd
    
        Condition Trait Despoiler = 2
    
        Affects Despoiler  -3  Chance  100
    
    ;------------------------------------------
    Trigger remove_despoiler_sacker_of_citie
        WhenToTest CharacterTurnEnd
    
        Condition Trait Despoiler = 3
    
        Affects Despoiler  -5  Chance  100

  3. #3
    Stylix's Avatar MOS Team Member
    Join Date
    Apr 2008
    Location
    Alabama, U.S.A.
    Posts
    2,263

    Default Re: Remove a trait from an existing general

    @TNZ

    Thank you TNZ, I will code this shortly and give it a try. I was close in my fumbled attempts but your code really makes it clear. I will post again and give you the results!

    Sorry TNZ, no joy. I replaced the trait in your example with the negative trait that I was trying to remove and modified the threshold values to match my negative trait values but instead of removing the trait it made it worse! I have had no problem adding or increasing trait values, just reducing or removing them. Thank you again for your time and effort.
    Last edited by Stylix; November 29, 2010 at 09:45 AM. Reason: Tried code change

  4. #4
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: Remove a trait from an existing general

    You can always use the give_trait or give_trait_points cheats.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  5. #5
    Stylix's Avatar MOS Team Member
    Join Date
    Apr 2008
    Location
    Alabama, U.S.A.
    Posts
    2,263

    Default Re: Remove a trait from an existing general

    @Squid

    Thank you and I am aware of the console command and thought about adding this to the campaign script using a hot key, in fact I have already done so but must start a new campaign for it to take effect. I am trying to compile some economic data but the governor's keep acquiring negative traits that are skewing my results. I have over 80 regions and am close to the end of the campaign and it takes a long time to check and change every settlement that has a governor every turn. I will continue to hope for a solution and press on for now.

  6. #6
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Remove a trait from an existing general

    Trigger remove_despoiler_Looter ; name of trigger is not important as long as it is unique, helps error solving
    WhenToTest CharacterTurnEnd

    Condition Trait Despoiler = 3 ; name and level of trait

    Affects Despoiler -5 Chance 100 ; name and negative threshold for this level










  7. #7
    Stylix's Avatar MOS Team Member
    Join Date
    Apr 2008
    Location
    Alabama, U.S.A.
    Posts
    2,263

    Default Re: Remove a trait from an existing general

    Below is a copy of my code from the export_descr_character_traits.txt and it seems to have no effect on the desired trait:

    Code:
    ;------------------------------------------
    Trigger remove_corrupt_dubious
        WhenToTest CharacterTurnEnd
    
        Condition IsGeneral
    	and EndedInSettlement
    	and not IsFactionAIControlled
            and Trait Corrupt = 3
    
        Affects Corrupt  -6  Chance  100
    
    ;------------------------------------------
    Trigger remove_corrupt_underhanded
        WhenToTest CharacterTurnEnd
    
        Condition IsGeneral
    	and EndedInSettlement
    	and not IsFactionAIControlled
            and Trait Corrupt = 2
    
        Affects Corrupt  -3  Chance  100
    
    ;------------------------------------------
    Trigger remove_corrupt_corrupt
        WhenToTest CharacterTurnEnd
    
        Condition IsGeneral
    	and EndedInSettlement
    	and not IsFactionAIControlled
            and Trait Corrupt = 1
    
        Affects Corrupt  -1  Chance  100

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Remove a trait from an existing general

    You mentioned that you had started a campaign already before editing the character_traits file. I am not sure if this file needs a new campaign for the changes to take effect.

    Maybe change this line:
    and not IsFactionAIControlled

    into:
    and CharacterIsLocal










  9. #9
    Stylix's Avatar MOS Team Member
    Join Date
    Apr 2008
    Location
    Alabama, U.S.A.
    Posts
    2,263

    Default Re: Remove a trait from an existing general

    @Gigantus

    Thank you for the suggestion and I will give it a try. I have changed the file several times 'on the fly' so to speak (during a campaign) and it works well adding new traits or increasing existing ones, just can't get rid of those pesky traits!

  10. #10

    Icon1 Re: Remove a trait from an existing general

    Stylix: If the ‘Corrupt’ trait has a 'NoGoingBackLevel' line that would stop the trait from being removed.

  11. #11
    Stylix's Avatar MOS Team Member
    Join Date
    Apr 2008
    Location
    Alabama, U.S.A.
    Posts
    2,263

    Default Re: Remove a trait from an existing general

    Quote Originally Posted by TNZ View Post
    Stylix: If the ‘Corrupt’ trait has a 'NoGoingBackLevel' line that would stop the trait from being removed.
    It does indeed, that level being 2. Thank you for pointing this out for me. I will perform my study in my next campaign when I can prevent the negative traits from going beyond level 1 and thus (hopefully) allowing me to remove them or to prevent them for occuring in the first place.

    You have been a big help! +rep!

    @Gigantus

    Thanks for your help also and I think you deserve some rep too!
    Last edited by Stylix; November 30, 2010 at 04:23 PM.

Posting Permissions

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