Results 1 to 11 of 11

Thread: Leader traits with faction-wide effects.

  1. #1
    gracul's Avatar 404 Not Found
    Artifex

    Join Date
    Dec 2007
    Location
    Poland
    Posts
    2,009

    Default Leader traits with faction-wide effects.

    Hey!

    In this tutorial i'll show you how to create traits which are going to affect the WHOLE of your faction, settlements or governors. Essentially, this can work with any named character or agent, but i have only focused on the faction leader aspect. This are some of the new features included in SS6.3.

    Don't you think, that if the faction leader is regarded as a super-pacifist then army recruitment should be handicapped? And what if he's there only for the army? Or maybe he cares about he's people so much that he's enforcing new laws? There should be a way to reflect this... and i shall give a couple.


    Example:
    I wanted to reflect the fact that my leader is somehow a great thinker. In result, every settlement would have it's construction costs decreased by 20%.
    So, i've created the text descriptions first, in order to know what i really want to do with the trait[text\export_vnvs]:
    Code:
    {Wise_Administrator_desc}"Employing a set of architects across the land will definitively prove useful."
    {Wise_Administrator_effects_desc}20% decrease in construction costs in all settlements
    {Wise_Administrator_epithet_desc}the Wise
    {Wise_Administrator}Wise Administrator
    Next we want to add the trait to EDCT:
    Code:
    ;------------------------------------------
    Trait WiseAdministrator
     Characters family
     NoGoingBackLevel 1
     AntiTraits BadAdministrator
    
     Level Wise_Administrator
       Description Wise_Administrator_desc
       EffectsDescription Wise_Administrator_effects_desc
       GainMessage Wise_Administrator_desc
       Epithet Wise_Administrator_epithet_desc
       Threshold 1
    Yea, it doesn't really do anything. It's just there, as there is no "Effect something" which would do what i want. But i do have the trait, so i venture to the campaign_script.
    Code:
    monitor_event PreFactionTurnStart TrueCondition
        set_event_counter wise_administrator 0
    end_monitor
    
    monitor_event CharacterTurnStart IsFactionLeader
        and Trait WiseAdministrator > 0
        set_event_counter wise_administrator 1
    end_monitor
    Now, if my faction leader has this trait, an event shall be exported by the script file. CharacterTurnStart comes before SettlementTurnStart, so it allows EDB changes. Knowing that, i venture to EDB and add this code:
    Code:
    construction_cost_bonus_stone bonus 20 requires event_counter wise_administrator 1
    construction_cost_bonus_wooden bonus 20 requires event_counter wise_administrator 1
    to every wall level. And voila! The main part is done. Now we only have to make some triggers [EDCT]:
    Code:
    ;------------------------------------------
    Trigger WiseAdministrator_add_1
     WhenToTest CharacterTurnEnd
    
     Condition IsFactionLeader
           and Trait WideTraitSet = 0
           and HasAncType Academic
           and Trait GoodAdministrator >= 0
           and Trait GoodBuilder >= 0
           and Trait ExpensiveTastes = 0
    
     Affects WiseAdministrator 1 Chance 20
    
    ;------------------------------------------
    Trigger WiseAdministrator_add_2
     WhenToTest CharacterTurnEnd
    
     Condition IsFactionLeader
           and Trait WideTraitSet = 0
           and not HasAncType Academic
           and Trait GoodAdministrator >= 0
           and Trait GoodBuilder >= 0
           and Trait ExpensiveTastes = 0
    
     Affects WiseAdministrator 1 Chance 10
    
    ;------------------------------------------
    Trigger WiseAdministrator_add_3
     WhenToTest CharacterTurnEnd
    
     Condition IsFactionLeader
           and Trait WideTraitSet = 0
           and HasAncType Academic
           and Trait BadAdministrator = 0
           and Trait ExpensiveTastes = 0
    
     Affects WiseAdministrator 1 Chance 5
    
    ;------------------------------------------
    Trigger WiseAdministrator_add_4
     WhenToTest CharacterTurnEnd
    
     Condition IsFactionLeader
           and Trait WideTraitSet = 0
           and not HasAncType Academic
           and Trait BadAdministrator = 0
           and Trait ExpensiveTastes = 0
    
     Affects WiseAdministrator 1 Chance 1
    We don't want the trait to be archived easily, so we make a couple of triggers to reflect how "good" our leader is.
    However there is one last thing to do, since we want multiple "wide" traits, we cannot let the same leader get more then one of them.
    So we add a new trait:
    Code:
    Trait WideTraitSet
     Characters family
     Hidden
    
     Level Hidden
       Description Hidden_desc
       EffectsDescription Hidden_effects_desc
       Threshold 1
    And the following trigger under just under wise admin triggers:
    Code:
    ;------------------------------------------
    Trigger WiseAdministratorWideSet_add
     WhenToTest CharacterTurnEnd
    
     Condition IsFactionLeader
           and Trait WiseAdministrator = 1
           and Trait WideTraitSet = 0
    
     Affects WideTraitSet 1 Chance 100
    So now we can prevent the leader from getting a couple of these traits...
    (and Trait WideTraitSet = 0 is already in the code at the beginning)

    Example 2:
    Now we want to reflect the fact that our leader is very greedy, taking huge taxes out of even our nobles! This time we won't have to use the EDB, tho.
    So we create the text description, both for the king and for the governors.
    Code:
    {Greedy_Ruler_desc}Money is the only God this man ever believed in. It is all he ever wanted, and all he needs.
    {Greedy_Ruler_effects_desc}+2 Authority, -2 Chivalry, -2 Piety, -3 from popularity (reduces public order), 35% bonus on tax income, -2 from popularity (reduces public order) to all generals, 30% bonus on tax income to all generals
    {Greedy_Ruler_epithet_desc}the Greedy
    {Greedy_Ruler_General_desc}How can one make his people happy, if he takes all the money away from them?
    {Greedy_Ruler_General_effects_desc}-2 Chivalry, -2 from popularity (reduces public order), 30% bonus on tax income
    {Greedy_Ruler_General}Serving under a greedy ruler
    {Greedy_Ruler}Greedy Ruler
    We venture to the EDCT file and create the traits for the king and generals:
    Code:
    Trait GreedyRuler
     Characters family
     NoGoingBackLevel 1
     AntiTraits Just , KindRuler
    
     Level Greedy_Ruler
       Description Greedy_Ruler_desc
       EffectsDescription Greedy_Ruler_effects_desc
       GainMessage Greedy_Ruler_desc
       Epithet Greedy_Ruler_epithet_desc
       Threshold 1 
     
       Effect Authority 2
       Effect LocalPopularity -3
       Effect TaxCollection 35
       Effect Chivalry -2
       Effect Piety -2
     
    ;------------------------------------------
    Trait GreedyRulerGeneral
     Characters family
    
     Level Greedy_Ruler_General
       Description Greedy_Ruler_General_desc
       EffectsDescription Greedy_Ruler_General_effects_desc
       GainMessage Greedy_Ruler_General_desc
       Threshold 1 
     
       Effect LocalPopularity -2
       Effect TaxCollection 30
       Effect Chivalry -1
    And the triggers:
    Code:
    Trigger GreedyRuler_add_1
     WhenToTest CharacterTurnEnd
    
     Condition IsFactionLeader
           and Trait WideTraitSet = 0
           and Trait BattleChivalry < 2
           and Trait CaptorChivalry < 2
           and Trait RansomChivalry < 2
           and Trait Feck = 0
           and Trait Arse = 0
           and Trait StrategyChivalry < 2
           and Attribute Chivalry < 4
           and Attribute Piety < 4
    
     Affects GreedyRuler 1 Chance 8
     
    ;------------------------------------------
    Trigger GreedyRuler_add_2
     WhenToTest CharacterTurnEnd
    
     Condition IsFactionLeader
           and Trait WideTraitSet = 0
           and Trait BattleChivalry = 0
           and Trait CaptorChivalry = 0
           and Trait RansomChivalry = 0
           and Trait Feck > 0
           and Trait Arse > 0
           and Trait StrategyChivalry = 0
           and Attribute Chivalry < 2
           and Attribute Piety < 2
    
     Affects GreedyRuler 1 Chance 75
    
    ;------------------------------------------
    Trigger GreedyRulerWideSet_add
     WhenToTest CharacterTurnEnd
    
     Condition IsFactionLeader
           and Trait GreedyRuler = 1
           and Trait WideTraitSet = 0
    
     Affects WideTraitSet 1 Chance 100
     
    ;------------------------------------------
    Trigger GreedyRulerGeneral_add
     WhenToTest CharacterTurnEnd
    
     Condition IsGeneral
           and not IsFactionLeader
           and FactionLeaderTrait GreedyRuler = 1
           and Trait GreedyRulerGeneral = 0
    
     Affects GreedyRulerGeneral 1 Chance 100
    
    ;------------------------------------------
    Trigger GreedyRulerGeneral_remove
     WhenToTest CharacterTurnEnd
    
     Condition IsGeneral
           and FactionLeaderTrait GreedyRuler = 0
           and Trait GreedyRulerGeneral = 1
    
     Affects GreedyRulerGeneral -1 Chance 100
    So now we have a nice trait, which can really increase the money flow, but also cause revolts in newly conquered lands.

    Example 3:
    Our King was always the type to provide safety for his people.
    text:
    Code:
    {Thinks_Of_His_People_desc}This man understands that the strongest fortress is the affection of his people... No man nor woman will ever walk hungry.
    {Thinks_Of_His_People_effects_desc}+1% population growth in all settlements, reduced income from all settlements
    {Thinks_Of_His_People}Thinks of His People
    EDCT:
    Code:
    Trait ThinksOfHisPeople
     Characters family
     NoGoingBackLevel 1
     AntiTraits BadAdministrator , Slothful , Arse , Feck , StrategyDread
    
     Level Thinks_Of_His_People
       Description Thinks_Of_His_People_desc
       EffectsDescription Thinks_Of_His_People_effects_desc
       GainMessage Thinks_Of_His_People_desc
       Threshold 1
    triggers:
    Code:
    ;------------------------------------------
    Trigger ThinksOfHisPeople_add_1
     WhenToTest CharacterTurnEnd
    
     Condition IsFactionLeader
           and Trait WideTraitSet = 0
           and Trait GoodAdministrator = 0
           and Trait BadAdministrator = 0
           and Trait Slothful = 0
           and Trait Arse = 0
           and Trait Feck = 0
           and Trait StrategyDread = 0
           and Trait Perverted = 0
           and Attribute Chivalry > 4
           and CharacterNumTurnsIdle > 4
    
     Affects ThinksOfHisPeople 1 Chance 3
     
    ;------------------------------------------
    Trigger ThinksOfHisPeople_add_2
     WhenToTest CharacterTurnEnd
    
     Condition IsFactionLeader
           and Trait WideTraitSet = 0
           and Trait GoodAdministrator > 0
           and Trait Slothful = 0
           and Trait Arse = 0
           and Trait Feck = 0
           and Trait StrategyDread = 0
           and Trait Perverted = 0
           and Attribute Chivalry > 5
           and CharacterNumTurnsIdle > 4
    
     Affects ThinksOfHisPeople 1 Chance 15
    
    ;------------------------------------------
    Trigger ThinksOfHisPeopleWideSet_add
     WhenToTest CharacterTurnEnd
    
     Condition IsFactionLeader
           and Trait ThinksOfHisPeople = 1
           and Trait WideTraitSet = 0
    
     Affects WideTraitSet 1 Chance 100
    campaign_script:
    Code:
    monitor_event PreFactionTurnStart TrueCondition
    
        set_event_counter thinks_of_his_people 0
        set_event_counter wise_administrator 0
    
    end_monitor
    
    monitor_event CharacterTurnStart IsFactionLeader
        and Trait ThinksOfHisPeople > 0
        set_event_counter thinks_of_his_people 1
    end_monitor
    
    monitor_event CharacterTurnStart IsFactionLeader
        and Trait WiseAdministrator > 0
        set_event_counter wise_administrator 1
    end_monitor
    EDB:
    Code:
            population_growth_bonus bonus 2 requires event_counter thinks_of_his_people 1
            income_bonus bonus -200 requires event_counter thinks_of_his_people 1
    Hope you do get the idea... We can also for example, lower the amount of possible recruitment slots, increase base religion levels, increase piety for our priests if our king is very religious, decrease/increase costs for certain units by making them a line with requires warmonger_leader = 0 and = 1, decrease/increase cost of only certain buildings and many more. The trait-script-EDB connection can provide a lot of things. The leader trait - agent/general trait is also a thing not to be underestimated.
    Last edited by gracul; August 15, 2010 at 05:33 AM.

  2. #2
    Amon Amarth 930's Avatar Artifex
    Join Date
    Nov 2008
    Location
    Germany, North-Rhine Westphalia
    Posts
    466

    Default Re: Leader traits with faction-wide effects.

    Nice ideas, +Rep

    Third Age Member (Fellowship-Scripter)
    Under the Patronage of MasterBigAb

  3. #3
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,121
    Blog Entries
    35

    Default Re: Leader traits with faction-wide effects.

    Nice idea making traits global










  4. #4

    Default Re: Leader traits with faction-wide effects.

    Is there any way to link settlement happiness with faction leader authority?

    For example, if level 5 authority and above, all of your settlements will receive an additional happiness point for each level of authority. But if 3, 2, 1 or no authority, all settlements will receive happiness penalties.

    Is this possible to script?

    I just have 1.2 vanilla.

  5. #5
    gracul's Avatar 404 Not Found
    Artifex

    Join Date
    Dec 2007
    Location
    Poland
    Posts
    2,009

    Default Re: Leader traits with faction-wide effects.

    I think it should be possible even in 1.2 since the only thing im using is PreFactionTurnStart which is kingdoms specific.
    Basically, you have to do everything like in the tutorial, create 2 traits one for happy one for unhappy, and the only thing thats a bit different then what's inside the tutorial is:
    Code:
    monitor_event CharacterTurnStart IsFactionLeader
        set_event_counter really_happy 0
        set_event_counter really_unhappy 0
    end_monitor
    
    monitor_event CharacterTurnStart IsFactionLeader
        and Trait ReallyHappy > 0
        set_event_counter really_happy 1
    end_monitor
    
    monitor_event CharacterTurnStart IsFactionLeader
        and Trait ReallyUnhappy > 0
        set_event_counter really_unhappy 1
    end_monitor
    Since you don't have kingdoms.

    And in EDB you have to add this to every wall level (core_building):
    happiness_bonus bonus 2 requires event_counter really_happy 1
    happiness_bonus bonus -2 requires event_counter really_unhappy 1

  6. #6
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,121
    Blog Entries
    35

    Default Re: Leader traits with faction-wide effects.

    Nice work around.










  7. #7

    Default Re: Leader traits with faction-wide effects.

    So let's say that my trigger is based on authority.

    For example, if my faction leader has 3 authority or less, he triggers an event called "Bad Ruler" which causes -15% unhappiness in all my settlements.

    Conversely, if my faction leader has 6 authority or more, he triggers another event called "Good Ruler" which adds a 15% bonus to all settlements' happiness.

    Would my trigger entry for both traits look like this?


    Trigger bad_ruler_add_1
    WhenToTest CharacterTurnEnd

    Condition IsFactionLeader
    and Trait WideTraitSet = 0
    and Attribute Authority < 3

    Affects BadRuler 1 Chance 100


    And:


    Trigger good_ruler_add_1
    WhenToTest CharacterTurnEnd

    Condition IsFactionLeader
    and Trait WideTraitSet = 0
    and Attribute Authority > 6

    Affects GoodRuler 1 Chance 100

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,121
    Blog Entries
    35

    Default Re: Leader traits with faction-wide effects.

    You are only giving a trait to the faction leader. you will need to use <= 3 (smaller or equal) and >= 6 (bigger or equal) to get your conditions th eway you want.
    And then you have to work that into the script and the EDB.










  9. #9

    Default Re: Leader traits with faction-wide effects.

    Quote Originally Posted by Gigantus View Post
    You are only giving a trait to the faction leader. you will need to use <= 3 (smaller or equal) and >= 6 (bigger or equal) to get your conditions th eway you want.
    And then you have to work that into the script and the EDB.
    Of course. I imagine I would have to repeat everything else in the tutorial.

    I was just curious if the trigger I wrote was correct. Is that how I would base a trait off of my faction leader's authority level?

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,121
    Blog Entries
    35

    Default Re: Leader traits with faction-wide effects.

    As long as both the conditions can be met, the trigger should fire. You obviously need to have the traits as well (WideTraitSet, GoodRuler, BadRuler)










  11. #11
    Opifex
    Join Date
    Feb 2005
    Location
    New York, USA
    Posts
    15,154

    Default Re: Leader traits with faction-wide effects.

    +rep, good thinking.


    "If ye love wealth greater than liberty,
    the tranquility of servitude greater than
    the animating contest for freedom, go
    home from us in peace. We seek not
    your counsel, nor your arms. Crouch
    down and lick the hand that feeds you,
    and may posterity forget that ye were
    our countrymen."
    -Samuel Adams

Posting Permissions

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