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

unknownenlord

Grandest Prince
66 Badges
Nov 14, 2011
143
7
  • Europa Universalis IV: Dharma
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Pre-order
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings III
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Sign Up
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • 500k Club
  • Rome: Vae Victis
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Rights of Man
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
You're trying to grant the title to the owner of e_hre, right?
Try something like
e_hre = {
owner = {
k_germany = {
gain_title = PREV }}}

gain_title targets a character, while PREV in your last attempt was a title scope. No guarantees this'll work though.

correct and this does work thanks for your help it's been annoying me for a while the final code is
Code:
e_hre = {			
		owner = {
		k_germany = {
		gain_title = PREV }}
		destroy_landed_title = THIS	
			}
for anyone else wanting to use it . thanks for your help:)
 

burny26

In bruges giving good tumbles
100 Badges
Sep 10, 2010
1.148
54
  • Sengoku
  • Pillars of Eternity
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • March of the Eagles
  • Mount & Blade: Warband
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Semper Fi
  • Heir to the Throne
  • Ship Simulator Extremes
  • Sword of the Stars
  • Pride of Nations
  • Teleglitch: Die More Edition
  • Europa Universalis IV: Cossacks
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Pre-order
  • Magicka 2 - Signup Campaign
  • Europa Universalis III
  • Arsenal of Democracy
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • A Game of Dwarves
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
@burny26:

You'd need to use any_courtier (however, to narrow that down to a *specific* courtier, you need to have a random_courtier in the options section, I believe) (more experienced modders can correct me if I'm wrong).

Anyhow, an example of a trigger:

Code:
	trigger = {
		any_courtier = {
			OR = {
				trait = awesome
				trait = has_three_eyes
			}
		}
	}

So in this case, the event will be triggered if there's a courtier that has the awesome or has three eyes trait.


As for major = yes, I believe it would fire off for everyone in the CKII world (I dunno, that's just my guess though).

Ok thx gents :)
 

cybrxkhan

Going to Scarborough Fair
57 Badges
Jul 14, 2012
8.162
3.938
  • Crusader Kings II: Charlemagne
  • Age of Wonders III
  • Stellaris
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Legacy of Rome
  • Victoria 3 Sign Up
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Cities: Skylines Industries
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome Sign Up
  • Cities: Skylines - Campus
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Stellaris Sign-up
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV Sign-up
  • Surviving Mars
  • Crusader Kings II: Reapers Due
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
@burny26: You probably already know this, but I would suggest looking at a vanilla event that has any_courier and random_courtier (such as some of the guardian events where you can praise the child at court and piss people off), in order to make sure how it works - this is something that still confuses me, and I think I'd be worse f I didn't look at the vanilla events.
 

burny26

In bruges giving good tumbles
100 Badges
Sep 10, 2010
1.148
54
  • Sengoku
  • Pillars of Eternity
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • March of the Eagles
  • Mount & Blade: Warband
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Semper Fi
  • Heir to the Throne
  • Ship Simulator Extremes
  • Sword of the Stars
  • Pride of Nations
  • Teleglitch: Die More Edition
  • Europa Universalis IV: Cossacks
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Pre-order
  • Magicka 2 - Signup Campaign
  • Europa Universalis III
  • Arsenal of Democracy
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • A Game of Dwarves
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
@burny26: You probably already know this, but I would suggest looking at a vanilla event that has any_courier and random_courtier (such as some of the guardian events where you can praise the child at court and piss people off), in order to make sure how it works - this is something that still confuses me, and I think I'd be worse f I didn't look at the vanilla events.

Well im new to coding ,so any help/advice is welcome!
 

A_Dane

Eternal pessimist
83 Badges
Mar 30, 2008
6.910
363
  • Europa Universalis III Complete
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Knights of Honor
  • Stellaris: Apocalypse
  • Heir to the Throne
  • Europa Universalis III Complete
  • The Kings Crusade
  • Lost Empire - Immortals
  • Majesty 2
  • Cities in Motion
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Sengoku
  • Sword of the Stars
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Art of War
  • Hearts of Iron II: Armageddon
  • 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
  • Deus Vult
  • Dungeonland
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Commander: Conquest of the Americas
  • Divine Wind
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Mount & Blade: With Fire and Sword
  • Mount & Blade: Warband
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Stellaris Sign-up
  • Europa Universalis IV
  • Victoria 2
  • Hearts of Iron IV: Cadet
