The code looks like it should work (at least at first glance; there could be some minor typo that I miss), provided everything else is correct and you replace the obvious religion checks. The main reasons I could think of for why it possibly doesn't work is that you either have a contradictory condition somewhere (for example, having something that prohibits Christian-on-Christian crusades until a certain flag is set and then not setting that flag), that you don't plug it in everywhere you need it (for example, if you leave out the is_valid part your crusades would invalidate if you targeted a Messalian as a Catholic and vice versa), or that you are missing some condition for being able to use the CB (for example, only rel heads can call crusades (at least in vanilla; HIP might have done something about that condition that I'm unaware of), so if you aren't one you can't use the CB).
You've just summed up the problem, really. There are a variety of conditions in the CB that call back to events and flags that I'm not certain of the triggers for (plus several that are simply regular religion-based restrictions), and I'm not quite sure how to interact with any of them. As I said, I'm not the best at this. Honestly I barely even know what I'm looking at.
Not to spam, but I'm going to put up the valid parts of the CB that I think could be mucking something up. Maybe you'll see something I don't:
Code:
can_use = {
emf_cb_can_use_trigger = yes
ROOT = {
can_call_crusade = yes
any_demesne_title = { is_titular = no }
}
FROM = {
OR = {
NOT = { religion_group = ROOT }
is_heresy_of = ROOT
is_parent_religion = ROOT
AND = {
religion_group = pagan_group
NOT = { religion = ROOT }
}
AND = {
ROOT = { religion = paulician }
NOT = { religion = ROOT }
}
AND = {
ROOT = { religion = kharijite }
NOT = { religion = ROOT }
}
}
}
NOT = { # Not if the Schism has been mended
AND = {
OR = {
religion = catholic
religion = fraticelli
}
has_global_flag = schism_mended
NOT = { has_global_flag = cath_schism_mended }
NOT = { has_character_flag = reclaim_heresy_crusade }
}
}
Code:
can_use_title = {
emf_cb_can_use_de_jure_title_trigger = yes
FROM = {
any_realm_title = { de_jure_liege_or_above = PREVPREV }
independent = yes # Don't declare Crusades on revolters - chances are high the war will invalidate
OR = {
num_of_realm_counties = { value = 6 title = PREV }
ROOT = { has_character_flag = reclaim_heresy_crusade }
}
}
# Restrictions on crusade targets for AI religion heads
OR = {
# Religion head is a player
ROOT = { ai = no }
# This is a special chain
ROOT = { has_character_flag = reclaim_heresy_crusade }
# The target owns a holy site within that kingdom title
FROM = {
any_realm_title = {
de_jure_liege_or_above = PREVPREV
is_holy_site = ROOT
}
}
# The target owns a province of the religion within that kingdom title
FROM = {
any_realm_title = {
tier = COUNT
de_jure_liege_or_above = PREVPREV
location = { religion = ROOT }
}
}
# A ruler of the religion either owns a province in that kingdom or is neighboring
any_direct_de_jure_vassal_title = {
any_direct_de_jure_vassal_title = {
location = {
OR = {
owner = { religion = ROOT }
any_neighbor_province = { owner = { religion = ROOT } }
}
}
}
}
}
Code:
is_valid = {
ROOT = { can_call_crusade = yes }
FROM = {
OR = {
NOT = { religion_group = ROOT }
is_heresy_of = ROOT
is_parent_religion = ROOT
AND = {
religion_group = pagan_group
NOT = { religion = ROOT }
}
AND = {
ROOT = { religion = paulician }
NOT = { religion = ROOT }
}
AND = {
ROOT = { religion = kharijite }
NOT = { religion = ROOT }
}
}
}
}
Hopefully you'll see what could be causing the problem and you can tell me what I need to do to get everything playing together nicely.
Something that could be helpful both here and with the holy war CB that had some oddities is checking the CBs with the Validator (
http://forum.paradoxplaza.com/forum...tor-Find-errors-quickly-and-with-minimal-pain!) to see if it finds any issues with those CBs.
I'll take a look at it and see if the Validator finds anything, but I honestly doubt that's the issue. The code I posted previously functions properly in the Holy War CB and I made sure my brackets were right when I tested it in the Crusade CB, so I think it's rather safe to say there's either a conflict in the CB itself or I perhaps placed the code in the wrong portion of the CB.
EDIT: Yep, Validator came up clean of any issues my changes would have caused to the CB. There's either some sort of conflict or my test simply isn't triggering the Crusades as it should. I'll try testing again to make sure the latter isn't the problem, although that's another possibility I seriously doubt.