Results 1 to 8 of 8

Thread: Giving recruitable generals a predetermined surname - concept

  1. #1
    Razor's Avatar Licenced to insult
    Join Date
    Apr 2004
    Location
    Deventer, The Netherlands
    Posts
    4,075

    Default Giving recruitable generals a predetermined surname - concept

    Hi there,

    So, traits have the ability to give characters epithets. My idea was to use this for recuitable named generals so that they get a predetermined surname (the epithet) depending on the settlement where they've been recruited.
    Say, I recruit a named general in Honjo castle (in my Japanese Sengoku era mod) then that general gains a trait changing his surname to Honjo once he's recuited. At the same time if there's already another named character/general in the settlement I don't want him to gain that trait so that he keeps his original name.

    How should I set up the trigger so that it gives the trait to newly created named generals in a certain settlement, while not affecting any potential existing characters in the same settlement as well?

    This is my idea:


    1) Add hidden trait "EstablishedName" (basically triggers for every existing named character/general on the map making sure they're excluded from the trigger mentioned at point 4)
    2) Add trigger:

    Code:
    Trigger Established_Name
        WhenToTest CharacterTurnEnd
    
        Condition AgentType = named character
    
        Affects EstablishedName  1  Chance  100

    3) Add hidden trait "NameHonjo" with epithet "Honjo" (triggers for new named characters/generals on the map at the start of a turn - once recruited)
    4) Add trigger:

    Code:
    Trigger Name_Honjo
        WhenToTest CharacterTurnStart
    
        Condition AgentType = named character ;or IsGeneral?
    ;             and FactionType faction_27 ;might use it for specific factions
                  and EndedInSettlement
                  and SettlementName Honjo
                  and not Trait EstablishedName = 1
    
        Affects NameHonjo  1  Chance  100

    I still need to test it myself, but I'd like to have some feedback/input from others that are more competent with this beforehand. Am I perhaps missing something? Thanks in advance!
    Last edited by Razor; February 27, 2023 at 06:20 PM.

  2. #2
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Giving recruitable generals a predetermined surname - concept

    Interesting idea! You should give all other named characters trait EstablishedName in case of ComingToAge and adoption.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  3. #3
    Razor's Avatar Licenced to insult
    Join Date
    Apr 2004
    Location
    Deventer, The Netherlands
    Posts
    4,075

    Default Re: Giving recruitable generals a predetermined surname - concept

    Quote Originally Posted by bitterhowl View Post
    Interesting idea! You should give all other named characters trait EstablishedName in case of ComingToAge and adoption.
    Ah yes. I hadn't thought of those events. Need to add those for man of the hour as well. Thanks!

  4. #4
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,695

    Default Re: Giving recruitable generals a predetermined surname - concept

    And probably it's necessary to refresh this trait every turn for it's owner to avoid rewriting by another epithets from another traits, if you want to keep it constantly.

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  5. #5
    Razor's Avatar Licenced to insult
    Join Date
    Apr 2004
    Location
    Deventer, The Netherlands
    Posts
    4,075

    Default Re: Giving recruitable generals a predetermined surname - concept

    Quote Originally Posted by bitterhowl View Post
    And probably it's necessary to refresh this trait every turn for it's owner to avoid rewriting by another epithets from another traits, if you want to keep it constantly.
    That is worth mentioning, but for my mod it's fine leaving it out, since I've deleted any other epithet other than the ones that are intended to change/overwrite the pre-existing epithets.

  6. #6
    Razor's Avatar Licenced to insult
    Join Date
    Apr 2004
    Location
    Deventer, The Netherlands
    Posts
    4,075

    Default Re: Giving recruitable generals a predetermined surname - concept

    The concept worked, but I had to change a few things around.

    The traits:
    Spoiler Alert, click show to read: 
    Code:
    ;------------------------------------------
    Trait EstablishedName
        Characters family
    ;   I removed Hidden so that I could easily check when the trait was gained
    
        Level Established_Name
            Description Established_Name_desc
            EffectsDescription Established_Name_effects_desc
            Threshold  1
    
    
    
    ;------------------------------------------
    Trait NameHonjo
        Characters family
        Hidden
    
        Level Name_Honjo
            Description Name_Honjo_desc
            EffectsDescription Name_Honjo_effects_desc
            Epithet Name_Honjo_epithet_desc
            Threshold  1


    The triggers (added trigger Name_Honjo_2):
    Spoiler Alert, click show to read: 
    Code:
    ;------------------------------------------
    Trigger Established_Name_1
        WhenToTest CharacterTurnStart
    
        Affects EstablishedName  1  Chance  100
    
    ;------------------------------------------
    Trigger Name_Honjo_1
        WhenToTest CharacterTurnEnd
    
        Condition EndedInSettlement
              and SettlementName Murakami
              and not Trait EstablishedName = 1
    
        Affects NameHonjo  1  Chance  100
    
    ;------------------------------------------
    Trigger Name_Honjo_2
        WhenToTest CharacterComesOfAge
    
        Condition FatherTrait NameHonjo = 1
    
        Affects NameHonjo  1  Chance  100


    The export_vnvs.txt file:
    Spoiler Alert, click show to read: 
    Code:
    {Established_Name}Established Name
    {Established_Name_desc}Prevents recruited general epithets in name.
    {Established_Name_effects_desc}Prevents recruited general epithets in name
    {Name_Honjo_epithet_desc}Honjo



    I had to look into the sequence in which events were processed which is:
    Spoiler Alert, click show to read: 
    PreFactionTurnStart
    CharacterTurnStart
    SettlementTurnStart
    FactionTurnStart


    and

    Turn End pressed
    units recruited, buildings constructed and some other, I don't know the exact sequence
    CharacterTurnEnd
    SettlementTurnEnd
    FactionTurnEnd


    Also, first runs the CS, then the EDCT and then EDA.


    The EstablishedName trait should be gained at CharacterTurnStart and the NameHonjo trait should be gained at CharacterTurnEnd.


    Quote Originally Posted by bitterhowl View Post
    Interesting idea! You should give all other named characters trait EstablishedName in case of ComingToAge and adoption.
    Giving the EstablishedName trait in combination with additional events such as adoptions breaks it, presumably because when you recruit a general/general's bodyguard unit the game treats it as an adoption of some sorts? My tests showed that a named character gains the EstablishedName trait once he is adopted as well as when a general's bodyguard unit is recruited.
    Coming of age is unnecessary, because it fires at the start of the turn during which the character has already gained the EstablishedName trait. I could add a trigger in combination with coming of age and allowing the trait to be inherited by his sons, so that they also inherit the Honjo surname.

    Anyway, thanks for the feedback/input!
    Last edited by Razor; March 01, 2023 at 04:34 PM. Reason: updated the triggers

  7. #7

    Default Re: Giving recruitable generals a predetermined surname - concept

    EBII does this for client rulers. I haven't looked at the triggers yet, but it may be worth check out.

  8. #8
    Razor's Avatar Licenced to insult
    Join Date
    Apr 2004
    Location
    Deventer, The Netherlands
    Posts
    4,075

    Default

    Quote Originally Posted by Callistonian View Post
    EBII does this for client rulers. I haven't looked at the triggers yet, but it may be worth check out.
    I've looked into it and EBII uses a totally revamped trait system. The triggers for client rulers all require a combination of those new revamped traits. It seems that the way they've set it up doesn't look too useful for me, but thanks for pointing it out anyway!

    And the added trigger for children coming of age inheriting the epithet of the father:

    Spoiler Alert, click show to read: 

    Code:
    ;------------------------------------------
    Trigger Name_Honjo_2
        WhenToTest CharacterComesOfAge
    
        Condition FatherTrait NameHonjo = 1
    
        Affects NameHonjo  1  Chance  100
    Last edited by Maximinus Thrax; March 01, 2023 at 10:34 PM. Reason: posts merged

Tags for this Thread

Posting Permissions

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