Quick question: Will top_liege scope to yourself if you are independent?
Unless I misremember, that is the case.
Hello! I'm currently looking for a solution to the Africa-gets-eaten-by-Christians problem. My idea is to "cheat" and give muslims some extra troops when defending in holy wars / crusades. I want to use a simplified version of the event that spawns loyalists in case of rebellion. Of course, this would mean that Christians around the Mediterranean would still pointlessly try to invade Africa, but the results may not be as ugly. I follow with code and qestions:
Code:
# Help North Africa survive the onslaught of Christians
character_event = {
id = 815438 #just some random numbers
desc = "The Tribes come to defend against the infidels!"
picture = "GFX_evt_battle"
#border = "GFX_event_normal_frame_war"
is_triggered_only = yes
trigger = {
war = yes #unnecessary?
religion_group = muslim
is_primary_war_defender = yes
OR = {
culture_group = arabic
#culture_group = iranian
culture_group = east_african
culture_group = west_african
}
OR = {
any_war = { using_cb = crusade }
any_war = { using_cb = holy_war }
}
capital_scope = {
religion_group = muslim
OR = {
culture_group = arabic
#culture_group = iranian
culture_group = east_african
culture_group = west_african
}
#The capital must be within the arab empire.
}
NOT = { realm_size = 100 }
realm_character_percent = { #this may break the event's intention on some occasions
target = 0.5
religion_group = muslim
}
}
weight_multiplier = {
days = 10
modifier = {
factor = 2
NOT = { prestige = 100 }
}
modifier = {
factor = 2
NOT = { piety = 100 }
}
modifier = {
factor = 1.25
realm_size = 25
}
modifier = {
factor = 1.25
realm_size = 50
}
modifier = {
factor = 1.25
realm_size = 75
}
}
option = {
name = "EXCELLENT"
capital_scope = {
tooltip = {
ROOT = {
spawn_unit = {
province = PREV
owner = ROOT
match_character = FROM
match_mult = 0.05
attrition = 1.0
}
spawn_unit = {
province = PREV
owner = ROOT
match_character = FROM
match_mult = 0.05
attrition = 1.0
}
spawn_unit = {
province = PREV
owner = ROOT
match_character = FROM
match_mult = 0.05
attrition = 1.0
}
}
}
option = {
name = "EXCELLENT"
capital_scope = {
tooltip = {
ROOT = {
spawn_unit = {
province = PREV
owner = ROOT
match_character = FROM #What?
match_mult = 0.05 #What?
attrition = 1.0
}
spawn_unit = {
province = PREV
owner = ROOT
match_character = FROM
match_mult = 0.05
attrition = 1.0
}
spawn_unit = {
province = PREV
owner = ROOT
match_character = FROM
match_mult = 0.05
attrition = 1.0
}
}
}
}
}
}
So, first of all, how broken is it and will the code even work as I hope it would?
What is the border gfx for?
If I read it correctly, the event grants 3x5% of the max levy strength, right?
How do I make it a requirement that the capital is within the de jure Arab Empire?
Thanks in adavance. Maybe this will help you too.
You should cut one of the "option" blocks and check your brackets (currently, that event isn't closed correctly), but it should
function if you do that, provided you trigger it on_war_started. However, there are a few potential issues I can think of:
- As written, the event troops do not disband on peace. I would suggest you add an earmark to keep track of them and fire an event on_war_ended_victory/_defeat_whitepeace_invalid that disbands them if you no longer are at war (or no longer are defending, if you want to prevent the exploit of declaring expansionist wars with those troops just before signing the peace; the AI would never use this, but a player could easily use it).
- As written, the event can fire every time you end up defending in a war, which could lead to a lot of event troops rather quickly. You could check if there are any earmarked regiments with your earmark and not fire the event again if that is the case if it is something you want to prevent.
- You should add a match_min and match_max block to the spawn unit commands to ensure that you get a reasonable number of men. If you don't, if a realm with 100k was to attack you you'd get 15k men and if a realm with 1k men attacks you'd get 150 men, which is a fairly large range.
- This is a matter of personal taste, but I'd match ROOT and not FROM for three reasons. The first is that doing that means that a small realm cannot pull a small doomstack out of thin air if it matches itself (which could be rather silly if you e.g. have the HRE vs. a random count). The second is that it would copy the troop types
you have and not some random guy that might have a different troop composition (which e.g. could give you war elephants if some Indian guy somehow attacked you despite them not normally being available to you, or that you'd get lots of HC if a holy order was involved even though random HC being found in North Africa might be a stretch). The third is that if you get attacked by some random nobody with a strong ally a match vs. FROM is likely to be worse than a match of ROOT.
- Your weight modifier seems rather pointless, given that even at its maximum value you'd end up at 78 days, meaning the event likely fires every war as they tend to last longer than that. I'd just cut it entirely.
- As written (with the e_arabia check you plan to add), the event would fire if e.g. Abyssinia was to attack Egypt or the ERE tries to go into the Middle East. At least the former seems unintended, so you probably want to check that the attacker has their capital in Europe (which still would let someone cheese it by moving the capital to Africa, but at least the AI wouldn't do that unless their primary title was in Africa). Also, rather than checking for e_arabia (which can de jure drift stuff unless you disable de jure drift), I would check for a region (I believe it is world_africa_north you want to use) by using capital_scope = { region = world_africa_north }. You might further want to exclude c_marrakech from the check, if you think that random guys coming to help on an island is weird.
- The event currently doesn't check the attacker's religion, which means that Muslim-on-Muslim wars would trigger the event (and, without a check for where the attacker is based, that would still happen if both are in Africa). You probably should check the attacker scope for the holy war/crusade.
- As written, the event does
not check that you are
defending in a holy war/crusade, only that you are
involved in one. This means that the event would fire if you were attacking someone using such a CB and got a random peasant revolt at home.
- Don't use a random event id. Set up a proper namespace to ensure that you don't get a conflict.
Now, for the rest of the questions:
- The border gfx just adds a frame to the event window. I'd use the one you have commented out, but you could use some other frame if you want to.
- The event grants 3x5 % of the primary attacker's
current standing forces. That means that raised mercs, holy orders, retinues, and event troops all would be included, but not levies regenerating later, mercs hired the next day, etc.
- If you want to check for the Arabian Empire, use any_realm_province = { de_jure_liege_or_above = e_arabia }. However, as mentioned, this could end up being a terrible condition if there is de jure drift.