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).
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.Originally Posted by Papal States guideIf 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.
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?Originally Posted by Papal States guideThe 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.
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:
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).Code:monitor_event PreFactionTurnStart FactionType england set_faction_standing england england 1.0 end_monitor
- 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:
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).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
- 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:
And the trait in question: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 here is my original note:Code:Trait InquisitorLock Characters all Hidden Level InquisitorLock Description Hidden_desc EffectsDescription Hidden_effects_desc Threshold 1 Effect MovementPoints -10 Effect Piety 10
- Spawning New PopesOriginally Posted by CallistonianIn 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.
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:
Remember that this is only needed for spawn_army - recruiting, adopting, converting, etc. any other character will not turn them into the pope.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
- 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):
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.Code:{EMT_ENGLAND_FACTION_LEADER_NAME}Pope %S
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.