Currently, the script works like this: you press F5 then select either a family member or a priest. You get a yes/no event asking you if you want to appoint the person Antipope. You say yes, and they get the "Antipope Appointed" trait. If you make a mistake, or decide you don't want an Antipope, you can retract the appointment that turn with no ill effects (retract is the same as appoint, F5, then select person you appointed).
We then get to three continuums: the Reject Continuum (the likelihood they reject), the Bad Continuum (the likelihood they are a bad Antipope), and the Bad Reject Continuum (the likelihood they reject and are offended by your proposal). In all these cases we assume the "good" thing (that is, that they accept, they are a good antipope, and they reject well). If the continuum comes out negative, we then remove the positive trait and give the negative trait.
So first we have the Reject Continuum to see whether or not they accept. There's a probably overly complicated series of triggers for this (included in the excel files). We look at things like their loyalty, the kings's authority and chivalry, the quality of the Pope, and a couple of relevant traits (like if they're unorthodox or orthodox, if they hate the papacy, if they're corrupt…). For this, priests now get one of four traits: Very Loyal, Loyal, Unclear Loyalties, and Disloyal (more or less randomly). For the Pope, we have a series of traits that show up on the Pope tab to show if he is Very Chivalrous, or Nefarious, or Weak, or Impious…
Piety can go one of two ways. If the person is pious, then they tend to accept if the king's piety is high and the pope is corrupt and everything bad. If the person is impious, then they tend to accept if the king's piety is low.
So they either accept or reject. If they accept, they get the Antipope Accepted trait, and we go to the Bad Continuum, seeing whether or not they are a good Antipope (good in the sense of getting the support of the people). We look at things like the Antipope's piety, the King's authority, piety, and chivalry, and the quality of the sitting Pope. Appointing an Antipope while there is no Pope makes it more likely for the Antipope to be accepted by the people. Thus, depending on what the Continuum spits out, the Antipope get either the Good Antipope or Bad Antipope Trait. The king then gets a trait, either Bolstered by the Antipope, or Encumbered by the Antipope. Also the Pope gets angry at you (what would be great is if the Pope excommunicated you - I could not get a mission with the "gift" being excommunication to work, though).
However, the Good vs Bad distinction should be revisited. What I realize now is that it is too clear from the outset if the Antipope is Bad, which gets rid of the potential downsides of having an Antipope. We want the king not to realize that people won't accept the Antipope before he actually sends out the Antipope. It is too easy to get rid of bad Antipopes. The Antipope should not be objectively Good or Bad, but the trait should depend on what region he is in.
So what I would change would be to have the Reject Continuum re-run whenever the Antipope goes to a new region (testing for TimeInRegion < 2). Whenever the Antipope moves to a different region, he can be either accepted or rejected. After enough times of being Good or Bad (say 5), the trait becomes permanent and we stick the King with Bolstered or Encumbered trait.
The law bonuses or penalties come from the new building, the Papal Curia. It is unbuildable and undestroyable, and follows the Antipope wherever he goes. If the Antipope is good, we get +6 law; if he's bad, we get -6. One thing I could not quite get to work was the negative bonus - it capped at 10%. What I finally ended up going for was a add_settlement_turmoil script. I added a Turmoil 1 and a Turmoil 2 trait to trigger this (the 1 vs 2 being how serious the turmoil is). This has the bonus of being able to be used for Civil Wars (more on that later). However, I do not have a trigger giving the Antipope one of these traits. This would be easily solved by having one trigger give Turmoil 1 70% of the time, and then the next trigger (with condition and Trait Turmoil < 1) giving it 100% of the time (AKA 100% of the remaining 30% of the time).
Ideally, what would also happen when you get an Antipope is your family and priests would get either a SupportsTheAntipope or SupportsThePope trait, depending on their loyalty. This is not implemented currently.
So that is all if they accept. If they reject, they get the Antipope Rejected trait, and then we get the Bad Reject Continuum, seeing if they are offended by your blasphemy or not. We look at their piety and loyalty, and the king's authority. So they either get the AntipopeRejectedGood trait, which has no effects, or the AntipopeRejectedBad trait, which decreases loyalty but increases piety. What should then happen is that they get the Turmoil trait, triggering some turmoil in the region their in (I forgot to do this). Additionally, if a priest gets the BadRejected trait, their loyalty should drop (does not do that currently, since it only affects the loyalty rings - would be easy enough to change their trait, though).
Going back to if they accept, if you got a Good Antipope you're happy. But what happens if you get a Bad Antipope or (god forbid) you reconcile with the canonical Pope? Well, since you appointed the Antipope, you can also depose him as well. Nearly always the Antipope will accept being deposed. However, for the sake of realism, we get to a fourth continuum, the Bad Depose Continuum. This sees if they refuse to resign and believe more than ever that they're the true Pope. This is really only triggered if they are really unorthodox or think God is talking to them directly. If they refuse and are a priest, they will probably become heretic.
So they either get the GoodDeposed Trait, with no effects, or the BadDeposed Trait, with very very negative effects. Again, BadDeposed people should get a Turmoil trait and priests need to have their loyalty trait changed.
Once your Antipope dies or is deposed, you're free to appoint a new Antipope if you want. If you depose too many in too short a span of time, though, you get the AntipopeKingTooMany trait, which depicts that the king seems to think that the papal title means absolutely nothing.
So in my mind, the things to be changed would be these:
Make the Good vs. Bad Antipope not so immediately obvious and different for different regions.
Have the Pope excommunicate you when you appoint an Antipope.
Fix the negative law bonuses of the Curia building OR give the Bad Antipope the Turmoil trait.
If the person rejected once before, have them more likely to reject again.
If they accept, there should be a global Antipope Announcement (with the image included).
If you get a Bad Antipope, possibility of the king getting the OffendsTheNobility trait.
If the person got the GoodReject, and then you appoint an Antipope, have a possibility of them getting the BadReject (you lied to them, after all).
Give people who get the BadReject trait the Turmoil trait and decrease loyalty among priests.
Give people who get the BadDepose trait the Turmoil trait and decrease loyalty among priests.