Results 1 to 18 of 18

Thread: How do I make a child faction heir?

  1. #1
    isa0005's Avatar Campidoctor
    Join Date
    Jan 2008
    Location
    Australia, Victoria, Melbourne
    Posts
    1,567

    Default How do I make a child faction heir?

    So, how do I make a child faction heir? I've seen it done in a number of other mods but so far I've had no luck. I've gone over a number of tutorials and I'm aware of the files I need to edit, yet so far I've had no luck. Just to clarify, I'm modding DLVBB, making some minor, historically accurate ajustments to the Byzantine family tree.

    Cheers,
    isa0005.

  2. #2
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: How do I make a child faction heir?

    Well, if you want to have it at gamestart, it has to be done in the descr_strat on the family part, at the end of each faction (the relativ line). Check the tutorials about it.

    If you want this to occure during the game, I just don't know if it is possible ...?

  3. #3
    ♔atthias♔'s Avatar dutch speaking
    Citizen

    Join Date
    Mar 2013
    Location
    France
    Posts
    4,059

    Default Re: How do I make a child faction heir?

    Quote Originally Posted by Titus le Chmakus View Post
    Well, if you want to have it at gamestart, it has to be done in the descr_strat on the family part, at the end of each faction (the relativ line). Check the tutorials about it.

    If you want this to occure during the game, I just don't know if it is possible ...?
    I dont think you can do the latter indeed
    you can increase the chance it will be chosen by the game but not set it during game
    Rise of Mordor 3D Modelers Wanted
    Total War - Rise of Mordor
    Are you a 3D Environment and Character artist, or a Character Animator?

    If yes, then the Rise of Mordor team linked above is looking for you!
    Massive Overhaul Submod Units!
    D you want some units back in MOS 1.7? Install this mod http://www.twcenter.net/forums/showt...n-1-1-RELEASED
    It adds back units who were deleted from the campaign in MOS 1.7, namely the Winged Swordsmen, the Citadel Guard Archers and the Gondor Dismounted Bodyguard.

    Under the proud patronage of
    Frunk of the house of Siblesz

  4. #4

    Default Re: How do I make a child faction heir?

    You can increase the chance of being made FH by giving Authority (+10 should do it) to a non-FL character. As long as you haven't used it for any other traits (and you shouldn't, it doesn't do anything for anyone but the FL), it should skew the selection towards that character.

    I didn't think you could give traits to children, though.

  5. #5
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: How do I make a child faction heir?

    You can increase the chance of being made FH by giving Authority (+10 should do it) to a non-FL character.
    Yeah I know but he was asking for a under 16 years old character. Of course giving 10 Authority is the thing to do to be able to select heir.


    I didn't think you could give traits to children, though.
    I don't think neighther as the "ComeOfAge" trigger only applies when the character reaches 16 and becomes a playable character on the campaign map and not only a portrait in the family tree !

    Appart from that, I don't know if there is a script somewhere to force the game to consider the child as FH ? Which is completly silly from CA as this feature was one of the main concern in the middle ages ...
    Last edited by Titus le Chmakus; March 22, 2018 at 08:12 AM.

  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: How do I make a child faction heir?

    You can only assign heir (or faction leader) to an under age character in the descr_strat character_record section. As it is not an active character you can't assign anything to it, so doing the nifty 'choose the heir' routine won't work - it has to be the direct entry.

    If you can track the character (can't give him a label, remember?) then you could assign the 'choose heir' requirements at ComingOfAge - but that only makes him the next heir in line which I think wasn't the requirement\query here.










  7. #7
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: How do I make a child faction heir?

    About that heir selector, I found/reworked the Ancillary to this

    Code:
    Ancillary authority_power
        Type selector
        Transferable 1
        Image heir_selector.tga
        ExcludedAncillaries authority_power
        Description authority_power_desc
        EffectsDescription authority_power_effects_desc
        Effect Authority 10
    Then I made the Trigger :

    Code:
    Trigger authority_power
    WhenToTest CharacterTurnEnd
    Condition AgentType = named character
          and not HasAncType selector
          and not FactionwideAncillaryExists authority_power
          and not IsFactionLeader
          and not IsFactionAIControlled
        AcquireAncillary authority_power Chance 100
    And to remove the Authority when he becomes Leader :

    Code:
    Trait HeirAuthority
        Character family
        Hidden
        
        Level RemoveAuthority
            Description RemoveAuthority_desc
            EffectsDescription RemoveAuthority_effects_desc
            Threshold 1
            
            Effect Authority -10
    Code:
    Trigger heirselectorremove
        WhenToTest CharacterTurnStart
    
        Condition IsFactionLeader
            and HasAncType selector
    
        Affects HeirAuthority  1  Chance  100
    But if the player gives the Anc. to someone else by drag drop, I bet it won't remove the Trait ? Any idea to solve that ? Would this trigger do the job ?

    Code:
    Trigger heirselectorremoveremoved
        WhenToTest CharacterTurnStart
    
        Condition IsFactionLeader
            and not HasAncType selector
    
        Affects HeirAuthority  -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: How do I make a child faction heir?

    Someone recently posted a nifty ancillary removal script, I think it was Aneirin. It was using the e_select_character command and then the console command for ancillary removal together with 'this' - effectively not using any name or label (or trigger), only the 'possession' of that ancillary.

    Can't find his post right away - but it's pretty much this principle.
    Last edited by Gigantus; March 22, 2018 at 08:29 AM.










  9. #9
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: How do I make a child faction heir?

    Damn, this would have avoided me tons of scripts !

    Anywa, now that my traits are made, will it work ?

  10. #10
    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: How do I make a child faction heir?

    I would think so - as long as you don't mind that the last trigger will fire every turn for every faction leader (which isn't really that bad). Or that the very first tested character (except the FL) in any faction will be the lucky recipient of the ancillary to start with

    Probably a good idea to invest the time to rewrite and use the e_select method.
    Last edited by Gigantus; March 22, 2018 at 08:56 AM.










  11. #11
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: How do I make a child faction heir?

    e_select_character is a bit flaky and doesn't work for AI. http://www.twcenter.net/forums/showt...illary-mission

    As for next-heir selector ancs and Authority: a good way is to not have any Authority in the anc. Instead, make a trait that gives Authority and a trigger that gives that trait to whoever has the anc. And another trigger to remove the trait from anybody who does not have the anc. And another trigger to remove the trait from the leader (and heir too if you like).

  12. #12
    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: How do I make a child faction heir?

    Thanks for linking me to that - I'll give it a try for an AI faction anyhow: while I understand that it won't work with a CharacterSelected event unless it's the player I wonder why I wouldn't work in connection with other Character events.










  13. #13
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: How do I make a child faction heir?

    Quote Originally Posted by Gigantus View Post
    I would think so - as long as you don't mind that the last trigger will fire every turn for every faction leader (which isn't really that bad). Or that the very first tested character (except the FL) in any faction will be the lucky recipient of the ancillary to start with
    Nop, this anc is just for the player, not the AI ! And it is transferable ... So no need to worry too much about it !

    My major concern was to remove the Anc from the FL, so that he does not have 10 Authority ... Because imagin, a FH has the Anc, becomes FL, then he will still have the Anc ... And being FL, he'll have 10 Authority ... So I want him not to have it. And if the player drag drop the Anc to someone else, then the FL must not have -10 Authority ... Do you think that it is what will happen with my code ?

    As for next-heir selector ancs and Authority: a good way is to not have any Authority in the anc. Instead, make a trait that gives Authority and a trigger that gives that trait to whoever has the anc. And another trigger to remove the trait from anybody who does not have the anc. And another trigger to remove the trait from the leader (and heir too if you like).
    How do you do that ?

    Code:
    Ancillary authority_power
        Type selector
        Transferable 1
        Image heir_selector.tga
        ExcludedAncillaries authority_power
        Description authority_power_desc
        EffectsDescription authority_power_effects_desc
    
    Trigger authority_power
    WhenToTest CharacterTurnEnd
    Condition AgentType = named character
          and not HasAncType selector
          and not FactionwideAncillaryExists authority_power
          and not IsFactionLeader
          and not IsFactionAIControlled
        AcquireAncillary authority_power Chance 100
    
    Trait GiveHeirAuthority
        Character family
        Hidden
        
        Level GiveAuthority
            Description GiveAuthority_desc
            EffectsDescription GiveAuthority_effects_desc
            Threshold 1
            
            Effect Authority 10
    
    Trait RemoveHeirAuthority
        Character family
        Hidden
        
        Level RemoveAuthority
            Description RemoveAuthority_desc
            EffectsDescription RemoveAuthority_effects_desc
            Threshold 1
            
            Effect Authority -10
    
    Trigger heirselector
        WhenToTest CharacterTurnStart
    
        Condition HasAncType selector
    
        Affects GiveHeirAuthority  1  Chance  100
    
    
    Trigger heirselectorremove
        WhenToTest CharacterTurnStart
    
        Condition not HasAncType selector
    
        Affects RemoveHeirAuthority  1  Chance  100
    Or the trigger :

    Code:
    Trigger heirselector
        WhenToTest CharacterTurnStart
    
        Condition HasAncType selector
    
        Affects GiveHeirAuthority  1  Chance  100
    
    Trigger heirselectorremove
        WhenToTest CharacterTurnStart
    
        Condition not HasAncType selector
    
        Affects GiveHeirAuthority  -1  Chance  100
    If the second option is the one, then I can get rid of the RemoveHeirAuthority Trait ...?

  14. #14
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: How do I make a child faction heir?

    If the second option is the one, then I can get rid of the RemoveHeirAuthority Trait ...?
    Yes and yes.

    Also add these lines...

    Code:
    Trigger heirselector
        WhenToTest CharacterTurnStart
    
        Condition HasAncType selector
          and Trait GiveHeirAuthority = 0
          and not IsFactionLeader
    
        Affects GiveHeirAuthority  1  Chance  100
    Red: That will ensure that nobody ever has more than 1 point in the GiveHeirAuthority trait, so removing 1 point (heirselectorremove trigger) will always work to completely remove the trait immediately. The remove trigger doesn't need a condition like this (and Trait GiveHeirAuthority = 1) because points can never go below 0. i.e. If somebody does not have the anc and does not have the trait then "Affects GiveHeirAuthority -1 Chance 100" is harmless (0 - 1 = 0), though pointless.

    Blue: Your anc trigger prevents the leader from getting it but there's nothing to stop the player from giving it to him. Or the heir still having it when he becomes leader. Having the anc is not the problem, having the Authority boost is, so prevent the leader from getting the boost (trait).

    If the heir has the anc (and trait) when he becomes leader then this new leader will still have the trait while he holds the anc. So another trigger is needed to remove the trait from the leader whether he has the anc or not...

    Code:
    Trigger heirselectorremoveleader
        WhenToTest CharacterTurnStart
    
        Condition IsFactionLeader
          and Trait GiveHeirAuthority = 1
    
        Affects GiveHeirAuthority  -1  Chance  100
    Quote Originally Posted by Gigantus View Post
    [e_select_character] while I understand that it won't work with a CharacterSelected event unless it's the player I wonder why I wouldn't work in connection with other Character events.
    I suppose for the same reason that the select_character command doesn't. Both are selecting a character and AI characters can't be selected.
    Last edited by Withwnar; March 23, 2018 at 11:15 PM.

  15. #15
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: How do I make a child faction heir?

    Oh yeah ! That is right ! You are really a master in triggers mate ! Thanks a lot for the codes, I would never could find all these myself.

    About e_select_character, I think you already advised not to use it 2 years ago when I was coding my remove_ancillary lines. Just for that same reason !

  16. #16
    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: How do I make a child faction heir?

    Did a simple test with these two monitors:
    Code:
    monitor_event CharacterTurnStart AgentType = priest
        e_select_character
        console_command give_ancillary this academic_advisor
        historic_event EARTHQUAKE_IN_ALEPPO
    end_monitor
    
    monitor_event CharacterTurnEnd AgentType = priest
        and HasAncType test                ; made ancillary type unique
        historic_event FIRST_WINDMILL
    end_monitor
    At the start of the second round (and third, just to be sure) I had a single windmill and about a dozen earthquakes, which means that e_select really doesn't work with AI factions (the local faction had only one priest).

    Last edited by Gigantus; March 26, 2018 at 09:36 AM.










  17. #17
    Titus le Chmakus's Avatar Biarchus
    Join Date
    Aug 2014
    Location
    Skiing on the Spine of the World or hunting in Lurkwood
    Posts
    648

    Default Re: How do I make a child faction heir?

    Yeah Withwnar said that 2 years ago ! Thanks for confirming !

  18. #18
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: How do I make a child faction heir?

    The link Gig provided says it too. It also says "Only 1 character can be selected per turn" which was news to me.

    With those and the other limitations mentioned in the link I gave...

    - If the character is in another character's army then e_select_character selects that commander instead of the event's character.
    - If the character is in a settlement and other named characters are present then it doesn't seem select ANYBODY in there, including the governor. Forts and ships might have the same problem (I haven't tested those).
    ...e_select_character is too limited and unreliable to ever be useful for anything. Almost.

    EDIT: Also this old post I dug up...

    Quote Originally Posted by Withwnar View Post
    I have two characters with the LorienGeneral trait at campaign start. This...

    Code:
    monitor_event CharacterTurnStart Trait LorienGeneral > 0
    
      e_select_character 
    	
      console_command give_ancillary this sauron_mace
    
    end_monitor
    ...gives the anc to one of them when the campaign starts. But not both. Not sure why not. But the fact that this actually selects the character in the settlement AND in turn triggers CharacterSelected - something that manually selecting him or using select_character do not - could be useful.

    EDIT: just capturing some other findings...

    Those two generals actually have different levels of that trait (4 and 5). I tried this instead...

    Code:
    monitor_event CharacterTurnStart Trait LorienGeneral == 4
    
      e_select_character 
      console_command give_ancillary this sauron_mace
    
    end_monitor
    
    monitor_event CharacterTurnStart Trait LorienGeneral == 5
    
      e_select_character 
      console_command give_ancillary this sauron_mace
    
    end_monitor
    ...no difference. But like this...

    Code:
    monitor_event CharacterTurnStart Trait LorienGeneral == 4
    
      e_select_character 
      console_command give_ancillary this sauron_mace
    
    end_monitor
    
    monitor_event CharacterTurnStart Trait LorienGeneral == 5
    
      e_select_character 
      console_command give_ancillary this army_of_dead
    
    end_monitor
    ...then they do both get their own ancillary. So it's something to do with giving the same ancillary that fails. Odd. Traits too it seems.
    Sounds like e_select_character can be used more than once per turn but - for some reason - give_ancillary/give_trait don't work (via e_select_character) more than once per turn IF they're for the same anc/trait.
    Last edited by Withwnar; March 26, 2018 at 10:28 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
  •