Page 1 of 3 123 LastLast
Results 1 to 20 of 43

Thread: Working Patriarch & Redesigned Bishops

  1. #1
    gracul's Avatar 404 Not Found
    Artifex

    Join Date
    Dec 2007
    Location
    Poland
    Posts
    2,009

    Default Working Patriarch & Redesigned Bishops

    In this tutorial i'll show how to get a working patriarch model (1 per every orthodox faction), and how to change catholic bishops so you can have a bishop per every settlement. These are some of the new scripts to be found in SS 6.2.

    Patriarchs
    Right now, the patriarch model is the one completely unused in the game. The problem with assigning the patriarch is simple - there should only be 1 patriarch per faction, but there is no way to export the fact that a patriarch has already been appointed. Not with using just 1 file that is
    In my mod i have 3 orthodox factions, Kievan Rus, Russia, and the Byzantium.
    So, lets add a patriarch level to the priestlevel trait first in EDCT:
    ;------------------------------------------
    Trait PriestLevel
    Characters priest

    Level Bishop
    Description Bishop_desc
    EffectsDescription Bishop_effects_desc
    GainMessage Bishop_gain_desc
    LoseMessage Bishop_lose_desc
    Threshold 1

    Effect Piety 1
    Effect Level 1

    Level Cardinal
    Description Cardinal_desc
    EffectsDescription Cardinal_effects_desc
    Threshold 2

    Effect Piety 1
    Effect Level 2
    Effect HeresyImmunity 1

    Level Patriarch
    Description Patriarch_desc
    EffectsDescription Patriarch_effects_desc
    GainMessage Patriarch_gain_desc
    Epithet Patriarch_epithet_desc
    Threshold 3

    Effect HeresyImmunity 1
    Effect Piety 2
    Effect Level 2
    Effect MovementPoints 10
    Now we need to somehow be able to tell if we already have a patriarch or not. And we want the AI to be able to get a patriarch too. Thats why we edit the campaign_script file. The monitor_event in the script file will basically be the same as the trigger for the Patriarch trait, i only check for the piety:
    declare_counter patriarch_count

    monitor_event PreFactionTurnStart TrueCondition
    set_event_counter PatriarchByzantium 0
    set_event_counter PatriarchRussia 0
    set_event_counter PatriarchKievanRus 0
    set_counter patriarch_count 0
    end_monitor

    monitor_event CharacterTurnEnd AgentType = priest
    and CharFactionType kievan_rus
    and Attribute Piety > 4

    if I_CompareCounter patriarch_count = 1
    set_event_counter PatriarchKievanRus 1
    end_if

    inc_counter patriarch_count 1

    end_monitor

    monitor_event CharacterTurnEnd AgentType = priest
    and CharFactionType russia
    and Attribute Piety > 4

    if I_CompareCounter patriarch_count = 1
    set_event_counter PatriarchRussia 1
    end_if

    inc_counter patriarch_count 1

    end_monitor

    monitor_event CharacterTurnEnd AgentType = priest
    and CharFactionType byzantium
    and Attribute Piety > 4

    if I_CompareCounter patriarch_count = 1
    set_event_counter PatriarchByzantium 1
    end_if

    inc_counter patriarch_count 1

    end_monitor
    The patriarch_count is used in one purpose, if many priests have > 4 piety and there is no Patriarch, then make sure that only once the PatrirachByzantium event will equal 0. We also need an event to tell us we have a patriarch already:
    monitor_event CharacterTurnStart AgentType = priest
    and CharFactionType kievan_rus
    and Trait PriestLevel = 3

    set_event_counter PatriarchKievanRus 1

    end_monitor

    monitor_event CharacterTurnStart AgentType = priest
    and CharFactionType russia
    and Trait PriestLevel = 3

    set_event_counter PatriarchRussia 1

    end_monitor

    monitor_event CharacterTurnStart AgentType = priest
    and CharFactionType byzantium
    and Trait PriestLevel = 3

    set_event_counter PatriarchByzantium 1

    end_monitor
    Now, we have an event exported by the campaign_script file, telling us if we really have a patriarch appointed or not, so let's create the triggers in the EDCT then:
    ;------------------------------------------
    Trigger priest_patriarch_kievan_rus
    WhenToTest CharacterTurnEnd

    Condition AgentType = priest
    and CharFactionType kievan_rus
    and Attribute Piety > 4
    and I_EventCounter PatriarchKievanRus = 0

    Affects PriestLevel 3 Chance 100

    ;------------------------------------------
    Trigger priest_patriarch_russia
    WhenToTest CharacterTurnEnd

    Condition AgentType = priest
    and CharFactionType russia
    and Attribute Piety > 4
    and I_EventCounter PatriarchRussia = 0

    Affects PriestLevel 3 Chance 100

    ;------------------------------------------
    Trigger priest_patriarch_byzantium
    WhenToTest CharacterTurnEnd

    Condition AgentType = priest
    and CharFactionType byzantium
    and Attribute Piety > 4
    and I_EventCounter PatriarchByzantium = 0

    Affects PriestLevel 3 Chance 100
    We can also add conditions like EndedInSettlement and SettlementName or IsRegionOneOf, but since this is just a tutorial im showing the basics. Remember to add the same conditions to the campaign_script file.
    So, to gather, we use the script file to export an event read by the EDCT file which will appoint a patriarch. Since in both files the exact same requirements have to be met, we will always get 1 patriarch.

    There is 1 drawback however, when you hover over the ui card of the priest, you will see "Cardinal", and same when you open his window - above Piety there will be a Cardinal and not a Patriarch even if you change relevant expanded.txt strings.
    So to change this around, change the Patriarch trait to an Effect Level 3.
    Open descr_models_strat and for both russia, kievan_rus and byzantium we need to change:
    strat_model orthodox_priest ; default model
    strat_model orthodox_bishop ; medium level priest
    strat_model orthodox_patriarch ; advanced priest
    Into:
    strat_model orthodox_priest ; default model
    strat_model orthodox_bishop ; medium level priest
    strat_model orthodox_bishop ; placeholder
    strat_model orthodox_patriarch ; advanced priest
    Which is basically adding a level.
    Now, in expanded.txt we have to update the cultures and the faction with the patriarch description
    First culture:
    {EMT_GREEK_PRIEST_1}Bishop
    {EMT_GREEK_PRIEST_2}PLAYER WILL NOT SEE THIS WITH THIS CULTURE
    {EMT_GREEK_PRIEST_3}Patriarch
    {EMT_GREEK_PRIEST}Priest
    {EMT_EASTERN_EUROPEAN_PRIEST_1}Bishop
    {EMT_EASTERN_EUROPEAN_PRIEST_2}Cardinal
    {EMT_EASTERN_EUROPEAN_PRIEST_3}Patriarch
    {EMT_EASTERN_EUROPEAN_PRIEST}Priest
    Update for other cultures too. Every faction will a patriarch will also need a new entry at the faction section.
    {EMT_BYZANTIUM_PRIEST_1}Byzantine Bishop
    {EMT_BYZANTIUM_PRIEST_2}WILL NOT SEE THIS
    {EMT_BYZANTIUM_PRIEST_2}Byzantine Patriarch
    {EMT_BYZANTIUM_PRIEST}Byzantine Priest
    Do the same for all orthodox factions. Now the drawback's gone and we got a Patriarch with his own model working in the game with all correct descriptions. Cool.

    Bishops
    A bishop is always someone created in a cathedral or better. Stupid huh?
    In reality, a bishop is appointed for every major diocese(major in a sense that has either a lot of people, is historical etc), so that doesn't really fit with the way we have them here in MTW.
    Using a variation on the patriarch script above, lets create a script which will appoint a bishop per settlement. Meaning if we have 5 settlements and 8 priests, we will always have 5 bishops, never more never less. Oh, and lets make the bishop lose his title if the settlement gets lost.
    So, the script file:
    declare_counter bishop_count

    monitor_event PreFactionTurnStart TrueCondition
    set_counter bishop_count 0
    end_monitor

    monitor_event CharacterTurnEnd AgentType = priest
    and not CharacterReligion pagan
    and not CharacterReligion islam
    and Trait PriestLevel = 0

    if I_CompareCounter bishop_count = 0
    set_event_counter AppointBishop 0
    end_if

    if I_CompareCounter bishop_count < 0
    set_event_counter AppointBishop 1
    inc_counter bishop_count 1
    end_if
    end_monitor

    monitor_event CharacterTurnEnd AgentType = priest
    and not CharacterReligion pagan
    and not CharacterReligion islam
    and Trait PriestLevel = 1

    if I_CompareCounter bishop_count = 0
    set_event_counter StripBishop 0
    end_if

    if I_CompareCounter bishop_count > 0
    set_event_counter StripBishop 1
    inc_counter bishop_count -1
    end_if
    end_monitor
    So basically, we use the sequence system (PFTS>CTS>STS>STE>CTE) in order to count how many actual bishops we have, and we substract the number of settlements we have. Also we 'block' the triggers in EDCT from fireing with the compare counters.
    So now the EDCT triggers:
    ;------------------------------------------
    Trigger Priest_to_Bishop
    WhenToTest CharacterTurnEnd

    Condition AgentType = priest
    and I_EventCounter AppointBishop = 1
    and Trait PriestLevel = 0

    Affects PriestLevel 1 Chance 100

    ;------------------------------------------
    Trigger Priest_stripped_Bishop
    WhenToTest CharacterTurnEnd

    Condition AgentType = priest
    and I_EventCounter StripBishop = 1
    and Trait PriestLevel = 1

    Affects PriestLevel -1 Chance 100
    Simple and easy. We can add a ton of other requirements, but remember this conditions have to 'mimic' the ones in the script file.
    Also delete all the stupid triggers in the EDCT file, which will cause you to get a bishop every time you recruit someone in a cathedral city.
    Last edited by gracul; March 19, 2010 at 08:25 PM. Reason: corrected mistake.

  2. #2
    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: Working Patriarch & Redesigned Bishops

    Spledifious!!
    Always wondered how to get the good man working properly.










  3. #3

    Default Re: Working Patriarch & Redesigned Bishops

    Good work, this looks very helpful.
    Son of PW

  4. #4
    Lukianos's Avatar Tiro
    Join Date
    Jul 2007
    Location
    Ontario, Canada
    Posts
    207

    Default Re: Working Patriarch & Redesigned Bishops

    Hey gracul;

    So I managed to get the campaign to load up properly. The problem was that I did not have the triggers in the correct spot and the scripts weren't properly placed either.

    I used the give_trait cheat to up my starting Bishop's piety to 7, and he converted into the Patriarch model.

    The only remaining problem seems to be with the expanded.txt file. It still lists my patriarch as a cardinal. If you can help me solve this problem I'd be really grateful!

    Thanks again!

  5. #5
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Working Patriarch & Redesigned Bishops

    For a second there I thought this was some sort of non-included Orthodox 'pseudo-pope' that had left remnants. Still a useful tutorial I'd say, for anyone who wants to use a similar implementation. Incidentally, you can have up to 9 levels per agent, and as models and strings can be changed on a faction to faction basis, there's a lot of possibility for creating hierarchical illusions such as this.

    You have one typo:
    {EMT_BYZANTIUM_PRIEST_2}WILL NOT SEE THIS
    {EMT_BYZANTIUM_PRIEST_23}Byzantine Patriarch
    Though I'm fairly certain the worst it would do is display the second string in the wrong location, since the files tend to take the last similar item read. I'm guessing it stores them as variables as it reads it top to bottom, so anything which matches the qualifications for that variable will simply overwrite the previous, like:

    # Finished reading line 1031
    Byzantium.priest = DocString(2:"WILL NOT SEE THIS")
    # Finished reading line 1032
    Byzantium.priest = DocString(2:"Byzantine Patriarch")

    Though that's trivial.

  6. #6
    Lukianos's Avatar Tiro
    Join Date
    Jul 2007
    Location
    Ontario, Canada
    Posts
    207

    Default Re: Working Patriarch & Redesigned Bishops

    So I found that the problem is that when I have a PriestLevel 3, the game will not read the proper coded line in expanded.txt. For Kievan Rus and Novgorod, I continually get "Cardinal" instead of "Patriarch" and for Byzantium I get a "PLAYER WILL NOT SEE THIS".

    I am unsure as to how to correct this.

  7. #7
    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: Working Patriarch & Redesigned Bishops

    I am not seeing the descr_character file, but does it look like this (without the level entries)?
    faction byzantium
    dictionary 2
    strat_model orthodox_priest = level 0
    strat_model orthodox_bishop = level 1
    strat_model orthodox_bishop = level 2
    strat_model orthodox_patriarch = level 3
    Then the following applies in expanded:
    {EMT_BYZANTIUM_PRIEST}Byzantine Priest = level 0
    {EMT_BYZANTIUM_PRIEST_1}Byzantine Bishop = level 1
    {EMT_BYZANTIUM_PRIEST_2}Byzantine Cardinal = level 2
    {EMT_BYZANTIUM_PRIEST_3}Byzantine Patriarch = level 3
    Guess you got caught by counting the first level as 1 and not as zero.
    Last edited by Gigantus; April 13, 2010 at 09:36 AM.










  8. #8
    Lukianos's Avatar Tiro
    Join Date
    Jul 2007
    Location
    Ontario, Canada
    Posts
    207

    Default Re: Working Patriarch & Redesigned Bishops

    Hah, I just forgot to edit the desc_char file. The unit card and his window now properly displays "Patriarch", but when I hover over him on the strat map I get "EMT_RUSSUA_PRIEST_3".

  9. #9
    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: Working Patriarch & Redesigned Bishops

    "EMT_RUSSIA_PRIEST_3"
    This indicates a missing level 3 entry for the RUSSIAN priest in the expanded.txt file - not byzantium!

    {EMT_RUSSIA_PRIEST_3}Russian Patriarch










  10. #10
    Lukianos's Avatar Tiro
    Join Date
    Jul 2007
    Location
    Ontario, Canada
    Posts
    207

    Default Re: Working Patriarch & Redesigned Bishops

    Thank you so much giganticus, +rep.

    It took a while but it's working. Got my Patriarch's up and running!

  11. #11
    Lukianos's Avatar Tiro
    Join Date
    Jul 2007
    Location
    Ontario, Canada
    Posts
    207

    Default Re: Working Patriarch & Redesigned Bishops

    Actually one final thing - is it possible to have "Patriarch" listed under the character's traits in the window like "Bishop" and "Cardinal" are? That seems to be the only inconsistency that I have left remaining. Other than that it works fine.

  12. #12
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Working Patriarch & Redesigned Bishops

    Quote Originally Posted by Lukianos View Post
    Actually one final thing - is it possible to have "Patriarch" listed under the character's traits in the window like "Bishop" and "Cardinal" are? That seems to be the only inconsistency that I have left remaining. Other than that it works fine.
    I don't see why it wouldn't be listed as a trait on the right-side listing, if that's what you're referring to. Are you using this definition of the trait?
    Level Patriarch
    Description Patriarch_desc
    EffectsDescription Patriarch_effects_desc
    GainMessage Patriarch_gain_desc
    Epithet Patriarch_epithet_desc
    Threshold 3

    Effect HeresyImmunity 1
    Effect Piety 2
    Effect Level 2
    Effect MovementPoints 10
    If not, it's possible you accidentally set the trait to 'Hidden', which would make it not appear there.

  13. #13
    Lukianos's Avatar Tiro
    Join Date
    Jul 2007
    Location
    Ontario, Canada
    Posts
    207

    Default Re: Working Patriarch & Redesigned Bishops

    I figured it out actually. The Patriarch files in export_vnvs.txt for some reason were listed as Patriach. All fixed now. Thanks for the help!

  14. #14
    Lukianos's Avatar Tiro
    Join Date
    Jul 2007
    Location
    Ontario, Canada
    Posts
    207

    Default Re: Working Patriarch & Redesigned Bishops

    Hey guys,

    So I tried to use the Bishop script today, and once again I am having problems. It just does not seem to work. I copy/pasted into campaign_script and EDCT, and tried a new campaign but it does not seem to trigger the Priest to Bishop event.

    Any one else tried it? Gotten it to work? Thanks for the help.

  15. #15
    gracul's Avatar 404 Not Found
    Artifex

    Join Date
    Dec 2007
    Location
    Poland
    Posts
    2,009

    Default Re: Working Patriarch & Redesigned Bishops

    Maybe try this.
    Pick a faction like byzantium, use the spawn_character inside the campaign_script to spawn a couple of priests for byzantium, and then after you click end turn, most of them should go bishop.

  16. #16
    TW fan's Avatar Libertus
    Join Date
    Jun 2010
    Location
    Lithuania
    Posts
    65

    Default Re: Working Patriarch & Redesigned Bishops

    {EMT_GREEK_PRIEST_1}Bishop
    {EMT_GREEK_PRIEST_2}PLAYER WILL NOT SEE THIS WITH THIS CULTURE
    {EMT_GREEK_PRIEST_3}Patriarch
    {EMT_GREEK_PRIEST}Priest
    {EMT_EASTERN_EUROPEAN_PRIEST_1}Bishop
    {EMT_EASTERN_EUROPEAN_PRIEST_2}Cardinal
    {EMT_EASTERN_EUROPEAN_PRIEST_3}Patriarch
    {EMT_EASTERN_EUROPEAN_PRIEST}Priest

    Where do you paste that? i cant find the file

  17. #17
    TW fan's Avatar Libertus
    Join Date
    Jun 2010
    Location
    Lithuania
    Posts
    65

    Default Re: Working Patriarch & Redesigned Bishops

    And wich trigers i need to delete please more details in what to do and what to delete 1 wrong word and the games goes boom

  18. #18

    Default Re: Working Patriarch & Redesigned Bishops

    The file u are looking for is expanded.txt found inside data\text folder.

  19. #19
    TW fan's Avatar Libertus
    Join Date
    Jun 2010
    Location
    Lithuania
    Posts
    65

    Default Re: Working Patriarch & Redesigned Bishops

    and wich program i must use to open it

  20. #20

    Default Re: Working Patriarch & Redesigned Bishops

    U have to use either a .bin editor to open them or convert them to .txt file by a python script.

Page 1 of 3 123 LastLast

Posting Permissions

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