• 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.

unmerged(589171)

Corporal
1 Badges
Nov 6, 2012
36
0
  • Crusader Kings II
I've scoured the internet for a scripting guide for CK2 and couldn't find one, nor could I find a forum nor subforum for asking questions - so sorry if this is in the wrong place.

I want to create a Casus Beli that allows Pagan rulers to declare War against any Pagan character with less Prestige. For the most part, it works - the part that doesn't work is the part that compares the character's Prestige. Here it is, with the not working part highlighted:

Code:
prestige = {
	name = CB_NAME_PRESTIGE
	war_name = WAR_NAME_PRESTIGE
	sprite = 16
	truce_days = 1825
	hostile_against_others = yes
	is_permanent = yes
	check_all_titles = yes # if permanent, setting this to true will check against all of someones titles, including vassal held titles
	press_claim = yes
	can_ask_to_join_war = yes


	can_use_title = {
	 	OR = {
			tier = count
			tier = duke
			tier = king
			tier = emperor
		}
		OR = {
			FROM = { has_landed_title = PREV }
			holder_scope = { is_liege_or_above = FROM }
		}

		NOT = {
			OR = {
				ROOT = { has_landed_title = PREV }
				holder_scope = { is_liege_or_above = ROOT }
			}
		}
[COLOR="#0000FF"]		ROOT = { 
			religion_group = pagan_group
			{ prestige = FROM }
		}[/COLOR]
		FROM = {
			religion_group = pagan_group

		}
	}

	is_valid_title = {
		OR = {
			FROM = { has_landed_title = PREV }
			holder_scope = { is_liege_or_above = FROM }
		}
	}

	on_success_title = {
		usurp_title_plus_barony_if_unlanded = ROOT
		
		any_attacker = {
			limit = { character = ROOT }
			participation_scaled_prestige = 120
		}
		any_attacker = {
			limit = { NOT = { character = ROOT } }
			hidden_tooltip = { participation_scaled_prestige = 100 }
		}
		
		FROM = {
			prestige = -100
		}
	}

	on_fail_title = {
		ROOT = {
			prestige = -150
		}
		any_defender = {
			limit = { character = FROM }
			participation_scaled_prestige = 120
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = { participation_scaled_prestige = 100 }
		}
	}

	on_reverse_demand = {
		ROOT = {
			prestige = -200
			transfer_scaled_wealth = {
				to = FROM
				value = 4.0
			}
		}
		any_defender = {
			limit = { character = FROM }
			participation_scaled_prestige = 150
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = { participation_scaled_prestige = 150 }
		}
	}

	on_add = {
		ROOT = { prestige = -50 }

	attacker_ai_victory_worth = {
		factor = -1 # always accept
	}
	
	attacker_ai_defeat_worth = {
		factor = 100
	}

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

Edit: Bother, wrong section. Sorry.
Edit: My idiocy is legendary. Only just noticed the Quick Modding thread. To the gallows for me.
 
Last edited: