Results 1 to 11 of 11

Thread: Is it possible to decide the name of emerging horde leader?

  1. #1
    Alondite's Avatar Semisalis
    Join Date
    Sep 2018
    Location
    Taiwan
    Posts
    423

    Default Is it possible to decide the name of emerging horde leader?

    Well, I've adapted the script in vanilla game to call the Timurid invasion in Tsardoms: TW. The script works fine, but it seems that the "emergent_faction" event will spawn a faction leader simultaneously, so Timur can only be a family member when spawned after that.

    Can we somehow get rid of the random faction leader, and make Timur the leader of the Timurids? Maybe find some ways to kill the previous faction leader?

    Spoiler Alert, click show to read: 


    My script is like this:
    Code:
    monitor_event [whatever]
    
        event    emergent_faction    timurids
            date    0
            region    Kangri_Region
        end_add_events
    
        spawn_army
            faction timurids
            character Timur Barlas, named character, (whatever)
            trait [whatever]
            unit [whatever]
            ...
        end
    
    terminate_monitor
    end_monitor
    Many thanks
    Last edited by Alondite; October 15, 2019 at 03:25 AM. Reason: Add screenshots

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

    Default Re: Is it possible to decide the name of emerging horde leader?

    Try commenting out those four lines regarding emergent_faction. I think that the only thing it gives you which you might still want is a notification message that they have arrived on the map, but you could create a historic event for that.

  3. #3

    Default Re: Is it possible to decide the name of emerging horde leader?

    Withwnar is correct. You don't need the emergent_faction event. You can 'emerge' the faction just by spawning a character. This character will be the leader and only member of the family tree. If you spawn additional characters as family members, they will show up as children of the faction leader. I don't know what happens if you spawn more than 4 family members after the initial leader, they may show up as grandchildren. You can actually emerge non-horde factions the same way so long as they are given a settlement.

  4. #4
    Alondite's Avatar Semisalis
    Join Date
    Sep 2018
    Location
    Taiwan
    Posts
    423

    Default Re: Is it possible to decide the name of emerging horde leader?

    Thank you guys, everything works fine! The AI still acts like a horde, and won't be stuck in the position they spawned. I just thought the emergent_faction event is necessary to spawn a horde faction, but now I know I was wrong.

    And one thing maybe worth mentioned I found is that in the first turn of the invasion, the Timurids won't have a faction heir. The heir will be decided and assigned to one of the family member in the second turn. But I know we can give the specific family member a lot of authority so that he can become the heir, so that won't be a problem.

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

    Default Re: Is it possible to decide the name of emerging horde leader?

    I think you can spawn a second character and use the "heir" attribute...

    Code:
        spawn_army
            faction timurids
            character (whatever), named character, heir, (whatever)
            trait [whatever]
            unit [whatever]
            ...
        end

  6. #6
    Alondite's Avatar Semisalis
    Join Date
    Sep 2018
    Location
    Taiwan
    Posts
    423

    Default Re: Is it possible to decide the name of emerging horde leader?

    So we can spawn a heir with the "heir" attribute? Didn't know that.

    Does it only work when there are temporarily no heir in the faction? What will happen if a heir is spawned while there is already one?

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

    Default Re: Is it possible to decide the name of emerging horde leader?

    Don't quote me on it. Not sure I've actually tried leader/heir attributes in script.

    You can give "heir" to multiple characters in descr_strat - they all get it. I assume script spawns behave the same way but it's only a guess.

  8. #8
    Alondite's Avatar Semisalis
    Join Date
    Sep 2018
    Location
    Taiwan
    Posts
    423

    Default Re: Is it possible to decide the name of emerging horde leader?

    OK, I've tested and now the answer is clear. We cannot add the attribute "heir" in campaign script. The script simply cannot go through the compiler.

    script:
    Code:
    spawn_army
         faction timurids
        character    Shah Rukh, named character, heir, (whatever)
        (whatever)
    end
    log:
    Code:
    00:51:02.738 [system.io] [info] open:   found mods/Tsardoms_alpha-0.35/data/world/maps/campaign/imperial_campaign/campaign_script.txt (from: D:\Steam\steamapps\common\Medieval II Total War)00:51:02.739 [game.script] [error] Script parsing error at line 656, column 58 in mods/Tsardoms_alpha-0.35/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Unrecognised character data string (heir)
    00:51:02.739 [game.script] [error] Script parsing error at line 658, column 17 in mods/Tsardoms_alpha-0.35/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    Couldn't create a script from file mods/Tsardoms_alpha-0.35/data/world/maps/campaign/imperial_campaign/campaign_script.txt

  9. #9

    Default Re: Is it possible to decide the name of emerging horde leader?

    All you need is 'family' for the subsequent spawned characters and they will show up as children of the leader, hence heirs.

  10. #10
    Alondite's Avatar Semisalis
    Join Date
    Sep 2018
    Location
    Taiwan
    Posts
    423

    Default Re: Is it possible to decide the name of emerging horde leader?

    Quote Originally Posted by Callistonian View Post
    All you need is 'family' for the subsequent spawned characters and they will show up as children of the leader, hence heirs.
    Yeah, I know. But no family member can be the heir as soon as he spawned, it seems that the heir won't be decided until the next turn. That's not a problem for me though.

  11. #11
    Danya82's Avatar Tiro
    Join Date
    Oct 2010
    Location
    Saint-Petersburg, Russia
    Posts
    227

    Default Re: Is it possible to decide the name of emerging horde leader?

    Code:
    character (whatever), family
    traits Factionleader (Factionheir) 1 , (whatever)

Posting Permissions

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