• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

grisamentum

Field Marshal
93 Badges
Feb 29, 2012
6.530
1.202
  • Humble Paradox Bundle
  • Crusader Kings II: Sunset Invasion
I've been experimenting with making a few CBs of my own and had a little limited success but I've realized I don't really understand what some of the conditionals and triggers do.

Could someone explain, or direct me to where I can find out, what is the difference between:

can_use
can_use_title
is_valid
is_valid_title

Like, for example, the coastal_republic attack cb:

Code:
	can_use = {
		ROOT = {
			is_republic = yes
			capital_scope = {
				port = yes
			}
		}
	}

	can_use_title = {
		tier = COUNT
		location = {
			port = yes
		}
	}

	is_valid = {
		ROOT = {
			is_republic = yes
			capital_scope = {
				port = yes
			}
		}
	}

	is_valid_title = {
		tier = COUNT
		location = {
			port = yes
		}
	}

Seems very redundant. For example, it seems to me that it's saying:

can_use: Can be used by - republics, with their capital in a coastal county.
can_use_title: you have to have at least a county title from a coastal county? or that's what it targets?
is_valid: ?? The same as can_use? What's the difference here?
is_valid_title: Again, the same as can_use_title? What's the difference?

In both can_use and is_valid, it's talking about ROOT, which is the declarant of the war. So I'm not getting the difference there. Any help?
 

grisamentum

Field Marshal
93 Badges
Feb 29, 2012
6.530
1.202
  • Humble Paradox Bundle
  • Crusader Kings II: Sunset Invasion
More specific question:

Why does this CB work against, say, the King of France, but not the HRE? (Take the 15/9/1066 start date; pick Hungary because it has Papal Investiture).

Code:
investiture_crisis = {
	name = CB_NAME_INVESTITURE_CRISIS
	war_name = WAR_NAME_INVESTITURE_CRISIS
	sprite = 9
	truce_days = 3650
	can_call_vassals = yes
	can_call_allies = yes
	can_ask_to_join_war = no
	is_permanent = yes

	can_use = {
		ROOT = {
			any_demesne_title = {
				OR = {
					tier = KING
					tier = EMPEROR
				}
        			has_law = investiture_law_0
    		}
		}
		FROM = {
			any_demesne_title = {
				OR = {
					tier = KING
					tier = EMPEROR
				}
				has_law = investiture_law_1
    		}
		}
	}
	
	is_valid_title = {
		FROM = {
			any_realm_title = {
				has_law = investiture_law_1	
			}
		}
	}

	on_success = {
		ROOT = {
			piety = 100
		}
		any_attacker = {
			limit = { character = ROOT }
			participation_scaled_piety = 200
		}
		any_attacker = {
			limit = { NOT = { character = ROOT } }
			hidden_tooltip = { participation_scaled_prestige = 200 }
		}
		FROM = {
			prestige = -200
		}
	}
	
	on_success_title = {
		FROM = {
			any_demesne_title = {
				limit = { OR = { tier = king tier = emperor } }
				add_law = investiture_law_0
			}
		}
	}

	on_fail = {
		FROM = {
			prestige = 100
		}
		any_defender = {
			limit = { character = FROM }
			participation_scaled_prestige = 100
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = { participation_scaled_prestige = 100 }
		}
		ROOT = {
			prestige = -200
		}
	}

	on_reverse_demand = {
		ROOT = {
			prestige = -200
		}
		FROM = {
			prestige = 200
		}
		any_defender = {
			limit = { character = FROM }
			participation_scaled_prestige = 200
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = { participation_scaled_prestige = 200 }
		}
	}

	attacker_ai_victory_worth = {
		factor = 200
	}
	
	attacker_ai_defeat_worth = {
		factor = 100
	}

	defender_ai_victory_worth = {
		factor = -1 # always accept
	}
	
	defender_ai_defeat_worth = {
		factor = 100
	}
}

As you can see, as Hungary, it'll correct be available against France (has free investiture) but won't work against the HRE (also has free investiture).

Why? Is the HRE not an "any_realm_title"?
 
Last edited:

Fawr

Field Marshal
79 Badges
Jan 22, 2003
3.165
1.598
  • Europa Universalis IV: Common Sense
  • Semper Fi
  • Sengoku
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Magicka 2
  • Europa Universalis IV: Res Publica
  • Crusader Kings II: Horse Lords
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Leviathans Story Pack
  • Europa Universalis 4: Emperor
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Cities in Motion
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Magicka
  • Majesty 2
Could someone explain, or direct me to where I can find out, what is the difference between:
can_use
can_use_title
is_valid
is_valid_title

is_valid is talking about the person who can use that CB (the doge of venice for example has to be the head of a republic, and their captial has to be a port).

is_valid_title is talking about the county which you are fighting about (so you can declare war targeting the title of count of Barcelona but not targeting the title of count of Paris, and not King of France, duchy of Brittany or the HRE).

I assume can_use and can_use_title work the same sort of way.