Yes, it's possible to create new graphical culture groups, though if you notice PI has already defined quite a number of graphical culture groups (such as englishgfx, ugricgfx, etc.) that are, for all intents and purposes, unused (although technically they are used in the cultures text file, since they don't have any defined graphics these cultures just defer to northern European, occitanian, muslim, etc.)




I think what you can do is go to cb_types, find the corresponding CB type (I don't know what it is caused), and code in NOT = { has_landed_title = e_hre } in the can_use section for ROOT.

Thanks mate, not sure if it'll do the trick, but it will for something else I had in mind :)

I'll take a look at it and see if I can find the proper CB :)

Also, the holy war CB is the one named "religious", correct?
 

unmerged(589171)

Corporal
1 Badges
Nov 6, 2012
36
0
  • Crusader Kings II
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 to the target's. 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 = {
	 	NOT = { tier = count }
		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="#00FF00"]		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
	}
}
 

ash001

friend&foe
10 Badges
Jun 5, 2009
796
0
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Rome Gold
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
True, I'm pretty certain
Code:
ROOT = { 
			religion_group = pagan_group
			{ prestige = FROM }
		}
doesn't work like that. You would have to provide numbers, like...
Code:
ROOT = {
			prestige = 100 
}
                        FROM = {
                        NOT = { prestige = 100 }
                        }
		}


On another matter, a silly question, something I haven't noticed yet:
some traits are opposite each other, can they still end up with the same character through events?
 

unmerged(589171)

Corporal
1 Badges
Nov 6, 2012
36
0
  • Crusader Kings II
ash001: how sure are you? The reason I tried that is because that's more or less how it's done in the event where one of your vassals/courtiers wishes to be Marshal. Here's the code with the pertinent piece highlighted again. Having to use specific numbers is something I'd like to avoid if possible.

Code:
### MARSHAL ###
character_event = {
	id = 73200
	desc = "EVTDESC73200"	#I want to be marshal, I am better...
	picture = GFX_evt_spymaster
	
	only_men = yes
	min_age = 16
	capable_only = yes
	prisoner = no
	
	trigger = {
		is_ruler = no
		is_councillor = no
		independent = no
		NOT = { liege = { has_character_flag = asked_marshal_petition } }
		NOT = { has_character_flag = asked_for_job }
		[COLOR="#00FF00"]liege = {
			job_marshal = {
				same_liege = ROOT
				NOT = { martial = ROOT }
				NOT = { has_minor_title = title_regent }
			}
		}[/COLOR]
	}
	
	mean_time_to_happen = {
		months = 6
		modifier = {
			factor = 0.25
			trait = ambitious
		}
	}
	
	immediate = {
		set_character_flag = asked_for_job
		liege = {  set_character_flag = asked_marshal_petition }
	}
	
	option = {
		name = "EVTOPTA73200" 
		liege = { letter_event = { id = 73201 tooltip = EVTTOOLTIP73201 } }
	}
}

To answer your question, a trait will overwrite any opposite trait when it's added to a character.
 

ash001

friend&foe
10 Badges
Jun 5, 2009
796
0
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Rome Gold
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
ash001: how sure are you? The reason I tried that is because that's more or less how it's done in the event where one of your vassals/courtiers wishes to be Marshal. Here's the code with the pertinent piece highlighted again. Having to use specific numbers is something I'd like to avoid if possible.

Code:
### MARSHAL ###
character_event = {
	id = 73200
	desc = "EVTDESC73200"	#I want to be marshal, I am better...
	picture = GFX_evt_spymaster
	
	only_men = yes
	min_age = 16
	capable_only = yes
	prisoner = no
	
	trigger = {
		is_ruler = no
		is_councillor = no
		independent = no
		NOT = { liege = { has_character_flag = asked_marshal_petition } }
		NOT = { has_character_flag = asked_for_job }
		[COLOR="#00FF00"]liege = {
			job_marshal = {
				same_liege = ROOT
				NOT = { martial = ROOT }
				NOT = { has_minor_title = title_regent }
			}
		}[/COLOR]

	}
}
Yes, I see what you mean.
But I think it's specific to skills like martial, intrigue, stewardship, and so on.
I don't think treasury, prestige, traits or piety apply the same rule - at least I haven't seen this anywhere...
...and since the code you used didn't work...

...but, of course, I could be wrong and someone else might enlighten us here.

EDIT - in fact, I'll run a test later on to see how this works... A condition or trigger like this could definitely come in handy...
 

unmerged(589171)

Corporal
1 Badges
Nov 6, 2012
36
0
  • Crusader Kings II
Yes, I see what you mean.
But I think it's specific to skills like martial, intrigue, stewardship, and so on.
I don't think treasury, prestige, traits or piety apply the same rule - at least I haven't seen this anywhere...
...and since the code you used didn't work...

...but, of course, I could be wrong and someone else might enlighten us here.

EDIT - in fact, I'll run a test later on to see how this works... A condition or trigger like this could definitely come in handy...
Thanks! I did the same - pray you have better luck than I did. I replaced the word 'prestige' with 'martial'. Unfortunately, it seems you were right as everything then worked appropriately - the Casus Beli was only valid against characters I had greater martial than. It does seem that the prestige function works completely differently. How disappointing. If anybody knows a workaround, please share.
 

ash001

friend&foe
10 Badges
Jun 5, 2009
796
0
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Rome Gold
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • 500k Club
  • Crusader Kings II: Holy Knight (pre-order)
I know this is not a great solution...
but if you were to compare the prestige of another realm by increments of 50 prestige (like this: if realm A > 50, realm B < 50; if realm A > 100, realm B < 100; if realm A > 150, realm B < 150; if realm A > 200, realm B < 200 and so on) you'd have a list of twenty conditions (!) to reach prestige of 1000... but, yeah, it should work.
Not saying it's pretty... cos it ain't. :p
But, apart from the copy and paste, it's fairly straightforward.
 

cybrxkhan

Going to Scarborough Fair
57 Badges
Jul 14, 2012
8.162
3.938
  • Crusader Kings II: Charlemagne
  • Age of Wonders III
  • Stellaris
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Legacy of Rome
  • Victoria 3 Sign Up
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Cities: Skylines Industries
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome Sign Up
  • Cities: Skylines - Campus
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Stellaris Sign-up
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Crusader Kings II: Conclave
  • Cities: Skylines - Snowfall
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV Sign-up
  • Surviving Mars
  • Crusader Kings II: Reapers Due
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
Well im new to coding ,so any help/advice is welcome!

Hmm... some of the summer fair and hunting events might be worth looking at. HEre's an example of one - the first event from the summer_fair_events.txt (it uses any_vasal and random_vassal, but it works the same way as with any_courtier and random_courtier) (also I've simplified the event and deleted parts to save space):

Code:
#Dancing Monkey
character_event = {
	id = 74000
	desc = "EVTDESC74000"
	picture = GFX_evt_jugglers
	
	min_age = 20
	capable_only = yes
	prisoner = no
	only_rulers = yes
	
	trigger = {
		has_character_modifier = holding_summer_fair
		any_vassal = {
			OR = {
				trait = kind
				trait = charitable
				trait = honest
			}
		}
	}
	
	mean_time_to_happen = {
		days = 180
	}
	option = {
		name = "EVTOPTE74000"
		tooltip_info = charitable
		trigger = {
			trait = charitable
		}
		random_vassal = {
			limit = {
				OR = {
					trait = kind
					trait = charitable
					trait = honest
				}
			}
			opinion = {
				modifier = opinion_approves
				who = ROOT
				years = 2
			}
		}
	}
}


What I did to teach myself was to copy the code of events like that exactly and then change it to suit my needs.



Also, the holy war CB is the one named "religious", correct?

Yes indeed.
 

burny26

