Page 1 of 4 1234 LastLast
Results 1 to 20 of 61

Thread: Implementing a Playable papal_faction

  1. #1

    Default Implementing a Playable papal_faction

    This thread started as a question to the community as to why most mods leave their papal_faction (a faction using the same mechanics as the Papal States in vanilla) as unplayable. Here is the original thread if you're curious.

    Spoiler Alert, click show to read: 

    I'm completely sure this question has been asked before, but I can't find it amid the deluge of threads from 2007 asking how to make the papal_states playable. So I ask again: What problems are associated with making the papal_states faction playable? The question in particular is: Why did Third Age Total War and all of its submods put the papal_states faction up in the corner of the map to represent "Sauron" while leaving england as playable "Mordor". Why did they do it this way instead of simply making playable-papal_states represent Mordor?

    I've been looking through the scripts of TATW, DCI, and DAC and I don't see any obvious reasons for the papal_states faction to even exist. So I figure there must be some particular hard coded features of this faction that make it desirable to leave them unplayable in the corner of the map. This guide does not list any information that would prevent making the papal_states playable. It does mention a few things which are news to me (and which I seriously doubt).

    Quote Originally Posted by Papal States guide
    If the player does not give Inquisitors orders they act on their own, looking for heretics and other blasphemous individuals to denounce. They disband once heresy is no longer an issue, or after 3 successes or failures.
    I doubted it at first, but apparently this is accurate. The AI controls inquisitor agents for the papal_faction even when the faction is human-controlled. This doesn't apply to any other factions with inquisitors, just the papal_faction. It's very strange and annoying (since my mod does use inquisitors), but it doesn't explain why TATW and co. didn't make papal_states playable since inquisitors aren't used.

    Quote Originally Posted by Papal States guide
    The Papal States are never completely destroyed. Unlike any playable faction, the Papal States survive losing their last region. They also get a continuous stream of Popes from Papal Elections. The player could only 'lose' if all Catholic factions are destroyed, and they have no regions, armies, or characters. Even at that point the Papal States still exist technically but they won't rise up again.
    Perhaps this indestructibility has something to do with why the papal_states isn't being used as Mordor? I'm not sure how this manifests itself but it sounds exactly the same as a re_emergent faction. In fact, all factions are technically re-emergent as long as they start their turn with what they need to survive after they've been killed (for non-hordes, this is 1 named character and 1 settlement). So... the only difference here is that papal_states don't send out a "Faction Destroyed" message when they die?


    We have determined that the best answer to the original question is that most modders didn't bother to investigate the possibilities and simply followed the example of vanilla which they knew would work. Certainly, implementing a playable papal_faction is slightly more complicated than moving the papal_states from nonplayable to playable in descr_strat (which is as far as the old guides went). But we have found that there are no inordinate technical challenges preventing modders from using playable papal factions. Below, I present some advantages (and disadvantages) of a playable papal_faction, how to set it up, and how to address some of the technical challenges. We are still discovering things about how the papacy works in Medieval II, so please share your findings in the thread.

    Why (or Why Not to) Use a Playable papal_faction?

    Judging by the sheer number of threads people have made over the years about how to play as the Papal States in vanilla, there is obviously some appeal to playing as the pope. Many mods for Medieval II, such as Third Age Total War, repurpose the papacy while leaving some of its mechanics intact. But, most of these mods leave the papal_faction unplayable like in vanilla. We know this works because it's what they did in vanilla, so why should we try to make the faction playable?

    1) Saves a faction slot - Using the papal_faction as a quasi-papacy (like in TATW where the pope is meant to be Sauron) limits the usefulness of the faction for scripts (it can't be used a dummy faction for most things). In some cases, the unplayable papal_faction can reasonably be combined with another existent faction on the map (Sauron + Mordor) saving a faction slot.

    2) Excommunications - When other factions of the same religion (i.e. catholic) as the papal_faction attack the papal_faction, they are automatically excommunicated. Depending on the theme of the mod, this can help simulate the papal_faction being the head of a confederation of factions.

    3) Ultra Horde - The papal_faction with "no" family tree is unkillable by normal means. Unlike a regular horde, they can survive on the map with no assets and can only be killed by script. This can potentially be thematically useful depending on the mod.

    4) Leader-Dependent - Conversely, if the papal_faction has a family tree, the faction will be destroyed when the pope dies. This can also be potentially thematic depending on the mod.

    The reasons not to use a playable papal_faction include:

    1) Not Thematic - There is no thematic reason to have an invincible or leader-dependent faction in the mod. There is no use for the college of cardinals mechanic or etc. Most of these types of mods simply have no papal_faction.

    2) Avoiding Scripting - Some scripting is required to use a playable papal_faction. It's unavoidable. If you're averse to scripting, then you don't want to be using this mechanic.

    There are a few things which people might consider to be benefits or drawbacks of using a playable papal_faction which are merely misconceptions. For example, the papal_faction can participate in crusades normally and inquisitors agents are not limited to the papal_faction (in fact, they work better for non-papal_factions since they don't move on their own, see below).

    How to Set Up a Playable papal_faction

    The papal_faction is the faction that has the "papal_faction" tag in descr_sm_factions for special_faction_type. Any faction can have this tag, but only one faction can use it at a time. If you assign the tag to multiple factions, the first on in descr_sm_factions will be the true papal_faction (same applies for the slave_faction tag). You can give this tag to any existing faction and they will become the papal_faction, their leader will become the pope, and their religion will become the papal religion (instead of catholic). Fundamentally, this is all that's required to set up a playable papal_faction - just move the papal_faction to an existing playable faction (playable in descr_strat, of course) and that's it.

    There are a few other considerations though. The family tree can be set to "yes" or "teutonic" for this faction, but they will die as soon as the original pope dies. This is because, although such factions can have a visible family tree, the normal succession mechanic does not work for the papal_faction. The papal_faction does not have any heirs, so the leader (pope) is the only family member. Hence, when the pope dies or is sent off map, the faction is left with no family members on the map and is immediately destroyed. The College of Cardinals takes an additional turn to elect a new pope to replace the old one, which is far too long to keep the faction from dying. This is why the papal_faction is set to "no" family tree in descr_sm_factions in vanilla.

    As I mentioned above, it may be thematic for your playable papal_faction's existence to depend on the survival of a single character (although this can also be achieved with scripting for any regular faction). Otherwise, you will want to set the papal_faction's family tree to "no". Be aware that this will make the faction relatively invincible - able to survive turn after turn with absolutely no assets on the map (this applies to all "no" factions, not just the papal_faction). See below for how to address this.

    Fixing Issues with a Playable papal_faction

    - Calling Crusades

    The most obvious problem with a playable papal_faction, and one that has been extensively addressed in those old threads on this subject, is that it's difficult or impossible for the pope to "approve" crusade targets even when you're presumably playing as the pope. This is because the pope's approval of crusade targets is contingent on requesting faction's diplomatic standing with the papal_faction, and, oddly enough, factions don't necessarily have perfect standings with themselves. To fix this, we must script the papal_faction to always have perfect standing with itself and then we will always been able to call approved crusades. Here is an example script where england is the new papal_faction:

    Code:
    monitor_event PreFactionTurnStart FactionType england
       set_faction_standing england england 1.0
    end_monitor
    Note that this assumes the max standing is 1.0. This number, as well as the minimum, can be found in descr_faction_standings and in descr_campaign_db (I'm not sure if only one or both are needed).

    - Family Tree & Aliveness Decision

    Since the papal_faction family tree is set to "no", they can survive on the map with no assets - no named characters, no settlements, no units, no agents, no fleets, nothing. This may be thematically desirable for your particular mod (like an uber horde faction), but if you do eventually want his faction die, there is one means of killing it - the kill_faction command. You will need to come up with conditions under which the papal_faction, when human and/or AI control, should be killed, then use this command in script. For example:

    Code:
    monitor_event FactionTurnStart FactionType england
       if I_NumberOfHeirs england < 1   ;england has no named characters on the map
       and I_EventCounter england_alive == 1   ;script thinks england is alive
          set_event_counter england_alive 0   ;script knows that england is dead
          console_command kill_faction england   ;kill england faction
       end_if
    end_monitor
    This will destroy the england faction, the papal_faction in our example, when they have no named characters left on the map (synonymous to the condition for horde faction aliveness).

    - Moving Inquisitors

    A second issue we will need to address is inquisitors - the papal_faction's inquisitors move by themselves even when the faction is human-controlled. If your mod doesn't use the inquisitor agent type, then there are no worries, simply set the spawn chance for inquisitors to 0 in descr_campaign_db and you're set. Otherwise, if you want the papal_faction player to have control of their own inquisitors (as they would playing as another other faction with inquisitors, and indeed all factions can have this agent type), we need a script solution. Here's one:

    Code:
    monitor_event ButtonPressed ButtonPressed end_turn
    and I_EventCounter faction_turn_england == 1   ;this comes from a PreFactionTurnStart monitor for england that sets the counter to 1 and a FactionTurnEnd monitor setting it back to 0 so we know it's their turn
    and not I_IsFactionAIControlled england
        if I_CharacterExists inquistior_1
            console_command give_trait inquisitor_1 InquisitorLock 1
        end_if
    end_monitor
    
    monitor_event FactionTurnEnd FactionType england
    and not IsFactionAIControlled
        if I_CharacterExists inquisitor_1
            console_command remove_trait inquisitor_1 InquisitorLock
        end_if
    end_monitor
    And the trait in question:

    Code:
    Trait InquisitorLock
        Characters all
        Hidden
        Level InquisitorLock
            Description Hidden_desc
            EffectsDescription Hidden_effects_desc
            Threshold 1
            Effect MovementPoints -10
            Effect Piety 10
    And here is my original note:

    Quote Originally Posted by Callistonian
    In this script, I only care about the case when the papal_faction is human-controlled as I retire the inquisitors myself when they're AI. We only want to add the InquisitorLock trait when the england player presses the end turn button, and not when any other human faction presses end turn in hotseat as this could potentially allow england to start their turn with the trait still present for the inquisitors. And we cannot remove the trait using the inquisitors' CharacterTurnStart event as this leads to some serious bugs for their attribute levels and doesn't lock them in place or prevent the AI from retiring them. So instead we exploit the time window when the AI moves & retires.

    Obviously, this only works for labeled inquisitors who start on the map. Since ButtonPressed doesn't export character ID, I couldn't figure any way to make this work for generic inquistiors the game spawns. I've set the inquisitor params in descr_campaign_db to 0 which seems to be effective in preventing the game from ever spawning random inquisitors, so for my mod, this script is all that's needed to keep my starting inquistiors alive and fully under the player's control. For generic inquisitors, you'd need to find an event which exports character ID and always fires near the end of the player's turn.
    - Spawning New Popes

    Since the papal_faction with "no" family tree has no heirs, the normal succession mechanics will not give you new leaders (new popes). Instead, there are only two means of getting a new pope when the old one dies: 1) election of a priest from the College of Cardinals (the priest will transform into a named character who is your new faction leader) and 2) spawn_army. I assume most players are familiar with how the College of Cardinals works so we'll explore door #2.

    Any character (named characters, spies, admirals, princesses, even captains) spawned using spawn_army will turn into the pope if the papal_faction does not currently have a pope. This is convenient if we want to always have a uniquely named and portraited pope, but inconvenient if we ever want to use spawn_army for our playable papal_faction's scripts. To address this, we simply spawn a dummy pope before every instance of spawn_army and kill him after spawning our intended character. For example:

    Code:
    spawn_army
        faction england
        character    random_name, priest, age 20, x 373, y 237, label popecover_1   ;this priest will turn into the pope momentarily
        traits        PopeCover 1   ;this trait makes this character invisible, but it's not really needed since he's gone in a split second anyway
        unit        unit_type        exp 0 armour 0 weapon_lvl 0
    end
    spawn_army
        faction england
        character    random_name, named character, age 22, x 396, y 183, direction S   ;this character won't turn into the pope, this is the character we wanted to spawn onto the map
        traits        
        unit        unit_type            exp 0 armour 0 weapon_lvl 0
    end
    kill_character popecover_1   ;kill the pope cover, since this happens so fast, no message about "pope dies" will be sent out to anyone
    Remember that this is only needed for spawn_army - recruiting, adopting, converting, etc. any other character will not turn them into the pope.

    - Randomly Named Popes

    New popes spawned using spawn_army will obviously not have random names. However, new popes elected from the College of Cardinals will have a new random named assigned to them from the papal_faction's male names list. If we always want the pope to have the same name, we can spoof it by removing the name outright and only using his faction leader title. This can be done by editing the following line in expanded.txt for the appropriate papal_faction (I'm continuing with the england example):

    Code:
    {EMT_ENGLAND_FACTION_LEADER_NAME}Pope %S
    By deleting the %S, the randomized character name will be gone and all or our future popes will simply be named "Pope" (which can obviously be changed to whatever you like). This trick works for all factions, not just the papal_faction.

    Issues Yet to be Addressed

    - Reconciliation

    It would be nice if the papal_faction player had the option to reconcile exocmmunicated factions on demand. We have yet to come up with a script solution for this as there is no reconciliation command. It may suffice to simply set the diplomatic standing with the excommunicated faction to perfect.

    - Election Spawn Location

    We have yet to work out exactly why popes elected from the College of Cardinals always show up in the same region (at least in vanilla, where they always go to Rome province). The speculation is that this is due to the papal_faction being the creator of the region in question in descr_strat, but this is not confirmed.
    Last edited by Callistonian; June 03, 2021 at 05:56 AM.

  2. #2

    Icon3 Re: Why Avoid Using papal_states?

    I can't speak to mods, but I know that in general people don't make the Papal States playable because, if you play as them, the game will crash if you ever click on the "College of Cardinals" tab. There may be other reasons, but that's the one that I remember immediately. In general, making the Papal States playable causes a bunch of stability problems, similar to making the Senate playable in vanilla RTW, which is why people generally advise against doing it.

  3. #3

    Default Re: Why Avoid Using papal_states?

    I've tested playing as papal_states in vanilla on several occasions and never had an issue viewing the College of Cardinals tab. In fact, it's significantly more "stable" than the Lists Scroll which always crashes when I change how the items are ranked in the settlements tab (when playing as any faction). The College of Cardinals scroll is still viewable in TATW but it's perpetually empty by virtue of the fact that priests don't exist. Presumably, the game has a hard coded way of putting level 2 priests (cardinals) with high piety attribute in the college (all speculation on my part), but none of the mechanisms for these things exist in the mod, hence the list is empty.

    I strongly suspect that the main reason papal_states exists but is unplayable in TATW and its submods has something to do with crusades. I've read that the papal_states can't directly participate in crusades, but elsewhere I've read that they can. Even if they can't participate, so long as they're the only faction that can call them (by spawning a priest with the required piety level) I don't see the problem. All of the many mission effects (traits, ancillaries, faction standings, etc.) associated with crusades can easily be replicated in script if desired.

  4. #4

    Default Re: Why Avoid Using papal_states?

    Quote Originally Posted by Callistonian View Post
    I've tested playing as papal_states in vanilla on several occasions and never had an issue viewing the College of Cardinals tab. In fact, it's significantly more "stable" than the Lists Scroll which always crashes when I change how the items are ranked in the settlements tab (when playing as any faction). The College of Cardinals scroll is still viewable in TATW but it's perpetually empty by virtue of the fact that priests don't exist. Presumably, the game has a hard coded way of putting level 2 priests (cardinals) with high piety attribute in the college (all speculation on my part), but none of the mechanisms for these things exist in the mod, hence the list is empty.

    I strongly suspect that the main reason papal_states exists but is unplayable in TATW and its submods has something to do with crusades. I've read that the papal_states can't directly participate in crusades, but elsewhere I've read that they can. Even if they can't participate, so long as they're the only faction that can call them (by spawning a priest with the required piety level) I don't see the problem. All of the many mission effects (traits, ancillaries, faction standings, etc.) associated with crusades can easily be replicated in script if desired.
    In this case, I don't think I can help you more, as I don't have an in-depth knowledge of the workings of TATW. I would suggest posting in the TATW sub-forum or messaging one of the TATW devs.

  5. #5

    Default Re: Why Avoid Using papal_states?

    The question is not specific to TATW, that mod is just my most familiar example and I know several of the submod developers are still active around here. There are many mods that feature unplayable papal_factions and I'd like to know why. The TATW forum is not currently being used for technical support. The TATW devs are not active. You know, I usually try to scrub all my posts in this forum of any traces of the particular mod I'm working on. It figures that the one time I'm explicit about my examples...


    At any rate, I've found that the papal_faction can certainly call and participate in crusades. So those objections are down. I'm still trying to figure out what makes crusades available to be called. My working theory is that the papal_faction needs at least one character on the map. This is how they set the turn when crusades start being called in TATW, they spawn a priest for papal_states (in the middle of the map, for some reason). The piety attribute level of the priest doesn't seem to matter. In fact, priests aren't necessary at all. This could well be the answer to the mystery - they didn't want to make the papal_faction playable because it would make crusades available from turn 1.

    I'm also struggling to find a way to prevent the AI from moving and retiring my papal_faction inquisitors. Any help on that front would be greatly appreciated as well.

  6. #6
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Why Avoid Using papal_states?

    Calling crusades - you seem to mix up how a jihad is called (via a high piety priest) and a crusade (via papal UI). TATW spawns a priest for the papal_states after turn 46 and respawns him when he dies. Given the traits he gets (more then the required 5 piety) he will become cardinal and then pope (FL) as no other character exists for papal_states otherwise. That makes the descr_campaign_db min turn setting with a default of 20 before which crusades can be called superflous. Other then that there are no settings for 'cool down' between crusades or 'min papal favor required' to call a crusade in that file.

    So I guess you do (unsurprisingly) need a pope to call a crusade, a simple priest won't do.

    Being the pope yourself you should be able to call a new crusade immediately once the cool down has expired.

    I have never tried myself to play a faction with the papal_states special faction setting in descr_sm_factions but I have a feeling that it would be short lived as the faction hasn't (can't support?) got a family tree, eg no line of inheritance. On the other hand the special setting may prevent to loose under the 'normal' condition of 'zero family member' even if the faction is controlled by the player.

    Simply kill the pope when you play the faction and see what happens.
    Last edited by Gigantus; December 15, 2020 at 01:19 AM.










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

    Default Re: Why Avoid Using papal_states?

    Two additional observations re TATW's design:

    1) The name of the pope is visible, in at least one place, and as TATW always spawns a character/leader/pope with the name of "Sauron" it is always shown as "Sauron" in that place where it can be seen. If papal states were playable, or if Mordor was made the papal states faction, then this name would instead be that of whomever happens to be leader at the time. The faction/pope is intended to represent the spirit/will of Sauron, not Gazbug or any other random Orc/Nazgul.

    2) The aforementioned spirit/will lives on even if Sauron the Mordor general is dead, indeed even if the Mordor faction is dead. So crusades can continue and catholic factions can still fall out of favour with spirit Sauron (excommunication). I think: DCILA kills the pope when the Mordor faction dies but I'm fairly sure TATW does not do this.

    Speaking for DCILA, it isn't that we decided to make papal states unplayable, only that we decided not to (and saw no reason to) change how TATW did things in this area. Some tweaks but the core design remains untouched.

  8. #8
    Jadli's Avatar The Fallen God
    Gaming Emeritus

    Join Date
    Dec 2013
    Location
    Czech Republic
    Posts
    8,528

    Default Re: Why Avoid Using papal_states?

    Are there any mods apart the historical ones (that truly use it) and TATW (where they "half" use it) actually using it?

    Seems to me the papal mechanics are definitely one of the best aspects of the vanilla for sure (especially the way it affects relations between factions, a bunch of various missions and tasks, excommunications, etc), so its shame people dont find a way to use it in their mods... and repurpose it for their needs....

    I have been planning to try repurpose the papacy into a form of government (pretty much holy roman empire mechanics), but will not get on it for a few weeks for sure...

    On the issues discusses here:

    Weird thing with inqisitors... you could perhaps sort it out by some trait lowering their movement points between the end of the turn and start of the turn?

    Im very interested about how the succession would work... Have you tried setting the family tree to yes or teutonic? Also, if you wanted to make it more like a normal playable faction (with a normal family tree), I suppose you could archive it by increasing the piety requirement for cardinals in descr_campaign_db and making sure no priest ever reach it, thus no cardinals and no elections... and then you would have a normal sucession perhaps? (assuming you enable family tree. And if not, I assume authority would decide, which you could just assign to dynasty members)

    Also, something else could be done... simply move FL into an inacessible part of the map and make sure he never dies... and you wouldnt have to worrry about how the succession/election works, while the mechanics would be kept under player

    Though, not sure if we need to disable/enable elections... hopefully someone tests it soon and let us know how it works when a player plays pope and he dies...

  9. #9
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Why Avoid Using papal_states?

    Like you enthusiasm.

    Family tree - that should make for some interesting moments, considering that the pope gets generated via priests while a regular FL comes from named characters. It's why I suggested to kill the pope and see what happens in the default setup already, a simple kill_character script will do the job.

    There is no 'immortal' setting unlike in RTW ALX, so the closest you will comes to it is the way TATW did it.

    Edit: just killed my pope (default settings for faction) and my captains were left holding the bag, but no crash. In the following turn a new pope got collected and he popped up in Rome, my capital. I was able to select a cardinal from the preferati and the election proceeded as usual otherwise.

    Using a teutonic tree and changing one of his captains into a named character to have a'second in command' ends up in multiple 'victory condition failed' messages, question marks on unit cards and eventually a game over and crash to menu after the pope gets ki.lled

    As I assumed family trees simply aren't the pope's thing, although a regular tree would still need testing - but that's as far as I am prepared to take it. Maybe another day.
    Last edited by Gigantus; December 15, 2020 at 12:41 PM.










  10. #10

    Default Re: Why Avoid Using papal_states?

    Do cardinals turn into generals when they become pope? Let's say Portugal has a priest. The priest gets the min Piety threshold and becomes a cardinal. The cardinal gets promoted to the College of Cardinals. Then the current pope (who's a general and the faction leader for the papal_faction) dies and Portugal's cardinal gets elected as the new pope. Does this mean that Portugal's cardinal effectively has been converted from a priest belonging to portugal into a general belonging to papal_states? If this is how it works, why doesn't papal_states in TATW get a pope general as their faction leader? Why does it suffice just to have a cardinal (priest) on the map?

    The "pope" who assigns missions is nothing but text (smoke and mirrors) and the "pope" who you need good relations with to successfully suggest crusades is actually the papal_faction itself. But there is certainly a "real pope" on the map. I had thought this was the faction leader (a general) of the papal_faction, but TATW seems to get away with using a priest as described above. This "real pope" is the one who's needed to call crusades and the one whose death triggers an election of a new pope from the College of Cardinals. Does the "real pope" need to be the faction leader of the papal_faction and if so, does this imply that the priest in TATW is the faction leader of the papal_states?

    Quote Originally Posted by Gigantus View Post
    So I guess you do (unsurprisingly) need a pope to call a crusade, a simple priest won't do.
    Priests are not needed at all for crusades to be available. I removed all priests from the papal_faction and crusades were still available. The faction leader becomes the general-pope and I suspect this allows crusades to be called. But, as discussed above, it also apparently suffices to use a cardinal (priest) to fill this role and allow crusades to be called. Since killing the general-pope kills the faction (as 'yes', 'no', and 'teutonic'), I'm still not sure what the exact conditions are for crusades being available.

    Quote Originally Posted by Gigantus View Post
    the faction hasn't (can't support?) got a family tree, eg no line of inheritance. On the other hand the special setting may prevent to loose under the 'normal' condition of 'zero family member' even if the faction is controlled by the player.
    The papal_faction can have a family tree by setting them to 'yes' in descr_sm_factions. For some reason, all adoption offers will be rejected up until a certain point (I'm not sure exactly when, I just let the AI play through a few turns in hotseat and something in the intervening time made adoptions acceptable). Here's proof:

    Spoiler Alert, click show to read: 




    The problem is that, as you can see in the picture, there is no faction heir. You can assign the heir attribute in descr_strat and setup the family tree there, but the game won't treat the character as an heir. I suspect that the whole line of succession I was talking about in the other thread (in the context of I_NumberOfHeirs) doesn't even apply to the papal_faction - none of its named characters have a succession rank. Therefore, nobody takes over when the faction leader (general-pope) dies and hence the faction dies. So it's technically possible for the papal_faction to have a family tree, but it's just for show.

    I haven't tested what happens when the pope-general dies when there are cardinals in the College of Cardinals. Presumably, one of the cardinals becomes the new pope and the faction survives although I'm not sure how you would explain such an event in the context of TATW.

    Quote Originally Posted by Withwnar
    If papal states were playable, or if Mordor was made the papal states faction, then this name would instead be that of whomever happens to be leader at the time. The faction/pope is intended to represent the spirit/will of Sauron, not Gazbug or any other random Orc/Nazgul.
    I think the solution there is to have the pope-general start off map and thus be unkillable. This does result in the pope_died event message being sent out to all catholic factions on turn 1, but the text and image for this event are easily moddable. When it's time for Sauron to "return", we just spawn a dummy general like in the original script. This plan also addresses some really weird bugs I've been seeing with Sauron when he starts on the map as the pope-general. His portrait doesn't show up and is instead replaced by the unit icon which is selectable. You can then move the unit away from the army leaving the character strat model invisible or visible but without a banner. The character, as such without any units, can't interact with anything else on the map (can't attack anything, open diplomacy, enter residence, etc.). I've seen the "character with no units" bug before in totally different contexts, I'm still not sure what induces it.

    Anyway, the only problem with having the pope-general off map, as far as I can tell, is that he'll eventually die of old age.

    Quote Originally Posted by Withwnar
    The aforementioned spirit/will lives on even if Sauron the Mordor general is dead, indeed even if the Mordor faction is dead. So crusades can continue and catholic factions can still fall out of favour with spirit Sauron (excommunication). I think: DCILA kills the pope when the Mordor faction dies but I'm fairly sure TATW does not do this.
    DAC also kills the pope when the Ring is destroyed but I think the papal_states survives the Mordor faction being defeated. I don't know how much sense this makes though since there's no script in DAC (or TATW iirc) to revive the Mordor faction at any point. I know DCILA does have a most excellent Mordor revival script. If Mordor can be revived, then I suppose it makes sense to keep the pope alive to call invasions (although good luck getting him to call invasions that will actually facilitate Mordor's recovery from good factions). Wouldn't it be possible to still do this if Mordor is the papal_faction? If Mordor is human-controlled and they die, then game over, no revival needed (even for hotseat). If Mordor is AI-controlled, then we can keep the pope alive with just a single cardinal spawned in the corner of the map.

    Quote Originally Posted by Jadli
    Weird thing with inqisitors... you could perhaps sort it out by some trait lowering their movement points between the end of the turn and start of the turn?
    Good suggestion. I tried giving them a trait to lock them in place (-500 MovementPoints) and max out their Piety in hopes of preventing the AI from moving and retiring them respectively, but it didn't work. I was using FactionTurnEnd to add the trait and FactionTurnStart to remove it. I suspect it failed because the AI moves and retires the inquisitors after the end turn button is pressed but before FactionTurnEnd fires. Unfortunately, the ButtonPressed event doesn't export character ID so there's no way to use it to assign traits.

    Quote Originally Posted by Jadli
    Have you tried setting the family tree to yes or teutonic?
    Yes, see above. I was originally testing with teutonic and there doesn't seem to be a difference compared with 'no'. The entire succession mechanic the game uses to pick heirs seems to be disabled for the papal_faction. I figure the only way the papal_faction can survive the death of the pope-general is with the College of Cardinals electing a new pope, or, as you suggested, making the pope unkillable by hiding him in the corner or off map. Papal elections are hard to explain and result the "Dark Lord" getting the name of a priest, as Withwnar pointed out, and hiding the pope somewhere has the problem that he eventually dies of old age.

  11. #11
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Why Avoid Using papal_states?

    I haven't tested what happens when the pope-general dies when there are cardinals in the College of Cardinals. Presumably, one of the cardinals becomes the new pope and the faction survives although I'm not sure how you would explain such an event in the context of TATW.
    That's pretty much the scenario I described where I only made the faction playable and then killed the pope: I used BG, only changed the faction to playable and clicked start (after setting up the kill script). How to use it in TATW context: the 'gandalf the white' transformation comes to mind. The dude disappears and then comes back all freshly laundered.Why not simply die and do the same? Else have a long list of priest spawns, each with a different name that get used one after the other. Might as well spawn three of them at the same time to fill the preferati slots and have a 'King election'? Combine that with point #4 in my summary and you have a winner. Probably should trademark that idea...

    Incorporating your tree experience it would seem that having a tree will unfailingly terminate the faction once the leader dies - which is not the case without a tree. I am assuming the tree mechanic interferes with the unique succession mechanic of the papal_states special faction setting. It can be assumed the same will happen with slaves.

    If you designate a named character as leader in descr_strat for the faction it stands to reason that when he dies (without family tree) that without cardinals no new faction leader will emerge (see that one turn my faction had no leader). TATW simply spawns a new priest who then goes through the metamorphosis to pope, which should happen in the turn after the spawn provided he gets enough piety assigned or the relevant entry in descr_campaign_db has been modified.

    While there was no pope I got this message when I tried to call a crusade: {SMT_NO_POPE}There is no Pope at present. The Papal seat remains vacant. Otherwise that UI part is blank, no ranking, no call button.

    As the pope is a glorified named character and official faction leader the question should have been: 'can you call a crusade without the pope FL? And the answer is a resounding 'NO'. A priest only comes into play to get him to become pope to make use of the succession mechanic of the papal_states faction. It would need to be tested but I am assuming that spawning a faction leader right after the death of a pope would have the same effect, unless the 'leader' attribute in the spawn line is not accepted. Chances are that you will get a crash when the pope mechanic plays out, after all: 'there can only be one'. But then why go through that hassle if you can simply spawn a priest with enough piety to meet the descr_campaign_db requirement? <min_cardinal_piety uint="5"/>
    Do note that the 'min turn' requirement for crusade calling does not apply to the pope player, he can call a crusade in the very first turn.

    My guess how the metamorphosis works? Send the elected preferati (priest agent) off map and then respawn him as faction leader (named character) for the papal faction inside the capital. The spawn itself is a 'BecomesFactionLeader' event as confirmed by the trait trigger for 'IamPope', hence why I am expecting the crash in the above comment. Should be cool if that works with a normal script, eg send a merchant off map and then spawn as named character (with all accumulated traits and anc intact) - marco polo becoming a general....

    In summary I would say that there isn't really an issue to have the pope player controlled - just some observations:
    1 - it only works without a family tree, which in turn means that
    2 - the game will never end for the player even if he has no settlement or living character
    3 - faction leader succession is dependent on the papal election mechanic, all the pitfalls of getting a crappy leader attribute wise included
    4 - the papal_faction is most likely suitable for a alternative 'playable horde' set up, eg simply don't assign a region\settlement instead of the usual workaround although upkeep will be an issue that needs addressing via script.
    Last edited by Gigantus; December 15, 2020 at 11:41 PM.










  12. #12

    Default Re: Why Avoid Using papal_states?

    Quote Originally Posted by Gigantus View Post
    Else have a long list of priest spawns, each with a different name that get used one after the other. Might as well spawn three of them at the same time to fill the preferati slots and have a 'King election'?
    Since priests with the necessary piety (a.k.a. cardinals) are, as you said, inducted into the College of Cardinals and fast tracked to the papacy if necessary on the very next turn, we could even use the spawn_army trick to give them a unique portrait (Sauron's). The problem is the names - when the cardinal is promoted he retains all his traits, ancillaries, his age, and his portrait but a new name is chosen for him from the papal_faction's male names list. This is a strong candidate for answer to the question why the TATW team set it up the way they did - the papal_faction male names list in TATW only contains The_Dark_Lord.

    Quote Originally Posted by Gigantus View Post
    It would need to be tested but I am assuming that spawning a faction leader right after the death of a pope would have the same effect, unless the 'leader' attribute in the spawn line is not accepted.
    The 'leader' and 'heir' attributes cannot be given in campaign_script, script fails to parse. I'm not sure this would work even if the papal_faction had no other named characters. For most factions, if they have no named characters (probably meaning they're dead and you're emerging them) the first named character you spawn will instantly turn into the faction leader. But I suspect this only works because the succession mechanic is enabled for most factions - it's disabled entirely for the papal_faction because as you've said, it would interfere with the College of Cardinals election mechanic. So TATW probably went with a priest because a named character wouldn't have worked. Why they decided to spawn said priest in the middle of the map where he's clearly visible is a mystery to me...

    Quote Originally Posted by Gigantus View Post
    Do note that the 'min turn' requirement for crusade calling does not apply to the pope player, he can call a crusade in the very first turn.
    I presume you're referring to the crusade_called_start_turn param in descr_campaign_db. Does this param do anything at all? It's set to 20 in vanilla but I can still call crusades on turn 1 (regardless of whether papal_states is playable or not in DS) if my diplomatic relations with the papal_states are high enough (through triggers in descr_faction_standing for building churches and recruiting priests etc.).

    I think the only thing that's necessary for the call crusade option to be available is that there is a pope alive. He doesn't need to be on the map either - sending him off turn 1 in script still allows crusades to be called even though all catholic factions get the pope_died message (the message seems to fire in error). When I try to send the pope off at any other time via script, I get a CTD, but that's probably a peculiarity of how I'm setting it up.

    This raises another question: can we modify the threshold for diplomatic standing with the papal_faction for any faction (including the papal_faction itself) to have their crusade suggestions accepted? I don't see a param for this in descr_campaign_db.

    I've replied to your 4 points (as well as others) below.


    Objections to Playable papal_faction and How to Address Them


    1) The papal_faction only works without a family tree, i.e. when set to 'no'.

    This is not strictly true. You can enable to the family tree for the papal faction but they will die when the faction leader (pope) dies since the normal means of succession are disabled for the papal faction and it takes one turn for the College of Cardinals to elect a new pope.

    2) The papal_faction is immortal.

    This is only true when using 'no' for the family tree. Fortunately, the command 'kill_faction' still works so all that's needed is a bit of scripting. Perhaps it would be fun to let them play as a semi-horde.

    3) The papal_faction leader is chosen using the College of Cardinals instead of the normal succession mechanic - for TATW, this means that when the original Sauron dies he gets replaced by a randomly-named (since the playable faction's name list can't have only one entry) pope.

    The promoted cardinal retains all his traits and ancillaries and you can give him new ones using BecomesFactionLeader and etc. The problem is the fact that the new pope gets a new random name and no label which makes it impossible to send him off the map. So in addition to having a randomly-named pope, he's also vulnerable to being killed on the map which messes up any script to regularly spawn a replacement cardinal when the previous pope reaches his old age range.

    I'd say this is the only major problem with a playable papal_faction as described: if Sauron begins at age 16, old_age is 150, and a 4tpy script is used, that's ~536 turns before it all goes to hell - not nearly long enough for players who play long campaigns (the script-benchmark for which, in our mod, is 999 turns). I would rather simply let the original Sauron die than replace him with a randomly-named cardinal which would be impossible to explain.

    4) The papal_faction can't participate in crusades.

    This is untrue. The faction participates in crusades normally as player and AI.

    5) The papal_faction can't call crusades.

    This is untrue. Crusades can be suggested as long as the pope exists (on or off map) but in order for suggestions to be accepted, the papal_faction must have high enough diplomatic standing with themselves which can be accomplished easily in script. We don't know if it's possible to adjust the diplomatic standing threshold for crusade approval or if there are any other factors involved.

    6) The papal_faction is destroyed if all priests for all catholic factions are killed.

    This is untrue.

    7) Opening the College of Cardinals tab as the papal_faction causes a CTD.

    This is untrue.

    8) Inquisitors owned by the papal_faction will be moved and retired by the AI.

    This can be fixed for labeled inquisitors but probably not for generic inquisitors who spawn randomly (see post #13 below this one).
    Last edited by Callistonian; January 30, 2021 at 03:40 PM.

  13. #13

    Default Re: Why Avoid Using papal_states?

    I think I've implemented Jadli's proposal for the inquisitors into a working solution but I'd appreciate if someone could check my work. If this checkes out, it could be a nice resource for anyone wanting to set up a playable papal_states faction.

    A brief summary of the problem this addresses: The AI moves and retires inquisitors for the papal_faction. Although any faction can have the inquisitor agent type, this pecular AI behavior only happens for the papal_faction. The movement and retirings occur after the player has pressed the end turn button but before the faction's turn has actually ended. This is the same time windows as when you have a multi-turn move and you forget to move the character during your turn so the AI does it for you after you hit the end turn button. It has been suggested that the AI moves the inquisitors towards targets with low piety or into regions with high heresy, although on a map with neither of these things nearby, they tend to move the inquisitors randomly in all directions - queue the Benny Hill music. It has also been suggested in other guides on this topic that the inquisitor's piety stat factors into the AI's decision to retire and this does seem to be correct.

    Solution for papal_faction Inquisitors Moving & Retiring

    The papal_faction is england.

    Code:
    monitor_event ButtonPressed ButtonPressed end_turn
    and I_LocalFaction england
    and not I_IsFactionAIControlled england
        if I_CharacterExists inquistior_1
            console_command give_trait inquisitor_1 InquisitorLock 1
        end_if
    end_monitor
    
    monitor_event FactionTurnEnd FactionType england
    and not IsFactionAIControlled
        if I_CharacterExists inquisitor_1
            console_command remove_trait inquisitor_1 InquisitorLock
        end_if
    end_monitor
    And the trait in question:
    Code:
    Trait InquisitorLock
        Characters all
        Hidden
        Level InquisitorLock
            Description Hidden_desc
            EffectsDescription Hidden_effects_desc
            Threshold 1
            Effect MovementPoints -10
            Effect Piety 10


    In this script, I only care about the case when the papal_faction is human-controlled as I retire the inquisitors myself when they're AI. We only want to add the InquisitorLock trait when the england player presses the end turn button, and not when any other human faction presses end turn in hotseat as this could potentially allow england to start their turn with the trait still present for the inquisitors. And we cannot remove the trait using the inquisitors' CharacterTurnStart event as this leads to some serious bugs for their attribute levels and doesn't lock them in place or prevent the AI from retiring them. So instead we exploit the time window when the AI moves & retires.

    Obviously, this only works for labeled inquisitors who start on the map. Since ButtonPressed doesn't export character ID, I couldn't figure any way to make this work for generic inquistiors the game spawns. I've set the inquisitor params in descr_campaign_db to 0 which seems to be effective in preventing the game from ever spawning random inquisitors, so for my mod, this script is all that's needed to keep my starting inquistiors alive and fully under the player's control. For generic inquisitors, you'd need to find an event which exports character ID and always fires near the end of the player's turn.



    The only problem now remaining for my playable papal_faction is that I want the pope to have a specific name (Sauron) but I don't want crusades to be callable on turn 1. If I don't start with a pope on the map, then crusades won't be callable. But if I ever want them to be callable, I'll have to spawn in a new pope as a cardinal which means a random name since my playable faction needs more than one name on its male names list.
    Last edited by Callistonian; December 16, 2020 at 10:24 PM.

  14. #14
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Why Avoid Using papal_states?

    Playable papal_faction does work with a family_tree so long as there are cardinals in the College of Cardinals ready to go when the current pope dies - otherwise the faction will be destroyed.
    This runs contrary to my test with a teutonic tree that I described earlier. I used the vanilla set up of my BG installation which has a full compliment of cardinals. Have you confirmed that a regular tree works, eg how does the succession work if it doesn't crash? Normal pope spawn and the tree disappears? Keep in mind that the pope will only appear in the following turn, eg normally there will be no FL (no FH anyhow) for the rest of the turn and that's game over normally if a tree is enabled.


    I would rather simply let the original Sauron die than replace him with a randomly-named cardinal which would be impossible to explain.
    In TATW both pope\priest spawns use the same full name, not random. Only possible if the character name doesn't exist. Simply spawning in a hidden spot would avoid a brief disappearance after his death until the start of the new turn. Right now it's like 'if you blink you miss it'. Even if you used the random name principle you will still end up with the same name as there is only one name for that faction.
    Code:
    ; ---- initial spawn ---
    monitor_event PreFactionTurnStart FactionType papal_states
        and I_TurnNumber >= 46
        and RandomPercent <= 8
        spawn_character papal_states, The_Dark_Lord, priest, age 18, x 397, y 339
        console_command give_trait The_Dark_Lord NaturalPriestSkill 2
        console_command give_trait The_Dark_Lord StrongFaith 4
        console_command give_trait The_Dark_Lord PriestLevel 2
        set_counter go_pope 1
    terminate_monitor
    end_monitor
    
    ; --- refresher spawn ---
    monitor_event PreFactionTurnStart FactionType papal_states
        and I_CompareCounter go_pope > 0
        and not I_CharacterExists The_Dark_Lord
        spawn_character papal_states, The_Dark_Lord, priest, age 18, x 397, y 339
        console_command give_trait The_Dark_Lord NaturalPriestSkill 2
        console_command give_trait The_Dark_Lord StrongFaith 4
        console_command give_trait The_Dark_Lord PriestLevel 2
    end_monitor
    For a regular faction set up there is however a chance, however small, that the refresher spawn may fail due to possible duplicate names at a later stage. The only way to avoid that would be to use withwnar's unique names mechanic. It involves a unused\script faction which your mod will not have if it uses the full compliment of factions.
    That leaves the name linked issue of needing a pope at the start of the game as you seem to have determined. Seeing that TATW has no 'pope' at the start (the character entry is commented out in descr_start) that criteria seems only to hold true if you wish to call a crusade in the very first turn. Which means technically there is no issue to use the unique names spawn in the very first turn to have a pope in the next turn. But might provide a different issue if you have named characters in your faction. Maybe have a preset FL (game will automatically appoint the first named character if there is no appointed one) that you kill at turn start, assuming that there will be no normal succession?

    Inquisitors owned by the papal_faction will be moved and retired by the AI.
    Don't know about the control but if so would possibly explain why I failed to make inquisitors recruitable agent style, any luck yourself? The AI parameters for it can be disabled in descr_campaign_db (disabling inquisitor spawn is not an issue), but it didn't help either, regardless if unchanged or set to zero.
    Last edited by Gigantus; December 17, 2020 at 12:24 AM.










  15. #15

    Default Re: Why Avoid Using papal_states?

    Quote Originally Posted by Gigantus View Post
    This runs contrary to my test with a teutonic tree that I described earlier. I used the vanilla set up of my BG installation which has a full compliment of cardinals. Have you confirmed that a regular tree works, eg how does the succession work if it doesn't crash? Normal pope spawn and the tree disappears? Keep in mind that the pope will only appear in the following turn, eg normally there will be no FL (no FH anyhow) for the rest of the turn and that's game over normally if a tree is enabled.
    You are correct. The new pope doesn't get elected fast enough and even if he did I doubt he would be added to the tree and hence wouldn't be able to keep the faction alive as 'yes' or 'teutonic'. Indeed, playable papal_faction really only works with 'no'.

    Quote Originally Posted by Gigantus View Post
    In TATW both pope\priest spawns use the same full name, not random. Only possible if the character name doesn't exist. Simply spawning in a hidden spot would avoid a brief disappearance after his death until the start of the new turn. Right now it's like 'if you blink you miss it'. Even if you used the random name principle you will still end up with the same name as there is only one name for that faction.
    When a cardinal is elected pope, he gets a new name randomly selected from the male names list of the papal_faction. So the system you're describing here only works because papal_states in TATW has only one name on their list: The_Dark_Lord. Obviously, we can't have a male name list with only one entry for a playable faction, so the first pope's replacement will get a random name.

    Quote Originally Posted by Gigantus View Post
    For a regular faction set up there is however a chance, however small, that the refresher spawn may fail due to possible duplicate names at a later stage. The only way to avoid that would be to use withwnar's unique names mechanic. It involves a unused\script faction which your mod will not have if it uses the full compliment of factions.
    Our mod does leverage a dummy faction for this purpose (and many others) but I've never gotten the unique name trick to work for agents. I can get uniquely named named characters using Withwnar's trick (with the dummy faction), and I can get unique portrait agents using your trick (spawn_army for an agent, although they die when the campaign is reloaded for lack of bodyguard unit), but I've never succeeded in combining the two tricks to get a uniquely named agent. If you have succeeded in this, please post your script.

    Quote Originally Posted by Gigantus View Post
    Maybe have a preset FL (game will automatically appoint the first named character if there is no appointed one) that you kill at turn start, assuming that there will be no normal succession?
    Crusades are indeed disabled if there is no living pope-general (call button greyed out), but the problem is respawning a new pope with the correct name when you eventually want crusades to be enabled. As you said, we would need to ensure the priest has a unique name with a working script to spawn a uniquely named priest. And even with that, there would still be the problem of the name being randomized when the priest is converted into the pope-general.

    Quote Originally Posted by Gigantus View Post
    Don't know about the control but if so would possibly explain why I failed to make inquisitors recruitable agent style, any luck yourself?
    I doubt that the special AI scripts moving & retiring inquisitors for the papal_faction have anything to do with the "recruitability" of inquisitor agents. I haven't tried making inquisitors recruitable, but I do know it's impossible to make some agent types recruitable such as the heretic and the witch (have tested these myself) so it wouldn't surprise me if this also applies to inquisitors.

    Quote Originally Posted by Gigantus View Post
    The AI parameters for it can be disabled in descr_campaign_db (disabling inquisitor spawn is not an issue), but it didn't help either, regardless if unchanged or set to zero.
    Are you saying you found parameters in descr_campaign_db that prevent the AI from moving & retiring inquisitors for the papal_faction? If so, please share which parameters.

    The parameters I used to disable random inquisitor spawns are:

    Code:
    <max_inquisitors_per_region uint="0"/>
    <max_inquisitors uint="0"/>
    <inquisitor_creation_modifier float="0.0"/>
    <inquisitor_turn_start uint="999"/>
    I'm guessing the 'creation_modifier' is mostly responsible for preventing the random spawns. All of these params are non-zero and turn_start set to 20 in TATW; I believe this is responsible for a well-known bug where inquisitors randomly spawn on the map.

  16. #16
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Why Avoid Using papal_states?

    pope random name - I would need to run a few tests myself to see if it is indeed random
    special name agent - same here, needs testing to see what's going on
    inquisitor's parameters - I was referring only to those 4 spawn parameters, I am not aware of any other settings

    I am just wondering if a named character spawned with the 'family' attribute won't automatically become FL (even with no tree) if he gets spawned right after the pope is dead and before the next turn, my theory being that you need an FL to call the crusade - all the 'pope' stuff is simple level trait stuff. And we haven't really tried what would happen when the new pope spawns with this FL present. I think you could test for a 'lack of leadership' by testing for a specific leader trait, just a question when you test and a live character. Some doodle to that end, requires initial 'pope' to have that PopeCheck trait:
    Code:
    monitor_event CharacterTurnEnd FactionType papal_states
         and FactionLeaderTrait PopeCheck < 1
         use special name spawn for a named character with 'family' attribute and PopeCheck trait
    end_monitor
    Here the mongol spawn line that I had in mind: character Jebe, named character, age 30, x 292, y 166, family


    Edit:
    - special agent name doesn't work - on his own he stays his original faction. Doing the 'give_everything' together with a named character he dies (named character goes to new faction)
    - pope name is indeed random
    - 'family' does not make the named character faction leader (needs tree enabled?)

    Some weird news - the faction will still work even without a settlement (that's not weird) and if you kill the FL then and spawn a 'family' named character then that guy becomes the pope (this is). Doesn't work if the faction owns a settlement. However the 'family' attribute isn't the trigger, spawning a regular named character will do the same thing.
    I have to assume that 'family' only works if a tree is enabled.
    Other weird news: I started off the faction with only a general who then promptly got elected to pope at game start, goes straight to a otherwise blank 'a new pope has been elected' message and then the 'ceremony inside cathedral' movie.
    Last edited by Gigantus; December 17, 2020 at 01:14 PM.










  17. #17

    Default Re: Why Avoid Using papal_states?

    I'm getting closer to a solution. I tried using your trick for spawning agents using spawn_army so that the priest would have the correct portrait.

    Here's the script:
    Code:
    set_event_counter pope_should_exist 0    ;pope starts dead, crusades not available on turn 1
    
    monitor_event [whatever conditions you like]
    ...
    and I_EventCounter pope_should_exist == 0
        set_event_counter pope_should_exist 1    ;time to start calling crusades
        inc_event_counter respawn_pope 1    ;call
    end_monitor
    
    monitor_event GameReloaded
        if I_EventCounter pope_should_exist == 1
            inc_event_counter respawn_pope 1    ;call
        end_if
    end_monitor
    
    monitor_event EventCounter EventCounterType respawn_pope    ;function
    and EventCounter > 0
        spawn_army
            faction england    ;papal_faction
            character PopeName, priest, age 16, x 100, y 100, portrait PopePortrait
            traits PopeRespawnTrait 1
            unit    whatever_unit_type    exp 0 armour 0 weapon_lvl 0
        end
    end_monitor
    The trait:
    Code:
    Trait PopeRespawnTrait
        Characters all
        Hidden
        Level PopeRespawnTrait
            Description Hidden_desc
            EffectsDescription Hidden_desc
            Threshold 1
            Effect Piety 10    ;ensures election to papacy, no other priest traits/ancillaries in the mod can reach this level
            Effect Level 1    ;invisible strat model
            Effect MovementPoints -500    ;locked in place on inaccessible terrain
    When I spawn the priest using spawn_army, he immediately turns into the pope and enables crusades. He doesn't transform into a general at the papal_faction capital - he remains a priest and hence retains the name he spawned with. I can only account for this by assuming that the game is considering him a general already, because spawn_army was used, and hence there is no need to change his name. What a happy result - his name and portrait are working now! Of course, he dies when the game is reloaded just like any other agent spawned using spawn_army - he has no bodyguard unit so the game kills him. Hence, in the script I respawn him with the same name and portrait every time the game is reloaded.

    Everything works well but there are two problems:

    1) I don't like having the priest visible on the map at any time. The player can still select him normally and see him in the lists scroll (he shows up under Agents instead of Military Forces).

    2) Every time the pope dies and gets respawned, hard coded event messages pop up. I can change the image and text for these messages, but it's still very annoying.

    To address these issues, I tried labelling the priest and sending him off the map after he becomes pope (which is instantaneous), but this results in a CTD.

  18. #18

    Default Re: Why Avoid Using papal_states?

    Just saw your edit.

    Quote Originally Posted by Gigantus View Post
    - 'family' does not make the named character faction leader (needs tree enabled?)
    The only way to spawn a faction leader (or heir) is if the faction in question has no other named characters (on or off the map). In this case, the 'family' tag is not needed even if the faction formerly had a family tree - the character will become a member of the family tree (occupying the next spot on the line of succession) and the leader by default.

    Quote Originally Posted by Gigantus View Post
    if you kill the FL then and spawn a 'family' named character then that guy becomes the pope (this is). Doesn't work if the faction owns a settlement. [...] Other weird news: I started off the faction with only a general who then promptly got elected to pope at game start, goes straight to a otherwise blank 'a new pope has been elected' message and then the 'ceremony inside cathedral' movie.
    It sounds like you're describing the same thing in both cases. If the faction only has one named character on the map, then this character becomes the faction leader and hence the pope. It's surprising that this still works given that the normal succession mechanic seems to be disabled for the papal_faction, but it does conform to how it works for any other faction.

    Unfortunately, it sounds like this only works if the character is the only named character for the papal_faction, which isn't super useful for a playable faction that has to have a bunch of generals and governors on the map from turn 1.

  19. #19
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Why Avoid Using papal_states?

    I got a bit tired in the end. The case where the spawned character became the pope was when the faction had no settlements (gave rome to the aztecs). It did not work when the faction owned a settlement (rome). At that point no other named character existed, which means I would need to test the 'no city' set up with one in place.
    I would also need to test the 'family' spawn with a regular tree, my thought being that with a FL in place the pope election would not take place in the following turn. Not hopeful, though, looking at the crash sequence with a tree in place.
    General turning pope - this was not a named character, it was a bona fide general (as per descr_strat definition) also referred to as 'captain'. No other named characters were present at game start. Which means it doesn't matter what you do at game start, you will end up with a pope.










  20. #20

    Default Re: Why Avoid Using papal_states?

    Quote Originally Posted by Gigantus View Post
    General turning pope - this was not a named character, it was a bona fide general (as per descr_strat definition) also referred to as 'captain'. No other named characters were present at game start. Which means it doesn't matter what you do at game start, you will end up with a pope.
    Woah. You turned a captain into the pope? O.o

    You said the papal_faction had nothing but the general (captain) when this happened, does this mean the faction had no settlements either? If so, that would be consistent with your finding that the game turns a named character into the pope only when the papal_faction has no settlements. In TATW, the papal_faction starts with two inquisitors with piety stats, but the faction also owns one settlement and, perhaps as a result, the inquisitors don't become pope. I feel the rule you're arriving at is: if the papal_faction has no settlements, they will turn anything with a name into the pope, whether this is a captain, a named character, or any agent type.

    But I tested this by using surrender_regions on a papal_faction and the pope remained dead - none of the many named characters, captains, or agents were elected pope. So the rule for who the game picks to be pope is more complicated than this. Perhaps the game only picks anyone with a name if the papal_faction has no settlements at the start of turn 1?

    Since this doesn't seem to work after surrender_regions, I'm not too concerned about the game picking a random captain or some such later in the campaign when the papal_faction loses all their regions (assuming we don't script-kill the faction when this happens). I still need a way to spawn a new pope when I want crusades to become available and this will presumably happen at a point in the campaign when the papal_faction owns settlements and named characters. The ability to turn a named character directly into the pope (thus preserving his name and portrait) would be great, but it's not viable if it requires that the papal_faction owns nothing else on the map.


    I'm currently trying to address the pope_dies, carindal_promoted, etc. events which shows messages with some regularity with the spawn_army script. Removing the events in descr_event_images predictably results in a CTD.

    Another problem I've run into is that the papal_faction sees a high number of revolts when the pope is dead due to the fact that the pope is the faction leader and the leader's authority stat is apparently the only thing that prevents revolts. This can be addressed by setting the max change of revolts close to 0 in descr_campaign_db, but this applies to all factions.

Page 1 of 4 1234 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
  •