Results 1 to 9 of 9

Thread: City-based traits

  1. #1
    Ryoga84's Avatar Biarchus
    Join Date
    Dec 2011
    Location
    Italy
    Posts
    665

    Default City-based traits

    Hi,

    Actually I got two issues related to traits, both related to linking certain traits to the permanence in certain cities.
    The point is, I'm trying to impose a sort of cultural lineage to the family members.
    If a family member stays too much in a foreing city he acquire a liking for that culture, and thus there's a chance he will educate his sons as member of said culture.

    Code:
    Trait Lineage
        Characters family
    ;	Hidden
    	ExcludeCultures barbarian, eastern, egyptian, carthaginian, greek, nomad
    
        Level Lineage
            Description Lineage_desc
            EffectsDescription Lineage_effects_desc
            Threshold  1
    Flag trait

    Code:
    ;--Italic Samnite
    Trait pre_Italic_Samnite
    	Characters family
    ;	Hidden
    	ExcludeCultures barbarian, eastern, egyptian, carthaginian, greek, nomad
    
        Level pre_Italic_Samnite
            Description Hidden_desc
            EffectsDescription Hidden_effects_desc
            Threshold  1
    		
    Trait Italic_Samnite
    	Characters family
    	ExcludeCultures barbarian, eastern, egyptian, carthaginian, greek, nomad
    
        Level Italic_Samnite
            Description Italic_Samnite_desc
            EffectsDescription Italic_Samnite_effects_desc
            Threshold  1
    		
    		Effect Farming  1
    		Effect Ambush  1
    				
    ;--Italic Greek
    ;--Italic Etruscan
    ;--Italic Ligurian
    ;--Italic Sican
    ;--etc
    pre_Italic_Samnite is a counter, while Italic_Samnite is the real deal

    Code:
    ;------------------------------------------ 
    ;Secondary Lineage Italic Samnite: A Samnite from Apulia
    ;
    
    Trigger Lineage_FatherItalic_Samnite
      WhenToTest CharacterComesOfAge
    
        Condition FatherTrait Italic_Samnite > 0
    		  and Trait Lineage < 1
    
      Affects Italic_Samnite   1  Chance  80
      Affects Lineage  1  Chance  100
    
    ;------------------------------------------
    
    Trigger Lineage_becomeItalic_Samnite
      WhenToTest CharacterTurnEnd
    
        Condition EndedInSettlement
    		  and settlementName Arpi
    		  and RemainingMPPercentage = 100
    		  and Trait pre_Italic_Samnite < 10
    
      Affects pre_Italic_Samnite   1  Chance  20
    
    ;------------------------------------------
    Trigger Lineage_notFatherItalic_Samnite
      WhenToTest CharacterComesOfAge
    
        Condition FatherTrait pre_Italic_Samnite > 9
    		  and Trait Lineage < 1
    
      Affects Italic_Samnite   1  Chance  50
      Affects Lineage  1  Chance  100
    this is how it should go
    named character stays in city (Arpi, in this case) for years, eventually he acquire pre_Italic_Samnite up to level 10 (trigger Lineage_becomeItalic_Samnite ), then his son become adult.
    If pre_Italic_Samnite is at level 10, the son has a chance of acquiring Italic_Samnite trait, as he was bred into the Samnite culture and ethos (trigger Lineage_notFatherItalic_Samnite ).
    Eventually this acquired trait can be relayed to the scions of the son, creating more Italic_Samnite characters (trigger Lineage_FatherItalic_Samnite ).

    The problem is that, apparently, all the family members acquires at random the "pre_xxx" traits, I leaved a FM in Rome for 9-10 turns and then he had "pre_Italic_Samnite" , "pre_Italic_Greek", "pre_Italic_Ligurian" and "pre_Italic_Nuraghian" without moving from home.


    =====================================================================
    Second issue, related to this one

    Code:
    Trait Lineage
        Characters family
    ;	Hidden
    	ExcludeCultures barbarian, eastern, egyptian, carthaginian, greek, nomad
    
        Level Lineage
            Description Lineage_desc
            EffectsDescription Lineage_effects_desc
            Threshold  1
    flag trait, again

    Code:
    ;--Italic Roman
    Trait pre_Roman_Vir
    	Characters family
    ;	Hidden
    	ExcludeCultures barbarian, eastern, egyptian, carthaginian, greek, nomad
    
        Level pre_RomanVir
            Description Hidden_desc
            EffectsDescription Hidden_effects_desc
            Threshold  1
    		
    Trait Roman_Vir
    	Characters family
    	ExcludeCultures barbarian, eastern, egyptian, carthaginian, greek, nomad
    
        Level RomanVir
            Description RomanVir_desc
            EffectsDescription RomanVir_effects_desc
            Threshold  1
    
            Effect Law 1
    		Effect SiegeAttack  1
    		Effect TaxCollection  5
    as above, pre_Roman_Vir is a counter while Roman_Vir is the actual objective

    Code:
    ;Roman Vir: A true Roman blueblood.
    ;
    
    Trigger Lineage_FatherRoman
      WhenToTest CharacterComesOfAge
    
        Condition FatherTrait Roman_Vir > 0
    		  and Lineage < 1
    
      Affects Roman_Vir   1  Chance  75
      Affects Lineage  1  Chance  100
    ;------------------------------------------
    
    Trigger Lineage_RomanCultured1
      WhenToTest CharacterTurnEnd
    
        Condition EndedInSettlement
    		  and settlementName Roma
    		  and SettlementBuildingExists = academy
    		  and RemainingMPPercentage = 100
    		  and Trait pre_RomanVir < 10
    		  and Trait Nobile > 0
    		  and Patrician > 0
    		  and Lineage < 1
    
      Affects pre_Roman_Vir   1  Chance  30
    
    Trigger Lineage_RomanCultured2
      WhenToTest CharacterTurnEnd
    
        Condition EndedInSettlement
    		  and settlementName Roma
    		  and SettlementBuildingExists = scriptorium
    		  and RemainingMPPercentage = 100
    		  and Trait pre_RomanVir < 10
    		  and Trait Nobile > 0
    		  and Patrician > 0
    		  and Lineage < 1
    
      Affects pre_Roman_Vir   2  Chance  30
      
    Trigger Lineage_RomanCultured3
      WhenToTest CharacterTurnEnd
    
        Condition EndedInSettlement
    		  and settlementName Roma
    		  and SettlementBuildingExists = ludus_magnus
    		  and RemainingMPPercentage = 100
    		  and Trait pre_RomanVir < 10
    		  and Trait Nobile > 0
    		  and Patrician > 0
    		  and Lineage < 1
    
      Affects pre_Roman_Vir   3  Chance  30
    ;------------------------------------------
      
    Trigger Lineage_IsRoman
      WhenToTest CharacterTurnEnd
    
        Condition Trait pre_RomanVir > 9
    		  and Trait Nobile > 0
    		  and Patrician > 0
    		  and Lineage < 1
    
      Affects Roman_Vir   1  Chance  100
      Affects Lineage  1  Chance  100
    "Nobile" and "Patrician" are ereditary traits (they work perfectly, as I'm modyfing the trait system of another mod).
    this is how it should go
    character that is both Nobile and Patrician stays in Rome for years, studying the proper arts of a roman ruler ( Lineage_RomanCultured1 , Lineage_RomanCultured2 , Lineage_RomanCultured3 ) the triggers are for the different "culture" building present in city ( academy , scriptorium or ludus_magnus).
    In time he should acquire the pre_RomanVir trait, when this trait surpass level 9 (trigger Lineage_IsRoman ) the character should acquire the trait Roman_Vir
    Eventually this acquired trait can be relayed to the sons of the character, creating more Roman_Vir characters (trigger Lineage_FatherRoman ).

    The problem is, here, that from the second turn onward, all the FM with "Nobile" and "Patrician" traits acquire automatically the Roman_Vir trait even if they are not in Rome or if the city where they are don't have a "culture" building


    So, yeah, I'm screwing up somewhere...
    ====== "Worst English User" 2012/2014 Award Winner =======
    ===========Running for the 2015, support me.===========
    Uchronia Barbarorum v1.05 , ahistorical submod for Europa Barbarorum 1.2 WiP
    Another Story: The Greek Wars v1.0 , submod for The Greek Wars 1.1 WiP
    4th Age +1, v1.0 , submod for Fourth Age: Total War 2.6 WiP

  2. #2

    Default Re: City-based traits

    I don't see an error or anything else, that could cause the problem you mentioned. So no mistake of your. :/

    Have you safe savegames(also none with your changed traits)? If yes, could you revamp all done changes(if you have a clean version of the trait.txt or the version your mentioned mod used), then try by Try&Error method.

    First change only a small part of your current traitchanges.

    You can implement the

    'Trait pre_Italic_Samnite'

    as you have posted.

    AND then this:

    'Trigger Lineage_becomeItalic_Samnite
    WhenToTest CharacterTurnEnd

    Condition EndedInSettlement
    and settlementName Arpi
    and RemainingMPPercentage = 100
    and Trait pre_Italic_Samnite < 10

    Affects pre_Italic_Samnite 1 Chance 100'

    (so you have changed only the 20 chance to 100 for testing purpose)
    My only assumption is, that something is broken with 'settlementName Arpi'(maybe the game just ignore this part?! This is the only explanation why in other cities all other pre_xxx trigger too)
    You can check with a 100 chance if it immediately gain the your trait. If yes, then your trigger is broken.
    Then you can try to make and NOT conditions. If then something doesn't trigger and it's logical, then you know where the problem is.

    >> and not settlementName Arpi (and it trigger on all again --> broken condition)
    and not RemainingMPPercentage = 100 (try to shift out your character a bit and then let him go back into city(movementpoints <100) so he shouldn't trigger it
    and not Trait pre_Italic_Samnite < 10 (yeah... if this condition is broken, then you have problem to count it with such a method)

    I looked into my data:

    The Condition for Settlementname is named 'SettlementName'.

    Complete Condition: 'SettlementName Tarquinii'. May try this out before changing(revamping) any changes? If this don't work, see above. :/

  3. #3
    Ryoga84's Avatar Biarchus
    Join Date
    Dec 2011
    Location
    Italy
    Posts
    665

    Default Re: City-based traits

    Thanks, I'll try your method

    I'll let you know
    ====== "Worst English User" 2012/2014 Award Winner =======
    ===========Running for the 2015, support me.===========
    Uchronia Barbarorum v1.05 , ahistorical submod for Europa Barbarorum 1.2 WiP
    Another Story: The Greek Wars v1.0 , submod for The Greek Wars 1.1 WiP
    4th Age +1, v1.0 , submod for Fourth Age: Total War 2.6 WiP

  4. #4

    Default Re: City-based traits

    I can't find the RTW docudemons at the moment but should settlementName be
    SettlementName ? EDIT oops see that's been pointed out already.

    on the second bit;
    Settlement building exists thingies are awkward as I think you have to start it from a Settlement turn event otherwise it returns true if any settlement has it,
    if I've remembered that right then you need to go through a counter setting process, a. check settlement y has x, set counter z, b. check leader is in y settlement and counter z is set... then do thing.

  5. #5
    Ryoga84's Avatar Biarchus
    Join Date
    Dec 2011
    Location
    Italy
    Posts
    665

    Default Re: City-based traits

    Hi guys,
    just passing by for thanking you, as I finally finished making those traits, and apparently they're working
    ====== "Worst English User" 2012/2014 Award Winner =======
    ===========Running for the 2015, support me.===========
    Uchronia Barbarorum v1.05 , ahistorical submod for Europa Barbarorum 1.2 WiP
    Another Story: The Greek Wars v1.0 , submod for The Greek Wars 1.1 WiP
    4th Age +1, v1.0 , submod for Fourth Age: Total War 2.6 WiP

  6. #6

    Default Re: City-based traits

    Quote Originally Posted by makanyane View Post
    I can't find the RTW docudemons at the moment but should settlementName be
    SettlementName ? EDIT oops see that's been pointed out already.

    on the second bit;
    Settlement building exists thingies are awkward as I think you have to start it from a Settlement turn event otherwise it returns true if any settlement has it,
    if I've remembered that right then you need to go through a counter setting process, a. check settlement y has x, set counter z, b. check leader is in y settlement and counter z is set... then do thing.
    Mak, are you saying there's a way to check if a building exists in any settlement, regardless of where the character is?

  7. #7

    Default Re: City-based traits

    I'm fairly sure that was the result I achieved by mistake before... by putting the SettlementBuildingExists condition in something that wasn't a SettlementTurn end/start test

    afraid I don't have RTW loaded currently so can't check

  8. #8

    Default Re: City-based traits

    Np, I'll check it myself, thanks for the tip.

  9. #9
    MasterOfNone's Avatar RTW Modder 2004-2015
    Join Date
    May 2005
    Location
    England
    Posts
    16,706

    Default

    Interesting.

    (Mak, you really should keep installed the best TW game ever )
    Last edited by Squid; October 19, 2015 at 10:12 AM.
    "One of the most sophisticated Total War mods ever developed..."


Posting Permissions

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