In bruges giving good tumbles
100 Badges
Sep 10, 2010
1.148
54
  • Sengoku
  • Pillars of Eternity
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • March of the Eagles
  • Mount & Blade: Warband
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Semper Fi
  • Heir to the Throne
  • Ship Simulator Extremes
  • Sword of the Stars
  • Pride of Nations
  • Teleglitch: Die More Edition
  • Europa Universalis IV: Cossacks
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Pre-order
  • Magicka 2 - Signup Campaign
  • Europa Universalis III
  • Arsenal of Democracy
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • A Game of Dwarves
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
Hmm... some of the summer fair and hunting events might be worth looking at. HEre's an example of one - the first event from the summer_fair_events.txt (it uses any_vasal and random_vassal, but it works the same way as with any_courtier and random_courtier) (also I've simplified the event and deleted parts to save space):

Code:
#Dancing Monkey
character_event = {
	id = 74000
	desc = "EVTDESC74000"
	picture = GFX_evt_jugglers
	
	min_age = 20
	capable_only = yes
	prisoner = no
	only_rulers = yes
	
	trigger = {
		has_character_modifier = holding_summer_fair
		any_vassal = {
			OR = {
				trait = kind
				trait = charitable
				trait = honest
			}
		}
	}
	
	mean_time_to_happen = {
		days = 180
	}
	option = {
		name = "EVTOPTE74000"
		tooltip_info = charitable
		trigger = {
			trait = charitable
		}
		random_vassal = {
			limit = {
				OR = {
					trait = kind
					trait = charitable
					trait = honest
				}
			}
			opinion = {
				modifier = opinion_approves
				who = ROOT
				years = 2
			}
		}
	}
}


What I did to teach myself was to copy the code of events like that exactly and then change it to suit my needs.





Yes indeed.

God i wish my tests and exams were over already ,so i can get to start cracking at the code . :/
 

richvh

Preserver of the Light
63 Badges
Dec 1, 2001
14.691
1.999
Visit site
  • Stellaris: Leviathans Story Pack
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Knights of Pen and Paper 2
  • Crusader Kings II: Conclave
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Crusader Kings II: Reapers Due
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • Age of Wonders III
  • Age of Wonders: Shadow Magic
  • Age of Wonders
  • Age of Wonders II
  • Crusader Kings II: Jade Dragon
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV: Call to arms event
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • A Game of Dwarves
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Magicka
  • Majesty 2 Collection
  • Europa Universalis IV: Res Publica
  • Europa Universalis: Rome
  • Rome Gold
  • Rome: Vae Victis
  • 500k Club
  • Cities: Skylines
How would I design an event to impregnate any married female characters of a certain religion?

Something along this line (calling event/decision is left as an exercise):

Code:
character_event = {
	id = xxxx
	desc = "EVTDESCxxxx"

	is_triggered_only = yes
	
	trigger = {
		is_female = yes
		is_married = yes
		is_pregnant = no
		NOT = { age = 45 }		#I assume you don't want post-menopause pregnancies
		religion = fertility_cult		#or whatever your religion is
	}
	
	option = {
		name = "EVTOPTAxxxx"
		
		spouse = {
			ROOT = {
				impregnate = PREV
			}
		}
	}
}

Which part of the vanilla code deals with helping your vassals press their ducal claims? Need to do some cut and paste from there.

common/cb_types/00_cb_types.txt, dejure_county_claim CB.
 

Arko

Red zone
45 Badges
Jul 1, 2009
7.087
1.124
  • Europa Universalis IV
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings III
  • Deus Vult
  • Cities: Skylines
  • Magicka
can I make a building to provide mensual prestige or piety bonus to owner ?
 

richvh

Preserver of the Light
63 Badges
Dec 1, 2001
14.691
1.999
Visit site
  • Stellaris: Leviathans Story Pack
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Knights of Pen and Paper 2
  • Crusader Kings II: Conclave
  • Stellaris
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Crusader Kings II: Reapers Due
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Tyranny: Gold Edition
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • Age of Wonders III
  • Age of Wonders: Shadow Magic
  • Age of Wonders
  • Age of Wonders II
  • Crusader Kings II: Jade Dragon
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV: Call to arms event
  • 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: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • A Game of Dwarves
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Magicka
  • Majesty 2 Collection
  • Europa Universalis IV: Res Publica
  • Europa Universalis: Rome
  • Rome Gold
  • Rome: Vae Victis
  • 500k Club
  • Cities: Skylines
No. Buildings can't directly affect characters.