Results 1 to 4 of 4

Thread: Recruitable Historical Generals with correct Portrait!

  1. #1
    Quintus Hortensius Hortalus's Avatar Lex duodecim tabularum
    Citizen

    Join Date
    Jun 2011
    Location
    Electorate of Hannover
    Posts
    2,166

    Default Recruitable Historical Generals with correct Portrait!

    Here I want to share my knowledge about the portrait allocator with you and how it can be used to add historical persons with a correct portrait.

    1. Create new historical persons in the corresponding DB-files and the script.:
    Spoiler Alert, click show to read: 

    The birth date isn't actually the birth date it's the 20th anniversary after which the historical character can be created (so every historical person is at least 20 years old when recruited).
    It's important that the person is available from the start! So if your start date is 1700 the character needs to be available before or in 1700.

    2. The Portraits

    First the basics: there is one Portrait_Allocator for each culture so you have to add a new culture for the fraction to which the historical character should belong (My culture is "Hannover" and is only used for Hannover).

    Let's take a look in the Portrait_Categories in the Portrait_Allocator: (You need to convert the esf file to xml!)
    Spoiler Alert, click show to read: 

    I think everything is explained in the pic. The first number (always 44) is still unknown to me but seems to have no effect.
    The 2nd number is the point where the sequence starts (0 means the first number, 1 the second, etc...).
    Then we have 4 rows of the portrait sequences.
    The first row (starting with 44 8 23...) is for young persons from 20-44 and uses the portraits in the "young" folder.
    The 2nd (3 8 23...) for the old persons (45 onwards) and uses the portraits in the "old" folder.
    In both cases, the game-engine is using the starting portrait for the first character who is created regardless if he is a historical person or not! This is why it is important that you only add historical person which are available at the start!.
    The other 2 are most likely unused.

    So finally it is possible to add 2 historical persons to each category with a correct portrait (admiral, gentlemen, general, ministers do not work!) under the condition that one is less than 45 years old and the other is at least 45 years old. Then the game will give them the correct portrait as historical persons are always the first who get recruited.

    With this knowledge, you can even create a sequence of historical characters with correct portraits. All you need to is adding an if-and-not combination to the export_historic_characters.lua script.
    I marked below how to do it:
    Spoiler Alert, click show to read: 


    This code means that James Harris can be recruited once his spawning window ('Birth', take a look at the first pic) starts. The same is true for Robert Murray Keith. But I added another condition that needs to be fulfilled to be able to recruit Robert Murray Keith
    Code:
    and not conditions.CanGenerateHistoricalCharacter("James_Harris", context)
    This means that Robert Murray Keith can only be recruited if James Harris can't be recruited. This is true when James Harris is already recruited or his spawning window has ended.
    As you can see in the picture with this knowledge you can create a row of historical characters like this:
    Person A can be recruited, Person B only if Person A is recruited, Person C can only be recruited if Person B is recruited and therefore Person A is recruited, etc.

    Knowing this and that the portrait allocation works in the same way as my row of historical characters (linear, take a look at the rules state above) you have to strings which are working like this:
    The if now portrait 1 is the first portrait to appear and person A (Harris) is the first person to appear, person A gets always portrait 1. So portrait 1 can be a picture of him. Person B (Keith) is always the 2nd person to appear as well as portrait 2, so portrait 2 can be a portrait of person B, etc.

    This enables you to make long rows of historical characters.
    As example British scholars:
    Spoiler Alert, click show to read: 


    BTW: This should work for NTW too.

    If you have any further questions just ask me.
    Last edited by Quintus Hortensius Hortalus; February 25, 2019 at 05:54 AM.


    Under the patronage of wangrin my workshop

  2. #2
    Quintus Hortensius Hortalus's Avatar Lex duodecim tabularum
    Citizen

    Join Date
    Jun 2011
    Location
    Electorate of Hannover
    Posts
    2,166

    Default Re: Recruitable Historical Generals with correct Portrait!

    I added another part explaining how to create as many historical characters as you like.


    Under the patronage of wangrin my workshop

  3. #3

    Default Re: Recruitable Historical Generals with correct Portrait!

    Salve Quintvs Hortensivs Hortalvs

    Do you hav the same tuto about how leader's dead date is managed and how successor are aswell ?

    Vt vales

  4. #4
    Quintus Hortensius Hortalus's Avatar Lex duodecim tabularum
    Citizen

    Join Date
    Jun 2011
    Location
    Electorate of Hannover
    Posts
    2,166

    Default Re: Recruitable Historical Generals with correct Portrait!

    Quote Originally Posted by Xenophon06 View Post
    Salve Quintvs Hortensivs Hortalvs

    Do you hav the same tuto about how leader's dead date is managed and how successor are aswell ?

    Vt vales
    You can edit the successors in the 7th entry ("FAMILY::MONARCHY_INFO_CHARACTER") in the FAMILY tab in the startpos.
    And I don't know how the death date is handled. It might be the second date entry each character has in the CHARACTER_ARRAY tab in the startpos.


    Under the patronage of wangrin my workshop

Posting Permissions

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